Commit f2acba0e authored by adamk's avatar adamk Committed by Commit bot

[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}
parent 3444bb64
...@@ -2002,6 +2002,7 @@ OverrideFunction(GlobalString.prototype, 'normalize', function() { ...@@ -2002,6 +2002,7 @@ OverrideFunction(GlobalString.prototype, 'normalize', function() {
} }
CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize"); CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize");
var s = TO_STRING_INLINE(this);
var formArg = %_Arguments(0); var formArg = %_Arguments(0);
var form = IS_UNDEFINED(formArg) ? 'NFC' : TO_STRING_INLINE(formArg); var form = IS_UNDEFINED(formArg) ? 'NFC' : TO_STRING_INLINE(formArg);
...@@ -2015,7 +2016,7 @@ OverrideFunction(GlobalString.prototype, 'normalize', function() { ...@@ -2015,7 +2016,7 @@ OverrideFunction(GlobalString.prototype, 'normalize', function() {
%_CallFunction(NORMALIZATION_FORMS, ', ', ArrayJoin)); %_CallFunction(NORMALIZATION_FORMS, ', ', ArrayJoin));
} }
return %StringNormalize(this, normalizationForm); return %StringNormalize(s, normalizationForm);
} }
); );
......
...@@ -191,6 +191,7 @@ function StringMatchJS(regexp) { ...@@ -191,6 +191,7 @@ function StringMatchJS(regexp) {
// proper functionality. // proper functionality.
function StringNormalizeJS() { function StringNormalizeJS() {
CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize"); CHECK_OBJECT_COERCIBLE(this, "String.prototype.normalize");
var s = TO_STRING_INLINE(this);
var formArg = %_Arguments(0); var formArg = %_Arguments(0);
var form = IS_UNDEFINED(formArg) ? 'NFC' : TO_STRING_INLINE(formArg); var form = IS_UNDEFINED(formArg) ? 'NFC' : TO_STRING_INLINE(formArg);
...@@ -203,7 +204,7 @@ function StringNormalizeJS() { ...@@ -203,7 +204,7 @@ function StringNormalizeJS() {
%_CallFunction(NORMALIZATION_FORMS, ', ', ArrayJoin)); %_CallFunction(NORMALIZATION_FORMS, ', ', ArrayJoin));
} }
return %_ValueOf(this); return s;
} }
......
...@@ -737,14 +737,6 @@ ...@@ -737,14 +737,6 @@
'built-ins/RegExp/prototype/source/name': [FAIL], 'built-ins/RegExp/prototype/source/name': [FAIL],
'built-ins/RegExp/prototype/sticky/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 # https://code.google.com/p/v8/issues/detail?id=4360
'intl402/Collator/10.1.1_1': [FAIL], 'intl402/Collator/10.1.1_1': [FAIL],
'intl402/DateTimeFormat/12.1.1_1': [FAIL], 'intl402/DateTimeFormat/12.1.1_1': [FAIL],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment