Index: src/builtins/builtins-global.cc |
diff --git a/src/builtins/builtins-global.cc b/src/builtins/builtins-global.cc |
index 2d91371ced1b92537dceda426101778c73be2238..d99a553d1e8a9661e1ed35e6fa142eef968a9a55 100644 |
--- a/src/builtins/builtins-global.cc |
+++ b/src/builtins/builtins-global.cc |
@@ -85,6 +85,10 @@ BUILTIN(GlobalEval) { |
Handle<JSFunction> target = args.target<JSFunction>(); |
Handle<JSObject> target_global_proxy(target->global_proxy(), isolate); |
if (!x->IsString()) return *x; |
+ if (!Builtins::AllowDynamicFunction(isolate, target, target_global_proxy)) { |
+ isolate->CountUsage(v8::Isolate::kFunctionConstructorReturnedUndefined); |
+ return isolate->heap()->undefined_value(); |
+ } |
Handle<JSFunction> function; |
ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
isolate, function, Compiler::GetFunctionFromString( |