Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 0155e2c69b40ff42788647d22754334694bf10f6..aed7a12b734c5fda9456b4c4570610cd19c420dd 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -3824,11 +3824,11 @@ bool Parser::Parse(ParseInfo* info) { |
Isolate* isolate = info->isolate(); |
pre_parse_timer_ = isolate->counters()->pre_parse(); |
- if (!info->shared_info().is_null() && info->shared_info()->is_function()) { |
- result = ParseLazy(isolate, info); |
- } else { |
+ if (info->is_toplevel()) { |
SetCachedData(info); |
result = ParseProgram(isolate, info); |
+ } else { |
+ result = ParseLazy(isolate, info); |
} |
info->set_literal(result); |