-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: collect-dependends-symbol (#2079)
<!-- Thank you for contributing! --> ### Description 1. Closed #2038 2. in main branch the testcase will panic. ```bash thread '<unnamed>' panicked at crates/rolldown/src/types/symbols.rs:68:7: canonical name not found for SymbolRef { owner: 3, symbol: SymbolId(0) }, original_name: "result" note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` <!-- Please insert your description here and provide especially info about the "what" this PR is solving -->
- Loading branch information
1 parent
ea4965f
commit 0205983
Showing
9 changed files
with
217 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
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 @@ | ||
import * as d from './b.js' | ||
|
||
export default d.result() |
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,53 @@ | ||
--- | ||
source: crates/rolldown_testing/src/integration_test.rs | ||
--- | ||
# Assets | ||
|
||
## a.mjs | ||
|
||
```js | ||
import { result } from "./b.mjs"; | ||
//#region a.js | ||
var a_default = result(); | ||
//#endregion | ||
export { a_default as default }; | ||
``` | ||
## b.mjs | ||
|
||
```js | ||
//#region b.js | ||
function result() { | ||
return "result"; | ||
} | ||
function test() { | ||
return "test"; | ||
} | ||
//#endregion | ||
export { result, test }; | ||
``` | ||
## b~1.mjs | ||
|
||
```js | ||
import { result, test } from "./b.mjs"; | ||
export { result, test }; | ||
``` | ||
## main.mjs | ||
|
||
```js | ||
import { default as assert } from "node:assert"; | ||
//#region main.js | ||
import("./b~1.mjs").then((mod) => { | ||
assert.strictEqual(mod.result(), "result"); | ||
}); | ||
import("./a.mjs").then((mod) => { | ||
assert.strictEqual(mod.default, "result"); | ||
}); | ||
//#endregion | ||
``` |
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 @@ | ||
export function result() { | ||
return 'result' | ||
} | ||
|
||
export function test() { | ||
return 'test' | ||
} |
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 @@ | ||
import assert from 'node:assert' | ||
import("./b").then((mod) => { | ||
assert.strictEqual(mod.result(), "result") | ||
}) | ||
import("./a").then(mod => { | ||
assert.strictEqual(mod.default, "result") | ||
}) |
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
Oops, something went wrong.