Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(598)

Unified Diff: src/parsing/parser.cc

Issue 2410413003: Decide ParseLazy vs ParseProgram based on is_toplevel (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698