Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jun 13, 2020
1 parent 332e005 commit 34946ad
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/ast/nodes/MemberExpression.ts
Expand Up @@ -258,18 +258,18 @@ export default class MemberExpression extends NodeBase implements DeoptimizableE
}

private disallowNamespaceReassignment() {
if (
this.object instanceof Identifier &&
this.scope.findVariable(this.object.name).isNamespace
) {
this.scope.findVariable(this.object.name).include();
this.context.warn(
{
code: 'ILLEGAL_NAMESPACE_REASSIGNMENT',
message: `Illegal reassignment to import '${this.object.name}'`
},
this.start
);
if (this.object instanceof Identifier) {
const ns = this.scope.findVariable(this.object.name);
if (ns.isNamespace) {
ns.include();
this.context.warn(
{
code: 'ILLEGAL_NAMESPACE_REASSIGNMENT',
message: `Illegal reassignment to import '${this.object.name}'`
},
this.start
);
}
}
}

Expand Down

0 comments on commit 34946ad

Please sign in to comment.