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

Unified Diff: src/scopeinfo.cc

Issue 758603004: Do not reflect uninitialized 'let' and 'const' in scope mirrors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 | « no previous file | test/mjsunit/harmony/debug-blockscopes.js » ('j') | test/mjsunit/harmony/debug-blockscopes.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopeinfo.cc
diff --git a/src/scopeinfo.cc b/src/scopeinfo.cc
index 598c5e669bcfc3073182ba46fa1de0062cbae8f5..b9cb6f3ba5e2ace1eaad5cfc4378011c8ae27385 100644
--- a/src/scopeinfo.cc
+++ b/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;
« no previous file with comments | « no previous file | test/mjsunit/harmony/debug-blockscopes.js » ('j') | test/mjsunit/harmony/debug-blockscopes.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698