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`.
This commit is contained in:
FranklinDM 2022-04-13 17:07:05 +08:00 committed by roytam1
commit 4a57663c1d

View file

@ -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)