Bug 1434007 - Enable String.prototype.trim{Start,End} by default. r=till
authorAndré Bargull <andre.bargull@gmail.com>
Thu, 22 Mar 2018 15:39:08 -0700
changeset 409709 6771d444d64f8d1f7c0148f59e28199975cb0c0f
parent 409708 c4f12e0022ceb22204bf3d7be70e37e64e0e6514
child 409710 7196c7b63af51b678344c5127b220bd4b12cf81d
push id33697
push userrgurzau@mozilla.com
push dateFri, 23 Mar 2018 22:01:33 +0000
treeherdermozilla-central@d7b0d0e7228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs1434007
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1434007 - Enable String.prototype.trim{Start,End} by default. r=till
js/src/builtin/String.cpp
js/src/tests/jstests.list
--- a/js/src/builtin/String.cpp
+++ b/js/src/builtin/String.cpp
@@ -3287,23 +3287,18 @@ static const JSFunctionSpec string_metho
     JS_SELF_HOSTED_FN("padEnd", "String_pad_end", 2,0),
     JS_SELF_HOSTED_FN("codePointAt", "String_codePointAt", 1,0),
     JS_FN("includes",          str_includes,          1,0),
     JS_FN("indexOf",           str_indexOf,           1,0),
     JS_FN("lastIndexOf",       str_lastIndexOf,       1,0),
     JS_FN("startsWith",        str_startsWith,        1,0),
     JS_FN("endsWith",          str_endsWith,          1,0),
     JS_FN("trim",              str_trim,              0,0),
-#ifdef NIGHTLY_BUILD
     JS_FN("trimStart",         str_trimStart,         0,0),
     JS_FN("trimEnd",           str_trimEnd,           0,0),
-#else
-    JS_FN("trimLeft",          str_trimStart,         0,0),
-    JS_FN("trimRight",         str_trimEnd,           0,0),
-#endif
 #if EXPOSE_INTL_API
     JS_SELF_HOSTED_FN("toLocaleLowerCase", "String_toLocaleLowerCase", 0,0),
     JS_SELF_HOSTED_FN("toLocaleUpperCase", "String_toLocaleUpperCase", 0,0),
     JS_SELF_HOSTED_FN("localeCompare", "String_localeCompare", 1,0),
 #else
     JS_FN("toLocaleLowerCase", str_toLocaleLowerCase, 0,0),
     JS_FN("toLocaleUpperCase", str_toLocaleUpperCase, 0,0),
     JS_FN("localeCompare",     str_localeCompare,     1,0),
@@ -3652,17 +3647,16 @@ js::InitStringClass(JSContext* cx, Handl
         return nullptr;
 
     if (!DefinePropertiesAndFunctions(cx, proto, nullptr, string_methods) ||
         !DefinePropertiesAndFunctions(cx, ctor, nullptr, string_static_methods))
     {
         return nullptr;
     }
 
-#ifdef NIGHTLY_BUILD
     // Create "trimLeft" as an alias for "trimStart".
     RootedValue trimFn(cx);
     RootedId trimId(cx, NameToId(cx->names().trimStart));
     RootedId trimAliasId(cx, NameToId(cx->names().trimLeft));
     if (!NativeGetProperty(cx, protoObj, trimId, &trimFn) ||
         !NativeDefineDataProperty(cx, protoObj, trimAliasId, trimFn, 0))
     {
         return nullptr;
@@ -3671,17 +3665,16 @@ js::InitStringClass(JSContext* cx, Handl
     // Create "trimRight" as an alias for "trimEnd".
     trimId = NameToId(cx->names().trimEnd);
     trimAliasId = NameToId(cx->names().trimRight);
     if (!NativeGetProperty(cx, protoObj, trimId, &trimFn) ||
         !NativeDefineDataProperty(cx, protoObj, trimAliasId, trimFn, 0))
     {
         return nullptr;
     }
-#endif
 
     /*
      * Define escape/unescape, the URI encode/decode functions, and maybe
      * uneval on the global object.
      */
     if (!JS_DefineFunctions(cx, global, string_functions))
         return nullptr;
 
--- a/js/src/tests/jstests.list
+++ b/js/src/tests/jstests.list
@@ -45,22 +45,16 @@ skip-if(!this.hasOwnProperty("SIMD")) in
 skip-if(!this.hasOwnProperty("SharedArrayBuffer")) script non262/SIMD/load-sab-buffer-compat.js
 skip-if(!this.hasOwnProperty("Atomics")) include test262/built-ins/Atomics/jstests.list
 skip-if(!this.hasOwnProperty("SharedArrayBuffer")) include test262/built-ins/SharedArrayBuffer/jstests.list
 
 # flatMap and flatten are Nightly-only
 skip-if(!Array.prototype.flatMap) include test262/built-ins/Array/prototype/flatMap/jstests.list
 skip-if(!Array.prototype.flatten) include test262/built-ins/Array/prototype/flatten/jstests.list
 
-# trimStart and trimEnd are Nightly-only
-skip-if(!String.prototype.trimStart) include test262/built-ins/String/prototype/trimStart/jstests.list
-skip-if(!String.prototype.trimStart) include test262/annexB/built-ins/String/prototype/trimLeft/jstests.list
-skip-if(!String.prototype.trimEnd) include test262/built-ins/String/prototype/trimEnd/jstests.list
-skip-if(!String.prototype.trimEnd) include test262/annexB/built-ins/String/prototype/trimRight/jstests.list
-
 
 #####################################
 # Test262 tests disabled on browser #
 #####################################
 
 # Defines a non-configurable property on the WindowProxy object.
 skip-if(!xulRuntime.shell) script test262/annexB/language/eval-code/direct/global-block-decl-eval-global-existing-global-update.js
 skip-if(!xulRuntime.shell) script test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-existing-global-update.js