| Index: src/js/icu-case-mapping.js
|
| diff --git a/src/js/icu-case-mapping.js b/src/js/icu-case-mapping.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ea6ff012704cba0101b2c48b4bb151954f5cbc29
|
| --- /dev/null
|
| +++ b/src/js/icu-case-mapping.js
|
| @@ -0,0 +1,38 @@
|
| +// Copyright 2016 the V8 project authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +(function(global, utils) {
|
| +"use strict";
|
| +
|
| +%CheckIsBootstrapping();
|
| +
|
| +var GlobalString = global.String;
|
| +var OverrideFunction = utils.OverrideFunction;
|
| +var MakeTypeError;
|
| +
|
| +utils.Import(function(from) {
|
| + MakeTypeError = from.MakeTypeError;
|
| +});
|
| +
|
| +OverrideFunction(GlobalString.prototype, 'toLowerCase', function() {
|
| + if (!IS_UNDEFINED(new.target)) {
|
| + throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
|
| + }
|
| + CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLowerCase");
|
| + var s = TO_STRING(this);
|
| + return %StringToLowerCaseI18N(s);
|
| + }
|
| +);
|
| +
|
| +OverrideFunction(GlobalString.prototype, 'toUpperCase', function() {
|
| + if (!IS_UNDEFINED(new.target)) {
|
| + throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
|
| + }
|
| + CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLowerCase");
|
| + var s = TO_STRING(this);
|
| + return %StringToUpperCaseI18N(s);
|
| + }
|
| +);
|
| +
|
| +})
|
|
|