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

Side by Side Diff: src/string.js

Issue 1274653002: Ensure `String.prototype.normalize.length` is `0` (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 // Imports 10 // Imports
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 var NORMALIZATION_FORMS = ['NFC', 'NFD', 'NFKC', 'NFKD']; 197 var NORMALIZATION_FORMS = ['NFC', 'NFD', 'NFKC', 'NFKD'];
198 var normalizationForm = 198 var normalizationForm =
199 %_CallFunction(NORMALIZATION_FORMS, form, ArrayIndexOf); 199 %_CallFunction(NORMALIZATION_FORMS, form, ArrayIndexOf);
200 if (normalizationForm === -1) { 200 if (normalizationForm === -1) {
201 throw MakeRangeError(kNormalizationForm, 201 throw MakeRangeError(kNormalizationForm,
202 %_CallFunction(NORMALIZATION_FORMS, ', ', ArrayJoin)); 202 %_CallFunction(NORMALIZATION_FORMS, ', ', ArrayJoin));
203 } 203 }
204 204
205 return %_ValueOf(this); 205 return %_ValueOf(this);
206 } 206 }
207 %FunctionSetLength(StringNormalizeJS, 0);
207 208
208 209
209 // This has the same size as the RegExpLastMatchInfo array, and can be used 210 // This has the same size as the RegExpLastMatchInfo array, and can be used
210 // for functions that expect that structure to be returned. It is used when 211 // for functions that expect that structure to be returned. It is used when
211 // the needle is a string rather than a regexp. In this case we can't update 212 // the needle is a string rather than a regexp. In this case we can't update
212 // lastMatchArray without erroneously affecting the properties on the global 213 // lastMatchArray without erroneously affecting the properties on the global
213 // RegExp object. 214 // RegExp object.
214 var reusableMatchInfo = [2, "", "", -1, -1]; 215 var reusableMatchInfo = [2, "", "", -1, -1];
215 216
216 217
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 to.StringIndexOf = StringIndexOfJS; 1199 to.StringIndexOf = StringIndexOfJS;
1199 to.StringLastIndexOf = StringLastIndexOfJS; 1200 to.StringLastIndexOf = StringLastIndexOfJS;
1200 to.StringMatch = StringMatchJS; 1201 to.StringMatch = StringMatchJS;
1201 to.StringReplace = StringReplace; 1202 to.StringReplace = StringReplace;
1202 to.StringSplit = StringSplitJS; 1203 to.StringSplit = StringSplitJS;
1203 to.StringSubstr = StringSubstr; 1204 to.StringSubstr = StringSubstr;
1204 to.StringSubstring = StringSubstring; 1205 to.StringSubstring = StringSubstring;
1205 }); 1206 });
1206 1207
1207 }) 1208 })
OLDNEW
« src/i18n.js ('K') | « src/i18n.js ('k') | test/intl/string/normalization.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698