Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index 753391193bf03667a685a24161b83e53ca3ecbda..ce1dd24ad767f516818ea98ae7acb790132a4fa2 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -1140,6 +1140,13 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info, |
DCHECK(target_stack_ == NULL); |
Handle<String> name(String::cast(shared_info->name())); |
+ |
+ // If we're lazy-compiling 'eval' itself, blank out its name to avoid |
+ // spurious "Unexpected eval in strict mode" errors. |
+ if (info->is_native() && *name == isolate->heap()->eval_string()) { |
+ name = isolate->factory()->empty_string(); |
arv (Not doing code reviews)
2015/07/09 19:00:59
Would it be possible to skip the name check instea
adamk
2015/07/09 19:09:00
Hmm, I see we already have a bool flag we pass to
|
+ } |
+ |
DCHECK(ast_value_factory()); |
fni_ = new (zone()) FuncNameInferrer(ast_value_factory(), zone()); |
const AstRawString* raw_name = ast_value_factory()->GetString(name); |