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

Unified Diff: src/json.js

Issue 1323543002: [runtime] Replace %to_string_fun with %_ToString. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@ToStringStub
Patch Set: REBASE. Fixes 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
« no previous file with comments | « src/i18n.js ('k') | src/macros.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json.js
diff --git a/src/json.js b/src/json.js
index a0a88a04c1abf86b8fcea1ec23958c9da43f79d2..8fe30efafc64c9e348267d95c8cfac14aa52027d 100644
--- a/src/json.js
+++ b/src/json.js
@@ -17,7 +17,6 @@ var MathMax;
var MathMin;
var ObjectHasOwnProperty;
var ToNumber;
-var ToString;
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
@@ -25,7 +24,6 @@ utils.Import(function(from) {
MathMin = from.MathMin;
ObjectHasOwnProperty = from.ObjectHasOwnProperty;
ToNumber = from.ToNumber;
- ToString = from.ToString;
});
// -------------------------------------------------------------------
@@ -57,7 +55,7 @@ function Revive(holder, name, reviver) {
function JSONParse(text, reviver) {
- var unfiltered = %ParseJson(TO_STRING_INLINE(text));
+ var unfiltered = %ParseJson(text);
if (IS_CALLABLE(reviver)) {
return Revive({'': unfiltered}, '', reviver);
} else {
@@ -161,7 +159,7 @@ function JSONSerialize(key, holder, replacer, stack, indent, gap) {
return value ? "true" : "false";
} else if (IS_NULL(value)) {
return "null";
- } else if (IS_SPEC_OBJECT(value) && !(typeof value == "function")) {
+ } else if (IS_SPEC_OBJECT(value) && !IS_CALLABLE(value)) {
// Non-callable object. If it's a primitive wrapper, it must be unwrapped.
if (IS_ARRAY(value)) {
return SerializeArray(value, replacer, stack, indent, gap);
@@ -169,7 +167,7 @@ function JSONSerialize(key, holder, replacer, stack, indent, gap) {
value = ToNumber(value);
return JSON_NUMBER_TO_STRING(value);
} else if (IS_STRING_WRAPPER(value)) {
- return %QuoteJSONString(ToString(value));
+ return %QuoteJSONString(TO_STRING(value));
} else if (IS_BOOLEAN_WRAPPER(value)) {
return %_ValueOf(value) ? "true" : "false";
} else {
@@ -198,7 +196,7 @@ function JSONStringify(value, replacer, space) {
} else if (IS_NUMBER(v)) {
item = %_NumberToString(v);
} else if (IS_STRING_WRAPPER(v) || IS_NUMBER_WRAPPER(v)) {
- item = ToString(v);
+ item = TO_STRING(v);
} else {
continue;
}
@@ -214,7 +212,7 @@ function JSONStringify(value, replacer, space) {
if (IS_NUMBER_WRAPPER(space)) {
space = ToNumber(space);
} else if (IS_STRING_WRAPPER(space)) {
- space = ToString(space);
+ space = TO_STRING(space);
}
}
var gap;
« no previous file with comments | « src/i18n.js ('k') | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698