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

Unified Diff: src/json.js

Issue 1126213002: Wrap runtime.js in a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 7 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 26948fc6ba7b27cf95c2d36bc861b963ba312e4c..f20106ab69b9d8170fd5200ca17767bc7b56257d 100644
--- a/src/json.js
+++ b/src/json.js
@@ -154,10 +154,10 @@ 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 = $toNumber(value);
return JSON_NUMBER_TO_STRING(value);
} else if (IS_STRING_WRAPPER(value)) {
- return %QuoteJSONString(ToString(value));
+ return %QuoteJSONString($toString(value));
} else if (IS_BOOLEAN_WRAPPER(value)) {
return %_ValueOf(value) ? "true" : "false";
} else {
@@ -176,14 +176,14 @@ function JSONStringify(value, replacer, space) {
if (IS_OBJECT(space)) {
// Unwrap 'space' if it is wrapped
if (IS_NUMBER_WRAPPER(space)) {
- space = ToNumber(space);
+ space = $toNumber(space);
} else if (IS_STRING_WRAPPER(space)) {
- space = ToString(space);
+ space = $toString(space);
}
}
var gap;
if (IS_NUMBER(space)) {
- space = $max(0, $min(ToInteger(space), 10));
+ space = $max(0, $min($toInteger(space), 10));
gap = %_SubString(" ", 0, space);
} else if (IS_STRING(space)) {
if (space.length > 10) {
@@ -203,9 +203,9 @@ function JSONStringify(value, replacer, space) {
for (var i = 0; i < length; i++) {
var item = replacer[i];
if (IS_STRING_WRAPPER(item)) {
- item = ToString(item);
+ item = $toString(item);
} else {
- if (IS_NUMBER_WRAPPER(item)) item = ToNumber(item);
+ if (IS_NUMBER_WRAPPER(item)) item = $toNumber(item);
if (IS_NUMBER(item)) item = %_NumberToString(item);
}
if (IS_STRING(item) && seen_properties[item] != seen_sentinel) {
« 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