From f2ad2ba0def2430ff8fb8c79dd9e41dbe5ad128a Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Wed, 13 Apr 2022 17:07:05 +0800 Subject: Issue #1382 - Set canonical name for trimStart and trimEnd functions This is needed to fix the assertion on debug builds that self-hosted functions must have consistent names, as these two functions are aliased to `trimLeft` and `trimRight`. --- js/src/builtin/String.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/src/builtin/String.js b/js/src/builtin/String.js index c70f8558be..233a7323b2 100644 --- a/js/src/builtin/String.js +++ b/js/src/builtin/String.js @@ -969,12 +969,14 @@ function String_static_trimStart(string) { ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'String.trimStart'); return callFunction(std_String_trimStart, string); } +_SetCanonicalName(String_static_trimStart, "trimStart"); function String_static_trimEnd(string) { if (arguments.length < 1) ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'String.trimEnd'); return callFunction(std_String_trimEnd, string); } +_SetCanonicalName(String_static_trimEnd, "trimEnd"); function String_static_toLocaleLowerCase(string) { if (arguments.length < 1) -- cgit v1.2.3