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

Extend hasPlugin to accept plugin-configuration array pairs #13982

Merged
merged 2 commits into from Dec 2, 2021

Conversation

js-choi
Copy link
Contributor

@js-choi js-choi commented Nov 19, 2021

Q                       A
Fixed Issues? No
Patch: Bug Fix? No
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? Yes
Documentation PR Link Not needed
Any Dependency Changes? No
License MIT

See #13973 (comment).
CC: @JLHwung.

@js-choi js-choi marked this pull request as draft November 20, 2021 01:09
@js-choi js-choi marked this pull request as ready for review November 20, 2021 02:44
Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

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

Nice work!

@JLHwung JLHwung added pkg: parser PR: Internal 🏠 A type of pull request used for our changelog categories area: errors labels Nov 26, 2021
This also allows expectPlugin and expectOnePlugin to give better error messages. For example:
> This experimental syntax requires enabling the parser plugin "pipelineOperator".
> This experimental syntax requires enabling the parser plugin ["pipelineOperator", {proposal: "hack", topicToken: "^^"}].

See babel#13973 (comment).
@nicolo-ribaudo
Copy link
Member

The parser test262 tests were failing because on some Node.js versions Object.prototype["__proto__"] (the property, not the internal [[Prototype]]) is Object.create(null), and the failing tests have __proto__ in their features list: for this reason, Object.create(null) was passed to the @babel/parser plugins list.

I don't know why it's not failing on main.

@nicolo-ribaudo nicolo-ribaudo changed the title parser: Extend hasPlugin to accept plugin-configuration array pairs Extend hasPlugin to accept plugin-configuration array pairs Dec 2, 2021
@nicolo-ribaudo nicolo-ribaudo merged commit f4236f4 into babel:main Dec 2, 2021
@js-choi js-choi deleted the has-plugin-config-array branch December 2, 2021 23:20
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Mar 4, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: errors outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants