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

Unified Diff: src/js/string.js

Issue 2315343002: [builtins] Move StringNormalize to a cpp builtin. (Closed)
Patch Set: Fix crash caused by ToString on unassigned var Created 4 years, 3 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/builtins/builtins-string.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/string.js
diff --git a/src/js/string.js b/src/js/string.js
index 38caab7b125d1adbe25957d474250faa46eb6f59..00fee68ac9fc6d02598c212d89f9af54d135b84a 100644
--- a/src/js/string.js
+++ b/src/js/string.js
@@ -118,30 +118,6 @@ function StringMatchJS(pattern) {
}
-// ECMA-262 v6, section 21.1.3.12
-//
-// For now we do nothing, as proper normalization requires big tables.
-// If Intl is enabled, then i18n.js will override it and provide the the
-// proper functionality.
-function StringNormalize(formArg) { // length == 0
- CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize");
- var s = TO_STRING(this);
-
- var form = IS_UNDEFINED(formArg) ? 'NFC' : TO_STRING(formArg);
-
- var NORMALIZATION_FORMS = ['NFC', 'NFD', 'NFKC', 'NFKD'];
- var normalizationForm = %ArrayIndexOf(NORMALIZATION_FORMS, form, 0);
- if (normalizationForm === -1) {
- throw %make_range_error(kNormalizationForm,
- %_Call(ArrayJoin, NORMALIZATION_FORMS, ', '));
- }
-
- return s;
-}
-
-%FunctionSetLength(StringNormalize, 0);
-
-
// This has the same size as the RegExpLastMatchInfo array, and can be used
// for functions that expect that structure to be returned. It is used when
// the needle is a string rather than a regexp. In this case we can't update
@@ -740,7 +716,6 @@ utils.InstallFunctions(GlobalString.prototype, DONT_ENUM, [
"lastIndexOf", StringLastIndexOf,
"localeCompare", StringLocaleCompareJS,
"match", StringMatchJS,
- "normalize", StringNormalize,
"repeat", StringRepeat,
"replace", StringReplace,
"search", StringSearch,
« no previous file with comments | « src/builtins/builtins-string.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698