Index: src/ast/ast.cc |
diff --git a/src/ast/ast.cc b/src/ast/ast.cc |
index 7fa115524d1a852f8eb70b71fc631d4711971270..698d46a1aa4738cbf10f36cb46a14d7d854db3c7 100644 |
--- a/src/ast/ast.cc |
+++ b/src/ast/ast.cc |
@@ -901,7 +901,9 @@ Call::CallType Call::GetCallType() const { |
} else if (proxy->var()->IsUnallocated()) { |
return GLOBAL_CALL; |
} else if (proxy->var()->IsLookupSlot()) { |
- return LOOKUP_SLOT_CALL; |
+ // Calls going through 'with' always use DYNAMIC rather than DYNAMIC_LOCAL |
+ // or DYNAMIC_GLOBAL. |
+ return proxy->var()->mode() == DYNAMIC ? WITH_CALL : OTHER_CALL; |
} |
} |