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

Unified Diff: src/string.js

Issue 1199813004: i18n.js was not using original functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use match instead of exec Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/regexp.js ('k') | test/mjsunit/string-normalize.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string.js
diff --git a/src/string.js b/src/string.js
index d8b37e28a981c8c85bef62f12f2e2881677f4fde..3ddd6d26cedfd9e49a5e624e071f0caeb005fba7 100644
--- a/src/string.js
+++ b/src/string.js
@@ -14,6 +14,8 @@ var GlobalString = global.String;
var InternalArray = utils.InternalArray;
var InternalPackedArray = utils.InternalPackedArray;
+var ArrayIndexOf;
+var ArrayJoin;
var MathMax;
var MathMin;
var RegExpExec;
@@ -21,6 +23,8 @@ var RegExpExecNoTests;
var RegExpLastMatchInfo;
utils.Import(function(from) {
+ ArrayIndexOf = from.ArrayIndexOf;
+ ArrayJoin = from.ArrayJoin;
MathMax = from.MathMax;
MathMin = from.MathMin;
RegExpExec = from.RegExpExec;
@@ -191,10 +195,11 @@ function StringNormalizeJS(form) {
var form = form ? TO_STRING_INLINE(form) : 'NFC';
var NORMALIZATION_FORMS = ['NFC', 'NFD', 'NFKC', 'NFKD'];
-
- var normalizationForm = NORMALIZATION_FORMS.indexOf(form);
+ var normalizationForm =
+ %_CallFunction(NORMALIZATION_FORMS, form, ArrayIndexOf);
if (normalizationForm === -1) {
- throw MakeRangeError(kNormalizationForm, NORMALIZATION_FORMS.join(', '));
+ throw MakeRangeError(kNormalizationForm,
+ %_CallFunction(NORMALIZATION_FORMS, ', ', ArrayJoin));
}
return %_ValueOf(this);
@@ -1191,6 +1196,11 @@ utils.InstallFunctions(GlobalString.prototype, DONT_ENUM, [
utils.Export(function(to) {
to.StringCharAt = StringCharAtJS;
to.StringIndexOf = StringIndexOfJS;
+ to.StringLastIndexOf = StringLastIndexOfJS;
+ to.StringMatch = StringMatchJS;
+ to.StringReplace = StringReplace;
+ to.StringSplit = StringSplitJS;
+ to.StringSubstr = StringSubstr;
to.StringSubstring = StringSubstring;
});
« no previous file with comments | « src/regexp.js ('k') | test/mjsunit/string-normalize.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698