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

Unified Diff: src/json.js

Issue 1384443002: [es6] Fix missing bits for full @@toPrimitive support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove useless cctest. Created 5 years, 3 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
Index: src/json.js
diff --git a/src/json.js b/src/json.js
index 6f8489088b5191a2cef1312a10f48121028b6ef7..8ec30ff6ea941abaabd6512239eccb4992f27fad 100644
--- a/src/json.js
+++ b/src/json.js
@@ -16,14 +16,12 @@ var InternalArray = utils.InternalArray;
var MathMax;
var MathMin;
var ObjectHasOwnProperty;
-var ToNumber;
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
MathMax = from.MathMax;
MathMin = from.MathMin;
ObjectHasOwnProperty = from.ObjectHasOwnProperty;
- ToNumber = from.ToNumber;
});
// -------------------------------------------------------------------
@@ -164,7 +162,7 @@ function JSONSerialize(key, holder, replacer, stack, indent, gap) {
if (IS_ARRAY(value)) {
return SerializeArray(value, replacer, stack, indent, gap);
} else if (IS_NUMBER_WRAPPER(value)) {
- value = ToNumber(value);
+ value = TO_NUMBER(value);
return JSON_NUMBER_TO_STRING(value);
} else if (IS_STRING_WRAPPER(value)) {
return %QuoteJSONString(TO_STRING(value));
@@ -210,7 +208,7 @@ function JSONStringify(value, replacer, space) {
if (IS_OBJECT(space)) {
// Unwrap 'space' if it is wrapped
if (IS_NUMBER_WRAPPER(space)) {
- space = ToNumber(space);
+ space = TO_NUMBER(space);
} else if (IS_STRING_WRAPPER(space)) {
space = TO_STRING(space);
}
« no previous file with comments | « src/i18n.js ('k') | src/macros.py » ('j') | test/cctest/compiler/test-run-jscalls.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698