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

Unified Diff: src/parsing/parser.cc

Issue 2533303006: Introduce a separate FunctionLiteral ID for Eval (Closed)
Patch Set: Created 4 years 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/ast/ast.h ('k') | 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 3e0637b70185d9a7d4328ef9f07447f619629c4b..e1e117549fb673c4944d52090a683a011f981ef8 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -747,6 +747,7 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
ParsingModeScope mode(this, allow_lazy_ ? PARSE_LAZILY : PARSE_EAGERLY);
ResetFunctionLiteralId();
DCHECK(info->function_literal_id() == FunctionLiteral::kIdTypeTopLevel ||
+ info->function_literal_id() == FunctionLiteral::kIdTypeEval ||
info->function_literal_id() == FunctionLiteral::kIdTypeInvalid);
FunctionLiteral* result = NULL;
@@ -834,7 +835,9 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
int parameter_count = parsing_module_ ? 1 : 0;
result = factory()->NewScriptOrEvalFunctionLiteral(
scope, body, function_state.materialized_literal_count(),
- function_state.expected_property_count(), parameter_count);
+ function_state.expected_property_count(), parameter_count,
+ info->is_eval() ? FunctionLiteral::kIdTypeEval
+ : FunctionLiteral::kIdTypeTopLevel);
}
}
« no previous file with comments | « src/ast/ast.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698