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

Unified Diff: src/full-codegen.cc

Issue 7992005: Block scoped const variables. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Created 9 years, 2 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/contexts.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | src/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 083675d133cbfb639359bbd07b1d0b6625a133a1..69e225c1e9cae068f3ddc1ba14f03d1541b86f3e 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -520,8 +520,8 @@ void FullCodeGenerator::VisitDeclarations(
if (var->IsUnallocated()) {
array->set(j++, *(var->name()));
if (decl->fun() == NULL) {
- if (var->mode() == CONST) {
- // In case this is const property use the hole.
+ if (var->binding_needs_init()) {
+ // In case this binding needs initialization use the hole.
array->set_the_hole(j++);
} else {
array->set_undefined(j++);
« no previous file with comments | « src/contexts.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698