Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/js/icu-case-mapping.js

Issue 1812673005: Use ICU case conversion/transliterator for case conversion behind a flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: move toLocale{U,L}Case behind --icu-case-mapping, too; adjust test status accordingly. roll back st… Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/js/i18n.js ('k') | src/js/prologue.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 (function(global, utils) {
6 "use strict";
7
8 %CheckIsBootstrapping();
9
10 var GlobalString = global.String;
11 var OverrideFunction = utils.OverrideFunction;
12 var MakeTypeError;
13 var LocaleConvertCase = utils.ImportNow("LocaleConvertCase");
Dan Ehrenberg 2016/05/04 00:13:08 Rather than using ImportNow (generally dispreferre
jungshik at Google 2016/05/04 19:02:58 Done.
14
15 utils.Import(function(from) {
16 MakeTypeError = from.MakeTypeError;
17 });
18
19 OverrideFunction(GlobalString.prototype, 'toLowerCase', function() {
jungshik at Google 2016/05/04 19:02:58 offline, you're worried about actually defining fu
Dan Ehrenberg 2016/05/04 19:06:37 That's what I was suggesting, though if you found
20 if (!IS_UNDEFINED(new.target)) {
21 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
22 }
23 CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLowerCase");
24 var s = TO_STRING(this);
25 return %StringToLowerCaseI18N(s);
26 }
27 );
28
29 OverrideFunction(GlobalString.prototype, 'toUpperCase', function() {
30 if (!IS_UNDEFINED(new.target)) {
31 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
32 }
33 CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLowerCase");
34 var s = TO_STRING(this);
35 return %StringToUpperCaseI18N(s);
36 }
37 );
38
39 OverrideFunction(GlobalString.prototype, 'toLocaleLowerCase', function() {
40 if (!IS_UNDEFINED(new.target)) {
41 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
42 }
43 CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLocaleLowerCase");
44 return LocaleConvertCase(TO_STRING(this), arguments[0], false);
45 }
46 );
47
48 OverrideFunction(GlobalString.prototype, 'toLocaleUpperCase', function() {
49 if (!IS_UNDEFINED(new.target)) {
50 throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
51 }
52 CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLocaleUpperCase");
53 return LocaleConvertCase(TO_STRING(this), arguments[0], true);
54 }
55 );
56
57 })
OLDNEW
« no previous file with comments | « src/js/i18n.js ('k') | src/js/prologue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698