| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }) |
| OLD | NEW |