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

Unified Diff: src/parsing/func-name-inferrer.cc

Issue 2512413002: Merged: Fix function name inference corruption for async functions (Closed)
Patch Set: Created 4 years, 1 month 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 | test/mjsunit/regress/regress-cr-658267.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/func-name-inferrer.cc
diff --git a/src/parsing/func-name-inferrer.cc b/src/parsing/func-name-inferrer.cc
index 0821be0a68a623012df807fb948990a1b38ca5d9..a86e1c299fe28b2afd59b73a00cf661f8a1dd54e 100644
--- a/src/parsing/func-name-inferrer.cc
+++ b/src/parsing/func-name-inferrer.cc
@@ -45,9 +45,11 @@ void FuncNameInferrer::PushVariableName(const AstRawString* name) {
}
void FuncNameInferrer::RemoveAsyncKeywordFromEnd() {
- DCHECK(names_stack_.length() > 0);
- DCHECK(names_stack_.last().name->IsOneByteEqualTo("async"));
- names_stack_.RemoveLast();
+ if (IsOpen()) {
+ DCHECK(names_stack_.length() > 0);
+ DCHECK(names_stack_.last().name->IsOneByteEqualTo("async"));
+ names_stack_.RemoveLast();
+ }
}
const AstString* FuncNameInferrer::MakeNameFromStack() {
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-cr-658267.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698