| Index: src/bootstrapper.cc
|
| diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
|
| index 7e0800b0d17f008b47db594a1a0a4ecf76e5ff1b..c87a4beecc75419d0aea9dfc56ec790789a57d15 100644
|
| --- a/src/bootstrapper.cc
|
| +++ b/src/bootstrapper.cc
|
| @@ -1724,10 +1724,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
|
| SimpleInstallFunction(prototype, "toLocaleUpperCase",
|
| Builtins::kStringPrototypeToLocaleUpperCase, 0,
|
| false);
|
| - SimpleInstallFunction(prototype, "toLowerCase",
|
| - Builtins::kStringPrototypeToLowerCase, 0, false);
|
| - SimpleInstallFunction(prototype, "toUpperCase",
|
| - Builtins::kStringPrototypeToUpperCase, 0, false);
|
| +
|
| SimpleInstallFunction(prototype, "valueOf",
|
| Builtins::kStringPrototypeValueOf, 0, true);
|
|
|
| @@ -3829,45 +3826,42 @@ void SetFunction(Handle<JSObject> target, Handle<JSFunction> function,
|
| } // namespace
|
|
|
| void Genesis::InitializeGlobal_icu_case_mapping() {
|
| - if (!FLAG_icu_case_mapping) return;
|
| -
|
| - Handle<JSReceiver> exports_container(
|
| - JSReceiver::cast(native_context()->exports_container()));
|
| -
|
| Handle<JSObject> string_prototype(
|
| JSObject::cast(native_context()->string_function()->prototype()));
|
|
|
| - Handle<JSFunction> to_lower_case = Handle<JSFunction>::cast(
|
| - JSReceiver::GetProperty(
|
| - exports_container,
|
| - factory()->InternalizeUtf8String("ToLowerCaseI18N"))
|
| - .ToHandleChecked());
|
| - SetFunction(string_prototype, to_lower_case,
|
| - factory()->InternalizeUtf8String("toLowerCase"));
|
| + if (FLAG_icu_case_mapping) {
|
| + // ICU
|
| + Handle<JSReceiver> exports_container(
|
| + JSReceiver::cast(native_context()->exports_container()));
|
|
|
| - Handle<JSFunction> to_upper_case = Handle<JSFunction>::cast(
|
| - JSReceiver::GetProperty(
|
| - exports_container,
|
| - factory()->InternalizeUtf8String("ToUpperCaseI18N"))
|
| - .ToHandleChecked());
|
| - SetFunction(string_prototype, to_upper_case,
|
| - factory()->InternalizeUtf8String("toUpperCase"));
|
| + SimpleInstallFunction(string_prototype, "toLowerCase",
|
| + Builtins::kStringPrototypeToLowerCaseI18N, 0, false);
|
| + SimpleInstallFunction(string_prototype, "toUpperCase",
|
| + Builtins::kStringPrototypeToUpperCaseI18N, 0, false);
|
|
|
| - Handle<JSFunction> to_locale_lower_case = Handle<JSFunction>::cast(
|
| - JSReceiver::GetProperty(
|
| - exports_container,
|
| - factory()->InternalizeUtf8String("ToLocaleLowerCaseI18N"))
|
| - .ToHandleChecked());
|
| - SetFunction(string_prototype, to_locale_lower_case,
|
| - factory()->InternalizeUtf8String("toLocaleLowerCase"));
|
| + Handle<JSFunction> to_locale_lower_case = Handle<JSFunction>::cast(
|
| + JSReceiver::GetProperty(
|
| + exports_container,
|
| + factory()->InternalizeUtf8String("ToLocaleLowerCaseI18N"))
|
| + .ToHandleChecked());
|
| + SetFunction(string_prototype, to_locale_lower_case,
|
| + factory()->InternalizeUtf8String("toLocaleLowerCase"));
|
|
|
| - Handle<JSFunction> to_locale_upper_case = Handle<JSFunction>::cast(
|
| - JSReceiver::GetProperty(
|
| - exports_container,
|
| - factory()->InternalizeUtf8String("ToLocaleUpperCaseI18N"))
|
| - .ToHandleChecked());
|
| - SetFunction(string_prototype, to_locale_upper_case,
|
| - factory()->InternalizeUtf8String("toLocaleUpperCase"));
|
| + Handle<JSFunction> to_locale_upper_case = Handle<JSFunction>::cast(
|
| + JSReceiver::GetProperty(
|
| + exports_container,
|
| + factory()->InternalizeUtf8String("ToLocaleUpperCaseI18N"))
|
| + .ToHandleChecked());
|
| + SetFunction(string_prototype, to_locale_upper_case,
|
| + factory()->InternalizeUtf8String("toLocaleUpperCase"));
|
| +
|
| + } else {
|
| + // Unibrow
|
| + SimpleInstallFunction(string_prototype, "toLowerCase",
|
| + Builtins::kStringPrototypeToLowerCase, 0, false);
|
| + SimpleInstallFunction(string_prototype, "toUpperCase",
|
| + Builtins::kStringPrototypeToUpperCase, 0, false);
|
| + }
|
| }
|
| #endif
|
|
|
|
|