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

Unified Diff: src/string.js

Issue 1237873003: [es6] Fix String.prototype.normalize to properly validate argument (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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/i18n.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 3ddd6d26cedfd9e49a5e624e071f0caeb005fba7..f3d9ce34ec5e18445f0d181f4729d80aacec3247 100644
--- a/src/string.js
+++ b/src/string.js
@@ -192,7 +192,7 @@ function StringMatchJS(regexp) {
function StringNormalizeJS(form) {
CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize");
- var form = form ? TO_STRING_INLINE(form) : 'NFC';
+ var form = IS_UNDEFINED(form) ? 'NFC' : TO_STRING_INLINE(form);
var NORMALIZATION_FORMS = ['NFC', 'NFD', 'NFKC', 'NFKD'];
var normalizationForm =
« no previous file with comments | « src/i18n.js ('k') | test/mjsunit/string-normalize.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698