From e839129b6020795483d1f9ba0b3bcfde9f881bab Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 8 Aug 2018 17:49:59 +0200 Subject: Fix support for default exports in modules Default export declarations require a binding setup step at run-time, so we hook it into the ESModule's statement list to make it visible to the code gen visitor. We also reserve local slot zero for the default export. Change-Id: Ie064caad0422b92cfdadbd7d94db72a05e95c0cc Reviewed-by: Lars Knoll --- src/qml/parser/qqmljsast_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/qml/parser/qqmljsast_p.h') diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h index 0729c99931..9d82e9546b 100644 --- a/src/qml/parser/qqmljsast_p.h +++ b/src/qml/parser/qqmljsast_p.h @@ -2675,7 +2675,7 @@ public: ExportsList *exportsList = nullptr; }; -class QML_PARSER_EXPORT ExportDeclaration: public Node +class QML_PARSER_EXPORT ExportDeclaration: public Statement { public: QQMLJS_DECLARE_AST_NODE(ExportDeclaration) @@ -2753,7 +2753,7 @@ public: return head; } - StatementList *buildStatementList() const; + StatementList *buildStatementList(MemoryPool *pool) const; void accept0(Visitor *visitor) override; @@ -2773,12 +2773,12 @@ class QML_PARSER_EXPORT ESModule: public Node public: QQMLJS_DECLARE_AST_NODE(Module) - ESModule(ModuleItemList *body) + ESModule(ModuleItemList *body, MemoryPool *pool) : body(body) { kind = K; if (body) - statements = body->buildStatementList(); + statements = body->buildStatementList(pool); } void accept0(Visitor *visitor) override; -- cgit v1.2.3