Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1028adb

Browse files
committed
Replace includeDestructuredIfNecessary with a stub in MemberExpression
1 parent 8063fa1 commit 1028adb

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

src/ast/nodes/MemberExpression.ts

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { logIllegalImportReassignment, logMissingExport } from '../../utils/logs
77
import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';
88
import type { DeoptimizableEntity } from '../DeoptimizableEntity';
99
import type { HasEffectsContext, InclusionContext } from '../ExecutionContext';
10-
import { createHasEffectsContext, createInclusionContext } from '../ExecutionContext';
10+
import { createInclusionContext } from '../ExecutionContext';
1111
import type {
1212
NodeInteraction,
1313
NodeInteractionAccessed,
@@ -440,28 +440,14 @@ export default class MemberExpression
440440
}
441441
}
442442

443-
includeDestructuredIfNecessary(
444-
context: InclusionContext,
445-
destructuredInitPath: ObjectPath,
446-
init: ExpressionEntity
447-
): boolean {
448-
let included = this.included;
449-
if (
450-
(included ||=
451-
destructuredInitPath.length > 0 &&
452-
!context.brokenFlow &&
453-
init.hasEffectsOnInteractionAtPath(
454-
destructuredInitPath,
455-
NODE_INTERACTION_UNKNOWN_ACCESS,
456-
createHasEffectsContext()
457-
))
458-
) {
459-
init.include(context, false);
460-
}
461-
if (!this.included && included) {
462-
this.includeNode(context);
463-
}
464-
return this.included;
443+
includeDestructuredIfNecessary(): boolean {
444+
/* istanbul ignore next */
445+
this.scope.context.error(
446+
{
447+
message: 'includeDestructuredIfNecessary is currently not supported for MemberExpressions'
448+
},
449+
this.start
450+
);
465451
}
466452

467453
initialise(): void {

0 commit comments

Comments
 (0)