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

Unified Diff: src/parsing/preparser.cc

Issue 2424013002: Add support to trace preparsing decisions (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 | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index 300c88964b35e3a305afde27be20e9748e2de8e6..3a6bfbf3b1f84e7c086d56ac16eb214832307afb 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -177,11 +177,19 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
is_sloppy(language_mode) && formals.is_simple && !IsConciseMethod(kind);
ValidateFormalParameters(language_mode, allow_duplicate_parameters, CHECK_OK);
+ int end_position = scanner()->location().end_pos;
if (is_strict(language_mode)) {
- int end_position = scanner()->location().end_pos;
CheckStrictOctalLiteral(start_position, end_position, CHECK_OK);
CheckDecimalLiteralWithLeadingZero(start_position, end_position);
}
+ function_scope->set_end_position(end_position);
+
+ if (FLAG_trace_preparse) {
+ PrintF(" [%s]: %i-%i\n",
+ track_unresolved_variables_ ? "Preparse resolution"
+ : "Preparse no-resolution",
+ function_scope->start_position(), function_scope->end_position());
+ }
return Expression::Default();
}
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698