-
Notifications
You must be signed in to change notification settings - Fork 548
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: conflict between imported and local binding (#356)
<!-- Thank you for contributing! --> ### Description Fixes #355 <!-- Please insert your description here and provide especially info about the "what" this PR is solving --> ### Test Plan <!-- e.g. is there anything you'd like reviewers to focus on? --> ---
- Loading branch information
Showing
4 changed files
with
44 additions
and
4 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
27 changes: 27 additions & 0 deletions
27
...down/tests/fixtures/deconflict/conflict_between_imported_and_local_binding/artifacts.snap
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,27 @@ | ||
--- | ||
source: crates/rolldown/tests/common/case.rs | ||
expression: content | ||
input_file: crates/rolldown/tests/fixtures/deconflict/conflict_between_imported_and_local_binding | ||
--- | ||
# Assets | ||
|
||
## main.mjs | ||
|
||
```js | ||
import { default as assert } from "node:assert"; | ||
import { __commonJS } from "./_rolldown_runtime.mjs"; | ||
// main.js | ||
var require_main = __commonJS({ | ||
'main.js'(exports, module) { | ||
module.exports = 'main'; | ||
const __commonJS$1 = 1 | ||
assert.equal(__commonJS$1, 1) | ||
} | ||
}); | ||
export default require_main(); | ||
``` |
6 changes: 6 additions & 0 deletions
6
...es/rolldown/tests/fixtures/deconflict/conflict_between_imported_and_local_binding/main.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,6 @@ | ||
import assert from 'node:assert' | ||
module.exports = 'main'; | ||
|
||
const __commonJS = 1 | ||
|
||
assert.equal(__commonJS, 1) |
7 changes: 7 additions & 0 deletions
7
...wn/tests/fixtures/deconflict/conflict_between_imported_and_local_binding/test.config.json
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,7 @@ | ||
{ | ||
"input": { | ||
"external": [ | ||
"node:assert" | ||
] | ||
} | ||
} |