@@ -33,8 +33,6 @@ import MemberExpression from './MemberExpression';
33
33
import type * as NodeType from './NodeType' ;
34
34
import ObjectPattern from './ObjectPattern' ;
35
35
import { Flag , isFlagSet , setFlag } from './shared/BitFlags' ;
36
- import FunctionNode from './shared/FunctionNode' ;
37
- import type { Node } from './shared/Node' ;
38
36
import {
39
37
doNotDeoptimize ,
40
38
type ExpressionNode ,
@@ -76,14 +74,6 @@ export default class ImportExpression extends NodeBase {
76
74
this . flags = setFlag ( this . flags , Flag . shouldIncludeDynamicAttributes , value ) ;
77
75
}
78
76
79
- get withinTopLevelAwait ( ) {
80
- return isFlagSet ( this . flags , Flag . withinTopLevelAwait ) ;
81
- }
82
-
83
- set withinTopLevelAwait ( value : boolean ) {
84
- this . flags = setFlag ( this . flags , Flag . withinTopLevelAwait , value ) ;
85
- }
86
-
87
77
bind ( ) : void {
88
78
this . source . bind ( ) ;
89
79
this . options ?. bind ( ) ;
@@ -110,7 +100,7 @@ export default class ImportExpression extends NodeBase {
110
100
if ( parent1 instanceof AwaitExpression ) {
111
101
const parent2 = parent1 . parent ;
112
102
113
- // Side- effect only: await import('bar')
103
+ // Side effect only: await import('bar')
114
104
if ( parent2 instanceof ExpressionStatement ) {
115
105
return EMPTY_ARRAY ;
116
106
}
@@ -222,25 +212,6 @@ export default class ImportExpression extends NodeBase {
222
212
initialise ( ) : void {
223
213
super . initialise ( ) ;
224
214
this . scope . context . addDynamicImport ( this ) ;
225
- let parent = this . parent ;
226
- let withinAwaitExpression = false ;
227
- let withinTopLevelAwait = false ;
228
- do {
229
- if (
230
- withinAwaitExpression &&
231
- ( parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression )
232
- ) {
233
- withinTopLevelAwait = false ;
234
- }
235
- if ( parent instanceof AwaitExpression ) {
236
- withinAwaitExpression = true ;
237
- withinTopLevelAwait = true ;
238
- }
239
- } while ( ( parent = ( parent as Node ) . parent as Node ) ) ;
240
-
241
- if ( withinAwaitExpression && withinTopLevelAwait ) {
242
- this . withinTopLevelAwait = true ;
243
- }
244
215
}
245
216
246
217
parseNode ( esTreeNode : GenericEsTreeNode ) : this {
0 commit comments