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

deleting '--' in parse object causes issues when argv is frozen #1482

Closed
bcoe opened this issue Nov 19, 2019 · 1 comment
Closed

deleting '--' in parse object causes issues when argv is frozen #1482

bcoe opened this issue Nov 19, 2019 · 1 comment
Labels

Comments

@bcoe
Copy link
Member

bcoe commented Nov 19, 2019

We currently have logic that temporarily populates --, during command parsing, making it easier to differentiate between arguments after -- and positional arguments before --. We then delete this field post-parse, if the user did not request -- be populated.

Unfortunately, this creates an edge-case where if a user calls Object.seal or Object.freeze on argv, an exception can occur.

This logic is pretty silly, let's not do it -- there's already discussion of using a WeakMap to store information about whether or not parameters in argv have been deleted, I wonder if we could use a similar approach to track parameters after the --.

see: babel/babel#10733

@bcoe
Copy link
Member Author

bcoe commented Sep 20, 2020

the try/catch logic has been working quite well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant