Skip to content

Commit

Permalink
fix: forbid_const_assign_when_lowering_using test (#1413)
Browse files Browse the repository at this point in the history
  • Loading branch information
komyg committed Jun 19, 2024
1 parent 949c819 commit 0d15f0e
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 19 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"input": {
"expectExecuted": false,
"config": {
"input": [
{
"name": "entry_js",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
source: crates/rolldown/tests/common/case.rs
assertion_line: 171
expression: content
input_file: crates/rolldown/tests/esbuild/default/forbid_const_assign_when_lowering_using
---
# warnings

## ILLEGAL_REASSIGNMENT

```text
[ILLEGAL_REASSIGNMENT] Warning: Unexpected re-assignment of const variable `x`
╭─[entry.js:3:1]
1 │ const x = 1
│ ┬
│ ╰── `x` is declared here as const
3 │ x = 3
│ ┬
│ ╰── `x` is re-assigned here
───╯
```
## ILLEGAL_REASSIGNMENT

```text
[ILLEGAL_REASSIGNMENT] Warning: Unexpected re-assignment of const variable `y`
╭─[entry.js:7:2]
5 │ const y = 1
│ ┬
│ ╰── `y` is declared here as const
7 │ y = 3
│ ┬
│ ╰── `y` is re-assigned here
───╯
```
# Assets

## entry_js.mjs

```js
//#region entry.js
const x = 1;
using x2 = 2;
x = 3;
//#endregion
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: crates/rolldown/tests/fixtures.rs
assertion_line: 54
expression: "snapshot_outputs.join(\"\\n\")"
---
# tests/esbuild/dce/base64_loader_remove_unused
Expand Down Expand Up @@ -237,6 +238,10 @@ expression: "snapshot_outputs.join(\"\\n\")"

- entry_js-!~{000}~.mjs => entry_js-Xnvegfxd.mjs

# tests/esbuild/default/forbid_const_assign_when_lowering_using

- entry_js-!~{000}~.mjs => entry_js-idsVRs5M.mjs

# tests/esbuild/default/import_fs_node_common_js

- entry_js-!~{000}~.cjs => entry_js-aITEk-gU.cjs
Expand Down

0 comments on commit 0d15f0e

Please sign in to comment.