Commit 6f59af6d authored by Mathias Bynens's avatar Mathias Bynens Committed by Commit Bot

Remove always-true --harmony-string-trimming runtime flag

It was shipped in Chrome 66.

Bug: v8:6530, v8:8238
Change-Id: I07e95073ffcf388659b9d0b16a081e0f5a5eedaf
Reviewed-on: https://chromium-review.googlesource.com/1253603Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56323}
parent e2a577c1
......@@ -2089,10 +2089,23 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Builtins::kStringPrototypeToString, 0, true);
SimpleInstallFunction(isolate_, prototype, "trim",
Builtins::kStringPrototypeTrim, 0, false);
SimpleInstallFunction(isolate_, prototype, "trimLeft",
// Install `String.prototype.trimStart` with `trimLeft` alias.
Handle<JSFunction> trim_start_fun =
SimpleInstallFunction(isolate_, prototype, "trimStart",
Builtins::kStringPrototypeTrimStart, 0, false);
SimpleInstallFunction(isolate_, prototype, "trimRight",
JSObject::AddProperty(isolate_, prototype,
factory->InternalizeUtf8String("trimLeft"),
trim_start_fun, DONT_ENUM);
// Install `String.prototype.trimEnd` with `trimRight` alias.
Handle<JSFunction> trim_end_fun =
SimpleInstallFunction(isolate_, prototype, "trimEnd",
Builtins::kStringPrototypeTrimEnd, 0, false);
JSObject::AddProperty(isolate_, prototype,
factory->InternalizeUtf8String("trimRight"),
trim_end_fun, DONT_ENUM);
SimpleInstallFunction(isolate_, prototype, "toLocaleLowerCase",
Builtins::kStringPrototypeToLocaleLowerCase, 0,
false);
......@@ -4418,40 +4431,6 @@ void Genesis::InitializeGlobal_harmony_sharedarraybuffer() {
}
}
void Genesis::InitializeGlobal_harmony_string_trimming() {
if (!FLAG_harmony_string_trimming) return;
Handle<JSGlobalObject> global(native_context()->global_object(), isolate());
Factory* factory = isolate()->factory();
Handle<JSObject> string_prototype(
native_context()->initial_string_prototype(), isolate());
{
Handle<String> trim_left_name = factory->InternalizeUtf8String("trimLeft");
Handle<String> trim_start_name =
factory->InternalizeUtf8String("trimStart");
Handle<JSFunction> trim_left_fun = Handle<JSFunction>::cast(
JSObject::GetProperty(isolate_, string_prototype, trim_left_name)
.ToHandleChecked());
JSObject::AddProperty(isolate_, string_prototype, trim_start_name,
trim_left_fun, DONT_ENUM);
trim_left_fun->shared()->SetName(*trim_start_name);
}
{
Handle<String> trim_right_name =
factory->InternalizeUtf8String("trimRight");
Handle<String> trim_end_name = factory->InternalizeUtf8String("trimEnd");
Handle<JSFunction> trim_right_fun = Handle<JSFunction>::cast(
JSObject::GetProperty(isolate_, string_prototype, trim_right_name)
.ToHandleChecked());
JSObject::AddProperty(isolate_, string_prototype, trim_end_name,
trim_right_fun, DONT_ENUM);
trim_right_fun->shared()->SetName(*trim_end_name);
}
}
void Genesis::InitializeGlobal_harmony_array_prototype_values() {
if (!FLAG_harmony_array_prototype_values) return;
Handle<JSFunction> array_constructor(native_context()->array_function(),
......
......@@ -235,7 +235,6 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields)
// Features that are shipping (turned on by default, but internal flag remains).
#define HARMONY_SHIPPING_BASE(V) \
V(harmony_string_trimming, "harmony String.prototype.trim{Start,End}") \
V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
V(harmony_function_tostring, "harmony Function.prototype.toString") \
V(harmony_import_meta, "harmony import.meta property") \
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-string-trimming
assertEquals('trim', String.prototype.trim.name);
assertEquals('trimStart', String.prototype.trimStart.name);
assertEquals('trimStart', String.prototype.trimLeft.name);
......
......@@ -21,8 +21,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --harmony-string-trimming
description("This test checks the `trim`, `trimStart`/`trimLeft`, and `trimEnd`/`trimRight` methods on `String.prototype`.");
// References to trim(), trimLeft() and trimRight() functions for testing Function's *.call() and *.apply() methods
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment