From 3324d7203e8d00bb39cfae104e0aec61ba954e9b Mon Sep 17 00:00:00 2001 From: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com> Date: Wed, 3 Jul 2024 02:15:10 +0300 Subject: fix(compile): prevent setting unstable feature twice (#24381) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevent panic when enabling a feature that is already enabled by removing duplicate features. Closes #22015 --------- Co-authored-by: Bartek IwaƄczuk --- tests/specs/compile/repetitive_unstable_flag/.gitignore | 2 ++ tests/specs/compile/repetitive_unstable_flag/__test__.jsonc | 13 +++++++++++++ tests/specs/compile/repetitive_unstable_flag/compile.out | 2 ++ tests/specs/compile/repetitive_unstable_flag/deno.json | 3 +++ tests/specs/compile/repetitive_unstable_flag/main.out | 1 + tests/specs/compile/repetitive_unstable_flag/main.ts | 1 + 6 files changed, 22 insertions(+) create mode 100644 tests/specs/compile/repetitive_unstable_flag/.gitignore create mode 100644 tests/specs/compile/repetitive_unstable_flag/__test__.jsonc create mode 100644 tests/specs/compile/repetitive_unstable_flag/compile.out create mode 100644 tests/specs/compile/repetitive_unstable_flag/deno.json create mode 100644 tests/specs/compile/repetitive_unstable_flag/main.out create mode 100644 tests/specs/compile/repetitive_unstable_flag/main.ts (limited to 'tests') diff --git a/tests/specs/compile/repetitive_unstable_flag/.gitignore b/tests/specs/compile/repetitive_unstable_flag/.gitignore new file mode 100644 index 000000000..ed6b0677d --- /dev/null +++ b/tests/specs/compile/repetitive_unstable_flag/.gitignore @@ -0,0 +1,2 @@ +out.exe +out diff --git a/tests/specs/compile/repetitive_unstable_flag/__test__.jsonc b/tests/specs/compile/repetitive_unstable_flag/__test__.jsonc new file mode 100644 index 000000000..00d38bee6 --- /dev/null +++ b/tests/specs/compile/repetitive_unstable_flag/__test__.jsonc @@ -0,0 +1,13 @@ +{ + "steps": [ + { + "args": "compile --unstable-kv -A --output out main.ts", + "output": "compile.out" + }, + { + "commandName": "./out", + "args": [], + "output": "main.out" + } + ] +} diff --git a/tests/specs/compile/repetitive_unstable_flag/compile.out b/tests/specs/compile/repetitive_unstable_flag/compile.out new file mode 100644 index 000000000..022f2c580 --- /dev/null +++ b/tests/specs/compile/repetitive_unstable_flag/compile.out @@ -0,0 +1,2 @@ +Check [WILDCARD]main.ts +Compile [WILDCARD]main.ts to out[WILDCARD] diff --git a/tests/specs/compile/repetitive_unstable_flag/deno.json b/tests/specs/compile/repetitive_unstable_flag/deno.json new file mode 100644 index 000000000..c0401f75f --- /dev/null +++ b/tests/specs/compile/repetitive_unstable_flag/deno.json @@ -0,0 +1,3 @@ +{ + "unstable": ["kv"] +} diff --git a/tests/specs/compile/repetitive_unstable_flag/main.out b/tests/specs/compile/repetitive_unstable_flag/main.out new file mode 100644 index 000000000..2170a5a7d --- /dev/null +++ b/tests/specs/compile/repetitive_unstable_flag/main.out @@ -0,0 +1 @@ +Duplicate unstable feature issue is resolved as you can see diff --git a/tests/specs/compile/repetitive_unstable_flag/main.ts b/tests/specs/compile/repetitive_unstable_flag/main.ts new file mode 100644 index 000000000..c45100cfd --- /dev/null +++ b/tests/specs/compile/repetitive_unstable_flag/main.ts @@ -0,0 +1 @@ +console.log("Duplicate unstable feature issue is resolved as you can see"); -- cgit v1.2.3