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); |
|
Yang
2016/12/16 14:02:21
Is this a spec change? So this function can be cal
jungshik at Google
2016/12/16 18:12:36
I asked about this previously because having that
Dan Ehrenberg
2016/12/17 00:42:19
The %FunctionRemovePrototype call should be enough
jungshik at Google
2016/12/19 06:38:56
Thank you for confirming, Dan.
I dropped the che
|
| - } |
| 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); |
| } |