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

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

Issue 2235423003: [parser] improve inferred function names for async arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 | src/parsing/parser-base.h » ('j') | src/parsing/parser-base.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/func-name-inferrer.h
diff --git a/src/parsing/func-name-inferrer.h b/src/parsing/func-name-inferrer.h
index ba38ffeb241c348ab8e285a842b08e5f12590615..97fee30cdb2b15e4f11ba4a50789cdbee513019b 100644
--- a/src/parsing/func-name-inferrer.h
+++ b/src/parsing/func-name-inferrer.h
@@ -71,6 +71,19 @@ class FuncNameInferrer : public ZoneObject {
}
}
+ int LastNameIndex() const { return this->names_stack_.length() - 1; }
+
+ void RemoveNameAtIndex(int index) {
+ DCHECK(index >= 0);
+ DCHECK(index < names_stack_.length());
+ names_stack_.Remove(index);
+ }
+
+ void RemoveLastName() {
+ DCHECK(names_stack_.length() > 0);
+ RemoveNameAtIndex(names_stack_.length() - 1);
+ }
+
// Infers a function name and leaves names collection state.
void Infer() {
DCHECK(IsOpen());
« no previous file with comments | « no previous file | src/parsing/parser-base.h » ('j') | src/parsing/parser-base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698