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

Unified Diff: src/ast/ast.h

Issue 2703563002: [ESNext] Implement DynamicImportCall (Closed)
Patch Set: rebase Created 3 years, 9 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
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 2d9833aee1eb2b8f7aa3b8e3de1acf2fb2967720..b3eb9abafd93e08b417767ca9c78bfea7cf98cf1 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -105,7 +105,8 @@ namespace internal {
V(EmptyParentheses) \
V(GetIterator) \
V(DoExpression) \
- V(RewritableExpression)
+ V(RewritableExpression) \
+ V(ImportCallExpression)
#define AST_NODE_LIST(V) \
DECLARATION_NODE_LIST(V) \
@@ -2931,6 +2932,21 @@ class SuperCallReference final : public Expression {
VariableProxy* this_function_var_;
};
+// This AST Node is used to represent a dynamic import call --
+// import(argument).
+class ImportCallExpression final : public Expression {
+ public:
+ Expression* argument() const { return argument_; }
+ void set_argument(Expression* argument) { argument_ = argument; }
+
+ private:
+ friend class AstNodeFactory;
+
+ ImportCallExpression(Expression* argument, int pos)
+ : Expression(pos, kImportCallExpression), argument_(argument) {}
+
+ Expression* argument_;
+};
// This class is produced when parsing the () in arrow functions without any
// arguments and is not actually a valid expression.
@@ -3579,6 +3595,10 @@ class AstNodeFactory final BASE_EMBEDDED {
return new (zone_) GetIterator(iterable, hint, pos);
}
+ ImportCallExpression* NewImportCallExpression(Expression* args, int pos) {
+ return new (zone_) ImportCallExpression(args, pos);
+ }
+
Zone* zone() const { return zone_; }
void set_zone(Zone* zone) { zone_ = zone; }

Powered by Google App Engine
This is Rietveld 408576698