Chromium Code Reviews

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: Removed redundant code. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 0eb36f4e66a5f0d750671ccb362c168e4dd3dece..524f16252c802ab5a939d1110357f3327cf412c6 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -521,8 +521,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++);

Powered by Google App Engine