From cb2e54d1fffbb9cc640a7ab14e8b4e17ae1a8712 Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Fri, 26 Apr 2013 13:22:11 +0000 Subject: [PATCH] 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 --- src/scopes.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scopes.cc b/src/scopes.cc index 5ad970a..208dc76 100644 --- a/src/scopes.cc +++ b/src/scopes.cc @@ -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; } -- 2.7.4