summaryrefslogtreecommitdiff
path: root/deps/v8/src/scopeinfo.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/scopeinfo.cc')
-rw-r--r--deps/v8/src/scopeinfo.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/deps/v8/src/scopeinfo.cc b/deps/v8/src/scopeinfo.cc
index 598c5e669b..b9cb6f3ba5 100644
--- a/deps/v8/src/scopeinfo.cc
+++ b/deps/v8/src/scopeinfo.cc
@@ -380,13 +380,14 @@ bool ScopeInfo::CopyContextLocalsToScopeObject(Handle<ScopeInfo> scope_info,
for (int i = 0; i < local_count; ++i) {
if (scope_info->LocalIsSynthetic(first_context_var + i)) continue;
int context_index = Context::MIN_CONTEXT_SLOTS + i;
+ Handle<Object> value = Handle<Object>(context->get(context_index), isolate);
+ // Do not reflect variables under TDZ in scope object.
+ if (value->IsTheHole()) continue;
RETURN_ON_EXCEPTION_VALUE(
- isolate,
- Runtime::DefineObjectProperty(
- scope_object,
- Handle<String>(String::cast(scope_info->get(i + start))),
- Handle<Object>(context->get(context_index), isolate),
- ::NONE),
+ isolate, Runtime::DefineObjectProperty(
+ scope_object,
+ Handle<String>(String::cast(scope_info->get(i + start))),
+ value, ::NONE),
false);
}
return true;