forked from esnext/es6-module-transpiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an additional test case for checking non top level scopes reass…
…igning to imported binding identifiers
- Loading branch information
1 parent
645eb10
commit 14777c0
Showing
3 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
test/examples/reassign-import-not-at-top-level-fails/exporter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
test/examples/reassign-import-not-at-top-level-fails/importer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |