Index: src/contexts.cc |
diff --git a/src/contexts.cc b/src/contexts.cc |
index 54cbb3e2bb4e1150e90eee4c6d62af1796fbaf32..3da6191a77c98c70f6c872d02027e7f9828aa2b2 100644 |
--- a/src/contexts.cc |
+++ b/src/contexts.cc |
@@ -55,7 +55,8 @@ bool ScriptContextTable::Lookup(Handle<ScriptContextTable> table, |
Context* Context::declaration_context() { |
Context* current = this; |
- while (!current->IsFunctionContext() && !current->IsNativeContext()) { |
+ while (!current->IsFunctionContext() && !current->IsNativeContext() && |
+ !current->IsScriptContext()) { |
current = current->previous(); |
DCHECK(current->closure() == closure()); |
} |