Index: src/debug/debug-evaluate.cc |
diff --git a/src/debug/debug-evaluate.cc b/src/debug/debug-evaluate.cc |
index e93b5952c876ad2ffc7ae80579cf7ed08520efbb..3dd02b029d20887e21561dc3341f7d7a040624bd 100644 |
--- a/src/debug/debug-evaluate.cc |
+++ b/src/debug/debug-evaluate.cc |
@@ -219,7 +219,7 @@ void DebugEvaluate::ContextBuilder::MaterializeArgumentsObject( |
Handle<JSObject> target, Handle<JSFunction> function) { |
// Do not materialize the arguments object for eval or top-level code. |
// Skip if "arguments" is already taken. |
- if (!function->shared()->is_function()) return; |
+ if (function->shared()->is_toplevel()) return; |
Maybe<bool> maybe = JSReceiver::HasOwnProperty( |
target, isolate_->factory()->arguments_string()); |
DCHECK(maybe.IsJust()); |