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

Unified Diff: src/json.js

Issue 1316933002: [es6] Initial steps towards a correct implementation of IsCallable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase again. 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/ia32/lithium-codegen-ia32.cc ('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 7ada63eb5c531ebfda9d5d4905fea09a8a0e6f34..5ddf869ae0a9a15b3d9e19caf7437e84261649a3 100644
--- a/src/json.js
+++ b/src/json.js
@@ -58,7 +58,7 @@ function Revive(holder, name, reviver) {
function JSONParse(text, reviver) {
var unfiltered = %ParseJson(TO_STRING_INLINE(text));
- if (IS_SPEC_FUNCTION(reviver)) {
+ if (IS_CALLABLE(reviver)) {
return Revive({'': unfiltered}, '', reviver);
} else {
return unfiltered;
@@ -146,11 +146,11 @@ function JSONSerialize(key, holder, replacer, stack, indent, gap) {
var value = holder[key];
if (IS_SPEC_OBJECT(value)) {
var toJSON = value.toJSON;
- if (IS_SPEC_FUNCTION(toJSON)) {
+ if (IS_CALLABLE(toJSON)) {
value = %_CallFunction(value, key, toJSON);
}
}
- if (IS_SPEC_FUNCTION(replacer)) {
+ if (IS_CALLABLE(replacer)) {
value = %_CallFunction(holder, key, value, replacer);
}
if (IS_STRING(value)) {
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698