Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index 1ea1b5ad7f4dbcc0cf0bd445a8adcd595e92dfcb..5855d376fb5834c52a86519de5bf2ca28dc8cb77 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -8711,8 +8711,23 @@ class ScopeTestHelper { |
} |
CHECK_EQ(data->backing_store_[index++], inner_scope_count); |
- // Variable count is 0. TODO(marja): implement. |
- CHECK_EQ(data->backing_store_[index++], 0); |
+ int variable_count = 0; |
+ for (Variable* local : scope->locals_) { |
+ if (local->mode() == VAR || local->mode() == LET || |
+ local->mode() == CONST) { |
+ ++variable_count; |
+ } |
+ } |
+ |
+ CHECK_EQ(data->backing_store_[index++], variable_count); |
vogelheim
2017/01/26 09:34:35
Why does this work? The way I read Scope::CollectV
marja
2017/01/26 09:40:59
Offline discussion: the scope contains only the va
|
+ |
+ for (Variable* local : scope->locals_) { |
+ if (local->mode() == VAR || local->mode() == LET || |
+ local->mode() == CONST) { |
+ CHECK_EQ(data->backing_store_[index++], local->location()); |
+ CHECK_EQ(data->backing_store_[index++], local->maybe_assigned()); |
+ } |
+ } |
for (Scope* inner = scope->inner_scope(); inner != nullptr; |
inner = inner->sibling()) { |
@@ -9022,7 +9037,6 @@ TEST(PreParserScopeAnalysis) { |
{"", "var1"}, |
{"", "if (true) {}"}, |
{"", "function f1() {}"}, |
- {"", "if (true) { function f1() {} }"}, |
}; |
for (unsigned i = 0; i < arraysize(inners); ++i) { |
@@ -9076,6 +9090,7 @@ TEST(PreParserScopeAnalysis) { |
script = factory->NewScript(source); |
i::ParseInfo eager_info(&zone, script); |
+ eager_info.set_allow_lazy_parsing(false); |
CHECK(i::parsing::ParseProgram(&eager_info)); |
CHECK(i::Compiler::Analyze(&eager_info)); |