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

Unified Diff: src/ast/ast-expression-visitor.h

Issue 1864553002: [destructuring] don't attempt to visit contents of FunctionLiterals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/ast/ast-expression-visitor.cc » ('j') | src/parsing/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast-expression-visitor.h
diff --git a/src/ast/ast-expression-visitor.h b/src/ast/ast-expression-visitor.h
index 545a45c41696a8745d64b59897b149e23389f18e..0413a99cfbd2c4d7e769ee616b414a4697b34134 100644
--- a/src/ast/ast-expression-visitor.h
+++ b/src/ast/ast-expression-visitor.h
@@ -19,10 +19,20 @@ namespace internal {
class AstExpressionVisitor : public AstVisitor {
public:
- AstExpressionVisitor(Isolate* isolate, Expression* root);
- AstExpressionVisitor(uintptr_t stack_limit, Expression* root);
+ enum Mode {
+ Normal = 0,
+ // A Shallow AstExpressionVisitor will not visit nested Function bodies
+ Shallow
+ };
+
+ AstExpressionVisitor(Isolate* isolate, Expression* root, Mode mode = Normal);
+ AstExpressionVisitor(uintptr_t stack_limit, Expression* root,
+ Mode mode = Normal);
void Run();
+ Mode mode() const { return mode_; }
+ bool is_shallow() const { return mode_ == Shallow; }
+
protected:
virtual void VisitExpression(Expression* expression) = 0;
int depth() { return depth_; }
@@ -39,6 +49,7 @@ class AstExpressionVisitor : public AstVisitor {
Expression* root_;
int depth_;
+ Mode mode_;
DISALLOW_COPY_AND_ASSIGN(AstExpressionVisitor);
};
« no previous file with comments | « no previous file | src/ast/ast-expression-visitor.cc » ('j') | src/parsing/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698