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

Unified Diff: src/builtins/builtins.cc

Issue 2350933007: Make sure to use the correct context for eval checks (Closed)
Patch Set: updates Created 4 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/api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins.cc
diff --git a/src/builtins/builtins.cc b/src/builtins/builtins.cc
index dd5b4333ce981db1cb13ae8dc6b59e7c259caa06..d5a0e17d17312dce817b53534a935a860806f5d9 100644
--- a/src/builtins/builtins.cc
+++ b/src/builtins/builtins.cc
@@ -280,13 +280,12 @@ bool Builtins::AllowDynamicFunction(Isolate* isolate, Handle<JSFunction> target,
Handle<JSObject> target_global_proxy) {
if (FLAG_allow_unsafe_function_constructor) return true;
HandleScopeImplementer* impl = isolate->handle_scope_implementer();
- Handle<Context> responsible_context = impl->LastEnteredContext();
+ Handle<Context> responsible_context =
+ impl->MicrotaskContextIsLastEnteredContext() ? impl->MicrotaskContext()
+ : impl->LastEnteredContext();
+ // TODO(jochen): Remove this.
if (responsible_context.is_null()) {
- responsible_context = impl->MicrotaskContext();
- // TODO(jochen): Remove this.
- if (responsible_context.is_null()) {
- return true;
- }
+ return true;
}
if (*responsible_context == target->context()) return true;
return isolate->MayAccess(responsible_context, target_global_proxy);
« no previous file with comments | « src/api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698