| Index: src/contexts.cc
|
| diff --git a/src/contexts.cc b/src/contexts.cc
|
| index cb5e852d7d669c07c8d8b950016defff1572f49c..8eee85fdec15a72b4706aac52e2d8c265c46de4f 100644
|
| --- a/src/contexts.cc
|
| +++ b/src/contexts.cc
|
| @@ -13,7 +13,10 @@ namespace internal {
|
|
|
| Context* Context::declaration_context() {
|
| Context* current = this;
|
| - while (!current->IsFunctionContext() && !current->IsNativeContext()) {
|
| + while (!current->IsFunctionContext() &&
|
| + !(current->IsGlobalContext() &&
|
| + current->previous()->IsNativeContext()) &&
|
| + !current->IsNativeContext()) {
|
| current = current->previous();
|
| ASSERT(current->closure() == closure());
|
| }
|
|
|