Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent setting unstable feature twice #24381

Merged
merged 6 commits into from
Jul 2, 2024

Conversation

HasanAlrimawi
Copy link
Contributor

@HasanAlrimawi HasanAlrimawi commented Jul 1, 2024

Prevent panic when enabling a feature that is already enabled by removing duplicate features.

This commit addresses issue #22015

Problem source
fn unstable_feature() of CliOptions fetches the unstable flags from both the subcommand to execute and the config file deno.json without checking for repetition among the flags found.

Solution & Code change
Make sure to set/add no more than one of each of the flags mentioned within config file and the subcommand without repetition of any flag by updating fn unstable_features().

Closes #22015

@bartlomieju
Copy link
Member

Thanks for the fix. Could you add a "spec" tests with this scenario (#22015 (comment)) to tests/specs/compile?

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice fix, thank you @HasanAlrimawi

@bartlomieju bartlomieju enabled auto-merge (squash) July 2, 2024 22:51
@bartlomieju bartlomieju added this to the 1.45 milestone Jul 2, 2024
@bartlomieju bartlomieju merged commit 3324d72 into denoland:main Jul 2, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic on Trying to enabled a feature that is already enabled kv from compiled binary
2 participants