diff --git a/client/web/divkit/src/expressions/funcs/std.ts b/client/web/divkit/src/expressions/funcs/std.ts index ccf59b2bc..9ff5e915a 100644 --- a/client/web/divkit/src/expressions/funcs/std.ts +++ b/client/web/divkit/src/expressions/funcs/std.ts @@ -16,7 +16,7 @@ import { MAX_INT, MIN_INT, toBigInt } from '../bigint'; function toString( _ctx: EvalContext, - arg: IntegerValue | NumberValue | BooleanValue | ColorValue | UrlValue + arg: IntegerValue | NumberValue | BooleanValue | ColorValue | UrlValue | StringValue ): EvalValue { return { type: STRING, @@ -190,6 +190,7 @@ export function registerStd(): void { registerFunc('toString', [BOOLEAN], toString); registerFunc('toString', [COLOR], toString); registerFunc('toString', [URL], toString); + registerFunc('toString', [STRING], toString); registerFunc('toNumber', [INTEGER], toNumber); registerFunc('toNumber', [STRING], toNumber); diff --git a/test_data/expression_test_data/function_signatures_to_string.json b/test_data/expression_test_data/function_signatures_to_string.json index 7eac1a96f..3703f0856 100644 --- a/test_data/expression_test_data/function_signatures_to_string.json +++ b/test_data/expression_test_data/function_signatures_to_string.json @@ -110,7 +110,8 @@ ], "result_type": "string", "platforms": [ - "ios" + "ios", + "web" ] }, { diff --git a/test_data/expression_test_data/functions_to_string.json b/test_data/expression_test_data/functions_to_string.json index c081ddcf8..c4f3b552c 100644 --- a/test_data/expression_test_data/functions_to_string.json +++ b/test_data/expression_test_data/functions_to_string.json @@ -268,14 +268,15 @@ { "name": "string to string => error", "expression": "@{toString('abc')}", + "deprecated": true, + "description": "toString(string) should be implmented", "expected": { "type": "error", "value": "Failed to evaluate [toString('abc')]. Function 'toString' has no matching override for given argument types: String." }, "variables": [], "platforms": [ - "android", - "web" + "android" ] }, { @@ -287,7 +288,8 @@ }, "variables": [], "platforms": [ - "ios" + "ios", + "web" ] }, {