Reviewers: Dan Ehrenberg,

Description:
[es6] Add appropriate ToString call to String.prototype.normalize

[email protected]
BUG=v8:4304
LOG=n

Please review this at https://codereview.chromium.org/1282013002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+4, -10 lines):
  M src/i18n.js
  M src/string.js
  M test/test262-es6/test262-es6.status


Index: src/i18n.js
diff --git a/src/i18n.js b/src/i18n.js
index 53cc48714704169e6ac6d620a6299be8f206d827..2b8ba90c278ff2e6572505382627eab83c029de1 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);
   }
 );

Index: src/string.js
diff --git a/src/string.js b/src/string.js
index dd2b9d7b9cae7c315279a8ba7ac9d02f68ed9025..331f98d28e70c6695248852fcfb05be44d6fd4b0 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;
 }


Index: test/test262-es6/test262-es6.status
diff --git a/test/test262-es6/test262-es6.status b/test/test262-es6/test262-es6.status index ae72ea9d1b7b0da4b57bb12bc4846d1dad3801cc..8e8ab909840b5348817c64af80eab71452fab776 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],


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to