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

Side by Side Diff: src/string.js

Issue 1096243003: Migrate error messages, part 5 (array.js and i18n.js). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/messages.js ('k') | src/uri.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var $stringCharAt; 5 var $stringCharAt;
6 var $stringIndexOf; 6 var $stringIndexOf;
7 var $stringSubstring; 7 var $stringSubstring;
8 8
9 (function() { 9 (function() {
10 10
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // 172 //
173 // For now we do nothing, as proper normalization requires big tables. 173 // For now we do nothing, as proper normalization requires big tables.
174 // If Intl is enabled, then i18n.js will override it and provide the the 174 // If Intl is enabled, then i18n.js will override it and provide the the
175 // proper functionality. 175 // proper functionality.
176 function StringNormalizeJS(form) { 176 function StringNormalizeJS(form) {
177 CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize"); 177 CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize");
178 178
179 var form = form ? TO_STRING_INLINE(form) : 'NFC'; 179 var form = form ? TO_STRING_INLINE(form) : 'NFC';
180 var normalizationForm = NORMALIZATION_FORMS.indexOf(form); 180 var normalizationForm = NORMALIZATION_FORMS.indexOf(form);
181 if (normalizationForm === -1) { 181 if (normalizationForm === -1) {
182 throw new $RangeError('The normalization form should be one of ' 182 throw MakeRangeError(kNormalizationForm, NORMALIZATION_FORMS.join(', '));
183 + NORMALIZATION_FORMS.join(', ') + '.');
184 } 183 }
185 184
186 return %_ValueOf(this); 185 return %_ValueOf(this);
187 } 186 }
188 187
189 188
190 // This has the same size as the $regexpLastMatchInfo array, and can be used 189 // This has the same size as the $regexpLastMatchInfo array, and can be used
191 // for functions that expect that structure to be returned. It is used when 190 // for functions that expect that structure to be returned. It is used when
192 // the needle is a string rather than a regexp. In this case we can't update 191 // the needle is a string rather than a regexp. In this case we can't update
193 // lastMatchArray without erroneously affecting the properties on the global 192 // lastMatchArray without erroneously affecting the properties on the global
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 "strike", StringStrike, 1173 "strike", StringStrike,
1175 "sub", StringSub, 1174 "sub", StringSub,
1176 "sup", StringSup 1175 "sup", StringSup
1177 ]); 1176 ]);
1178 1177
1179 $stringCharAt = StringCharAtJS; 1178 $stringCharAt = StringCharAtJS;
1180 $stringIndexOf = StringIndexOfJS; 1179 $stringIndexOf = StringIndexOfJS;
1181 $stringSubstring = StringSubstring; 1180 $stringSubstring = StringSubstring;
1182 1181
1183 })(); 1182 })();
OLDNEW
« no previous file with comments | « src/messages.js ('k') | src/uri.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698