Chromium Code Reviews| Index: src/js/i18n.js |
| diff --git a/src/js/i18n.js b/src/js/i18n.js |
| index b051b090bcee57af0da4a558eb4c79fa824ba426..678f5ce490bb6cb8bd739a3c2cfaab6ebca0bd05 100644 |
| --- a/src/js/i18n.js |
| +++ b/src/js/i18n.js |
| @@ -2121,27 +2121,16 @@ OverrideFunction(GlobalString.prototype, 'normalize', function() { |
| ); |
| function ToLowerCaseI18N() { |
| - if (!IS_UNDEFINED(new.target)) { |
| - throw %make_type_error(kOrdinaryFunctionCalledAsConstructor); |
| - } |
|
jungshik at Google
2016/12/02 06:52:38
WIth this check in place, the JS portion of profil
Dan Ehrenberg
2016/12/02 23:35:08
I don't understand why that check is in there. I c
|
| CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLowerCase"); |
| - var s = TO_STRING(this); |
| - return %StringToLowerCaseI18N(s); |
| + return %StringToLowerCaseI18N(TO_STRING(this)); |
| } |
| function ToUpperCaseI18N() { |
| - if (!IS_UNDEFINED(new.target)) { |
| - throw %make_type_error(kOrdinaryFunctionCalledAsConstructor); |
| - } |
| CHECK_OBJECT_COERCIBLE(this, "String.prototype.toUpperCase"); |
| - var s = TO_STRING(this); |
| - return %StringToUpperCaseI18N(s); |
| + return %StringToUpperCaseI18N(TO_STRING(this)); |
| } |
| function ToLocaleLowerCaseI18N(locales) { |
| - if (!IS_UNDEFINED(new.target)) { |
| - throw %make_type_error(kOrdinaryFunctionCalledAsConstructor); |
| - } |
| CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLocaleLowerCase"); |
| return LocaleConvertCase(TO_STRING(this), locales, false); |
| } |
| @@ -2149,9 +2138,6 @@ function ToLocaleLowerCaseI18N(locales) { |
| %FunctionSetLength(ToLocaleLowerCaseI18N, 0); |
| function ToLocaleUpperCaseI18N(locales) { |
| - if (!IS_UNDEFINED(new.target)) { |
| - throw %make_type_error(kOrdinaryFunctionCalledAsConstructor); |
| - } |
| CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLocaleUpperCase"); |
| return LocaleConvertCase(TO_STRING(this), locales, true); |
| } |