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

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: ia32, arm and arm64 ports. Misc cleanups. Created 5 years, 4 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 8d046ee95536d1c47164afd10bf2871094454589..b66e18367e9bf2c390801ca4e19ae18c8ef9d5f3 100644
--- a/src/json.js
+++ b/src/json.js
@@ -57,7 +57,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;
@@ -145,11 +145,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)) {

Powered by Google App Engine
This is Rietveld 408576698