Add assertion about module scopes to Scope::ContextChainLength.

R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/14513002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14459 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1706fe65
......@@ -727,8 +727,9 @@ int Scope::ContextChainLength(Scope* scope) {
for (Scope* s = this; s != scope; s = s->outer_scope_) {
ASSERT(s != NULL); // scope must be in the scope chain
if (s->is_with_scope() || s->num_heap_slots() > 0) n++;
// Catch scopes always have heap slots.
// Catch and module scopes always have heap slots.
ASSERT(!s->is_catch_scope() || s->num_heap_slots() > 0);
ASSERT(!s->is_module_scope() || s->num_heap_slots() > 0);
}
return n;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment