-
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: invalid output for conflict global and local name (#359)
<!-- Thank you for contributing! --> ### Description Fixes #357. <!-- 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
6 changed files
with
58 additions
and
19 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
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
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
26 changes: 26 additions & 0 deletions
26
...lldown/tests/fixtures/deconflict/conflict_between_global_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,26 @@ | ||
--- | ||
source: crates/rolldown/tests/common/case.rs | ||
expression: content | ||
input_file: crates/rolldown/tests/fixtures/deconflict/conflict_between_global_and_local_binding | ||
--- | ||
# Assets | ||
|
||
## main.mjs | ||
|
||
```js | ||
import { default as assert } from "node:assert"; | ||
import { __commonJS as __commonJS$1 } from "./_rolldown_runtime.mjs"; | ||
// main.js | ||
var require_main = __commonJS$1({ | ||
'main.js'(exports, module) { | ||
module.exports = 'main'; | ||
globalThis.__commonJS = 0 | ||
__commonJS = 1 | ||
assert.equal(__commonJS, 1) | ||
} | ||
}); | ||
export default require_main(); | ||
``` |
5 changes: 5 additions & 0 deletions
5
crates/rolldown/tests/fixtures/deconflict/conflict_between_global_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,5 @@ | ||
import assert from 'node:assert' | ||
module.exports = 'main'; | ||
globalThis.__commonJS = 0 | ||
__commonJS = 1 | ||
assert.equal(__commonJS, 1) |
7 changes: 7 additions & 0 deletions
7
...down/tests/fixtures/deconflict/conflict_between_global_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" | ||
] | ||
} | ||
} |