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

Unified Diff: src/json-stringifier.h

Issue 1824533002: [json] Allow any callable object for toJSON. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | test/mjsunit/regress/regress-crbug-595738.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-stringifier.h
diff --git a/src/json-stringifier.h b/src/json-stringifier.h
index 44e710375d43879a7f1b4dc10edc4d510343f532..b40a78249ff2f3a192d5c27aa8312e1d4f74bd82 100644
--- a/src/json-stringifier.h
+++ b/src/json-stringifier.h
@@ -245,7 +245,7 @@ MaybeHandle<Object> BasicJsonStringifier::ApplyToJsonFunction(
LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
Handle<Object> fun;
ASSIGN_RETURN_ON_EXCEPTION(isolate_, fun, Object::GetProperty(&it), Object);
- if (!fun->IsJSFunction()) return object;
+ if (!fun->IsCallable()) return object;
// Call toJSON function.
if (key->IsSmi()) key = factory()->NumberToString(key);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-595738.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698