[es6] Add appropriate ToString call to String.prototype.normalize
authoradamk <adamk@chromium.org>
Tue, 11 Aug 2015 00:11:58 +0000 (17:11 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 11 Aug 2015 00:12:12 +0000 (00:12 +0000)
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
src/string.js
test/test262-es6/test262-es6.status

index 53cc487..2b8ba90 100644 (file)
@@ -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);
   }
 );
 
index dd2b9d7..331f98d 100644 (file)
@@ -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;
 }
 
 
index ae72ea9..8e8ab90 100644 (file)
   '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],