From f2acba0e8c0adc16fe6235f74067df771f500092 Mon Sep 17 00:00:00 2001 From: adamk Date: Mon, 10 Aug 2015 17:11:58 -0700 Subject: [PATCH] [es6] Add appropriate ToString call to String.prototype.normalize R=littledan@chromium.org BUG=v8:4304 LOG=n Review URL: https://codereview.chromium.org/1282013002 Cr-Commit-Position: refs/heads/master@{#30098} --- src/i18n.js | 3 ++- src/string.js | 3 ++- test/test262-es6/test262-es6.status | 8 -------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/i18n.js b/src/i18n.js index 53cc487..2b8ba90 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -2002,6 +2002,7 @@ OverrideFunction(GlobalString.prototype, 'normalize', function() { } CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize"); + var s = TO_STRING_INLINE(this); var formArg = %_Arguments(0); var form = IS_UNDEFINED(formArg) ? 'NFC' : TO_STRING_INLINE(formArg); @@ -2015,7 +2016,7 @@ OverrideFunction(GlobalString.prototype, 'normalize', function() { %_CallFunction(NORMALIZATION_FORMS, ', ', ArrayJoin)); } - return %StringNormalize(this, normalizationForm); + return %StringNormalize(s, normalizationForm); } ); diff --git a/src/string.js b/src/string.js index dd2b9d7..331f98d 100644 --- a/src/string.js +++ b/src/string.js @@ -191,6 +191,7 @@ function StringMatchJS(regexp) { // proper functionality. function StringNormalizeJS() { CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize"); + var s = TO_STRING_INLINE(this); var formArg = %_Arguments(0); var form = IS_UNDEFINED(formArg) ? 'NFC' : TO_STRING_INLINE(formArg); @@ -203,7 +204,7 @@ function StringNormalizeJS() { %_CallFunction(NORMALIZATION_FORMS, ', ', ArrayJoin)); } - return %_ValueOf(this); + return s; } diff --git a/test/test262-es6/test262-es6.status b/test/test262-es6/test262-es6.status index ae72ea9..8e8ab90 100644 --- a/test/test262-es6/test262-es6.status +++ b/test/test262-es6/test262-es6.status @@ -737,14 +737,6 @@ 'built-ins/RegExp/prototype/source/name': [FAIL], 'built-ins/RegExp/prototype/sticky/name': [FAIL], - # https://code.google.com/p/v8/issues/detail?id=4350 - # Some of these pass when i18n.js is not loaded and fail when it is - 'built-ins/String/prototype/normalize/return-abrupt-from-form': [PASS, FAIL], - 'built-ins/String/prototype/normalize/return-abrupt-from-form-as-symbol': [PASS, FAIL], - 'built-ins/String/prototype/normalize/return-abrupt-from-this': [FAIL], - 'built-ins/String/prototype/normalize/return-abrupt-from-this-as-symbol': [FAIL], - 'built-ins/String/prototype/normalize/return-normalized-string-from-coerced-form': [PASS, FAIL], - # https://code.google.com/p/v8/issues/detail?id=4360 'intl402/Collator/10.1.1_1': [FAIL], 'intl402/DateTimeFormat/12.1.1_1': [FAIL], -- 2.7.4