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

Unified Diff: src/i18n.js

Issue 1274653002: Ensure `String.prototype.normalize.length` is `0` (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update as per @rossberg’s feedback 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/string.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/i18n.js
diff --git a/src/i18n.js b/src/i18n.js
index 1028bbb07b3d70706290848f14110d4bee8d7dd5..53cc48714704169e6ac6d620a6299be8f206d827 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -1995,14 +1995,16 @@ OverrideFunction(GlobalString.prototype, 'localeCompare', function(that) {
* If the form is not one of "NFC", "NFD", "NFKC", or "NFKD", then throw
* a RangeError Exception.
*/
-OverrideFunction(GlobalString.prototype, 'normalize', function(form) {
+
+OverrideFunction(GlobalString.prototype, 'normalize', function() {
if (%_IsConstructCall()) {
throw MakeTypeError(kOrdinaryFunctionCalledAsConstructor);
}
CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize");
- form = IS_UNDEFINED(form) ? 'NFC' : form;
+ var formArg = %_Arguments(0);
+ var form = IS_UNDEFINED(formArg) ? 'NFC' : TO_STRING_INLINE(formArg);
var NORMALIZATION_FORMS = ['NFC', 'NFD', 'NFKC', 'NFKD'];
« no previous file with comments | « no previous file | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698