Skip to content

Commit

Permalink
Added an additional test case for checking non top level scopes reass…
Browse files Browse the repository at this point in the history
…igning to imported binding identifiers
  • Loading branch information
matthewrobb committed Aug 14, 2014
1 parent 645eb10 commit 14777c0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/examples/reassign-import-fails/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import { x } from './exporter';

function $() {
(function() {
for(var x = 0; x < 1; x++){}
for(var x = 0; x < 1; x++){}
}
});

/* error: type=SyntaxError message="Cannot reassign imported binding `x` at importer.js:11:1" */
x = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* jshint esnext:true */

export var x = 1;
11 changes: 11 additions & 0 deletions test/examples/reassign-import-not-at-top-level-fails/importer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* jshint esnext:true */

import { x } from './exporter';

export function foo () {
var x = 1;
}
export function bar () {
/* error: type=SyntaxError message="Cannot reassign imported binding `x` at importer.js:10:3" */
x = 1;
}

0 comments on commit 14777c0

Please sign in to comment.