Browse Source

Do a `module.locals.lookup` since `module.imports` is removed.

gh-109
Oskar Segersvärd 10 years ago
parent
commit
81b9ccfe4c
  1. 7
      src/Statement.js

7
src/Statement.js

@ -189,10 +189,9 @@ export default class Statement {
// disallow assignments/updates to imported bindings and namespaces // disallow assignments/updates to imported bindings and namespaces
if ( isAssignment ) { if ( isAssignment ) {
// FIXME: imports is no longer used. const importSpecifier = this.module.locals.lookup( node.name );
const importSpecifier = this.module.imports[ node.name ];
if ( importSpecifier && !scope.contains( node.name ) ) { if ( importSpecifier && importSpecifier.module !== this.module && !scope.contains( node.name ) ) {
const minDepth = importSpecifier.name === '*' ? const minDepth = importSpecifier.name === '*' ?
2 : // cannot do e.g. `namespace.foo = bar` 2 : // cannot do e.g. `namespace.foo = bar`
1; // cannot do e.g. `foo = bar`, but `foo.bar = bar` is fine 1; // cannot do e.g. `foo = bar`, but `foo.bar = bar` is fine
@ -273,7 +272,7 @@ export default class Statement {
return; return;
} }
Object.keys( this.dependsOn ).forEach( name => { keys( this.dependsOn ).forEach( name => {
if ( this.defines[ name ] ) return; // TODO maybe exclude from `this.dependsOn` in the first place? if ( this.defines[ name ] ) return; // TODO maybe exclude from `this.dependsOn` in the first place?
this.module.mark( name ); this.module.mark( name );
}); });

Loading…
Cancel
Save