Index: src/scopeinfo.cc |
diff --git a/src/scopeinfo.cc b/src/scopeinfo.cc |
index 25f02f6320d336e117d3e76cf2ab2d9c1337d6b2..02b4323980f30218e51059a5ebc287fd64c72b09 100644 |
--- a/src/scopeinfo.cc |
+++ b/src/scopeinfo.cc |
@@ -193,7 +193,8 @@ int ScopeInfo::ContextLength() { |
bool has_context = context_locals > 0 || |
function_name_context_slot || |
Type() == WITH_SCOPE || |
- (Type() == FUNCTION_SCOPE && CallsEval()); |
+ (Type() == FUNCTION_SCOPE && CallsEval()) || |
+ Type() == MODULE_SCOPE; |
if (has_context) { |
return Context::MIN_CONTEXT_SLOTS + context_locals + |
(function_name_context_slot ? 1 : 0); |
@@ -222,11 +223,7 @@ bool ScopeInfo::HasHeapAllocatedLocals() { |
bool ScopeInfo::HasContext() { |
- if (length() > 0) { |
- return ContextLength() > 0; |
- } else { |
- return false; |
- } |
+ return ContextLength() > 0; |
} |