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

Unified Diff: src/parsing/parser.h

Issue 1542813003: [debugger] step on every assignment in destructuring bind. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix: only emit statement positions for subpatterns Created 5 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 | « no previous file | src/parsing/pattern-rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index e3b7e70ae71f379bc8063061fdefdfc434a04861..ae0c7499663bda4d5d81e0035a43281bdf627047 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -1077,7 +1077,9 @@ class Parser : public ParserBase<ParserTraits> {
void RecurseIntoSubpattern(AstNode* pattern, Expression* value) {
Expression* old_value = current_value_;
current_value_ = value;
+ recursion_level_++;
pattern->Accept(this);
+ recursion_level_--;
current_value_ = old_value;
}
@@ -1089,6 +1091,7 @@ class Parser : public ParserBase<ParserTraits> {
bool IsAssignmentContext() const { return IsAssignmentContext(context_); }
bool IsAssignmentContext(PatternContext c) const;
bool IsBindingContext(PatternContext c) const;
+ bool IsSubPattern() const { return recursion_level_ > 1; }
PatternContext SetAssignmentContextIfNeeded(Expression* node);
PatternContext SetInitializerContextIfNeeded(Expression* node);
@@ -1110,6 +1113,7 @@ class Parser : public ParserBase<ParserTraits> {
const DeclarationDescriptor* descriptor_;
ZoneList<const AstRawString*>* names_;
Expression* current_value_;
+ int recursion_level_;
bool* ok_;
};
« no previous file with comments | « no previous file | src/parsing/pattern-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698