@@ -33,8 +33,6 @@ import MemberExpression from './MemberExpression';
3333import type * as NodeType from './NodeType' ;
3434import ObjectPattern from './ObjectPattern' ;
3535import { Flag , isFlagSet , setFlag } from './shared/BitFlags' ;
36- import FunctionNode from './shared/FunctionNode' ;
37- import type { Node } from './shared/Node' ;
3836import {
3937 doNotDeoptimize ,
4038 type ExpressionNode ,
@@ -76,14 +74,6 @@ export default class ImportExpression extends NodeBase {
7674 this . flags = setFlag ( this . flags , Flag . shouldIncludeDynamicAttributes , value ) ;
7775 }
7876
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-
8777 bind ( ) : void {
8878 this . source . bind ( ) ;
8979 this . options ?. bind ( ) ;
@@ -110,7 +100,7 @@ export default class ImportExpression extends NodeBase {
110100 if ( parent1 instanceof AwaitExpression ) {
111101 const parent2 = parent1 . parent ;
112102
113- // Side- effect only: await import('bar')
103+ // Side effect only: await import('bar')
114104 if ( parent2 instanceof ExpressionStatement ) {
115105 return EMPTY_ARRAY ;
116106 }
@@ -222,25 +212,6 @@ export default class ImportExpression extends NodeBase {
222212 initialise ( ) : void {
223213 super . initialise ( ) ;
224214 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- }
244215 }
245216
246217 parseNode ( esTreeNode : GenericEsTreeNode ) : this {
0 commit comments