From 4acabaf52b3a067090237eb79a7012b04d13004c Mon Sep 17 00:00:00 2001 From: Daniil Dubrava Date: Fri, 29 Apr 2022 15:42:54 +0300 Subject: [PATCH 1/3] fix(ast-spec): add ImportExpression to LeftHandSideExpression type fixes #4877 --- packages/ast-spec/src/unions/LeftHandSideExpression.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/ast-spec/src/unions/LeftHandSideExpression.ts b/packages/ast-spec/src/unions/LeftHandSideExpression.ts index fc3a80b23618..8a8720ae5c10 100644 --- a/packages/ast-spec/src/unions/LeftHandSideExpression.ts +++ b/packages/ast-spec/src/unions/LeftHandSideExpression.ts @@ -9,7 +9,7 @@ import type { JSXFragment } from '../expression/JSXFragment/spec'; import type { MemberExpression } from '../expression/MemberExpression/spec'; import type { MetaProperty } from '../expression/MetaProperty/spec'; import type { ObjectExpression } from '../expression/ObjectExpression/spec'; -import type { SequenceExpression } from '../expression/spec'; +import type { ImportExpression, SequenceExpression } from '../expression/spec'; import type { Super } from '../expression/Super/spec'; import type { TaggedTemplateExpression } from '../expression/TaggedTemplateExpression/spec'; import type { ThisExpression } from '../expression/ThisExpression/spec'; @@ -28,6 +28,7 @@ export type LeftHandSideExpression = | ClassExpression | FunctionExpression | Identifier + | ImportExpression | JSXElement | JSXFragment | LiteralExpression From ff6cc55324be2cffb86efcbdc05037aae87bb930 Mon Sep 17 00:00:00 2001 From: Daniil Dubrava Date: Fri, 29 Apr 2022 23:51:44 +0300 Subject: [PATCH 2/3] Revert "fix(ast-spec): add ImportExpression to LeftHandSideExpression type" This reverts commit 4acabaf52b3a067090237eb79a7012b04d13004c. --- packages/ast-spec/src/unions/LeftHandSideExpression.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/ast-spec/src/unions/LeftHandSideExpression.ts b/packages/ast-spec/src/unions/LeftHandSideExpression.ts index 8a8720ae5c10..fc3a80b23618 100644 --- a/packages/ast-spec/src/unions/LeftHandSideExpression.ts +++ b/packages/ast-spec/src/unions/LeftHandSideExpression.ts @@ -9,7 +9,7 @@ import type { JSXFragment } from '../expression/JSXFragment/spec'; import type { MemberExpression } from '../expression/MemberExpression/spec'; import type { MetaProperty } from '../expression/MetaProperty/spec'; import type { ObjectExpression } from '../expression/ObjectExpression/spec'; -import type { ImportExpression, SequenceExpression } from '../expression/spec'; +import type { SequenceExpression } from '../expression/spec'; import type { Super } from '../expression/Super/spec'; import type { TaggedTemplateExpression } from '../expression/TaggedTemplateExpression/spec'; import type { ThisExpression } from '../expression/ThisExpression/spec'; @@ -28,7 +28,6 @@ export type LeftHandSideExpression = | ClassExpression | FunctionExpression | Identifier - | ImportExpression | JSXElement | JSXFragment | LiteralExpression From d66baabdfebacd3534270d6a6c7fa0012f71ccef Mon Sep 17 00:00:00 2001 From: Daniil Dubrava Date: Fri, 29 Apr 2022 23:51:52 +0300 Subject: [PATCH 3/3] fix(ast-spec): replace AwaitExpression argument with Expression instead of a union fixes #4877 --- .../ast-spec/src/expression/AwaitExpression/spec.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/ast-spec/src/expression/AwaitExpression/spec.ts b/packages/ast-spec/src/expression/AwaitExpression/spec.ts index 0017ff6b868f..c476c916a335 100644 --- a/packages/ast-spec/src/expression/AwaitExpression/spec.ts +++ b/packages/ast-spec/src/expression/AwaitExpression/spec.ts @@ -1,14 +1,8 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; -import type { LeftHandSideExpression } from '../../unions/LeftHandSideExpression'; -import type { UnaryExpression } from '../UnaryExpression/spec'; -import type { UpdateExpression } from '../UpdateExpression/spec'; +import type { Expression } from '../../unions/Expression'; export interface AwaitExpression extends BaseNode { type: AST_NODE_TYPES.AwaitExpression; - argument: - | AwaitExpression - | LeftHandSideExpression - | UnaryExpression - | UpdateExpression; + argument: Expression; }