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

Mark wrapNativeSuper and wrapRegExp as pure #11134

Merged
merged 1 commit into from Feb 21, 2020

Conversation

nicolo-ribaudo
Copy link
Member

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

Technically there are also other pure helpers (e.g. asyncToGenerator), but annotating them won't help minifiers because their result is always directly used by the compiled output.

@nicolo-ribaudo nicolo-ribaudo added PR: New Feature 🚀 A type of pull request used for our changelog categories area: helpers labels Feb 12, 2020
: t.cloneNode(superName);
let arg = t.cloneNode(superName);
if (classState.extendsNative) {
arg = t.callExpression(classState.file.addHelper("wrapNativeSuper"), [
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add pure notation to the helper sources so we don't worry about if the helper needs pure annotation when added?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have thought about it, but the problem is that the annotation should be added to the CallExpression, and the æddHelper function only returns the callee.

@nicolo-ribaudo nicolo-ribaudo merged commit 4b04581 into babel:master Feb 21, 2020
@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 May 23, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: helpers outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: New Feature 🚀 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