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

Unified Diff: src/objects-inl.h

Issue 2693203003: Make CreationContext() not crash when there is no creation context. (Closed)
Patch Set: Rebase on top of other patch instead. Created 3 years, 10 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/objects.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 0a785e613daa604b61106d28791913190e78dfba..065aa6e30ff23cd13ab082d167fccb2804262de6 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -6489,6 +6489,9 @@ Context* JSFunction::context() {
return Context::cast(READ_FIELD(this, kContextOffset));
}
+bool JSFunction::has_context() const {
+ return READ_FIELD(this, kContextOffset)->IsContext();
+}
JSObject* JSFunction::global_proxy() {
return context()->global_proxy();
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698