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

[helpers] Add a private function name within createSuper #11514

Merged
merged 2 commits into from May 4, 2020

Conversation

cpojer
Copy link
Member

@cpojer cpojer commented May 4, 2020

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

The createSuper helper was changed sometime between 7.4 and 7.9 to add a new private function within createSuper. We noticed in a large codebase that when a custom error instance gets thrown (like throw new class CustomError extends Error {}), the top of the stack frame blames to this internal function instead of the callsite. In this diff I propose adding a function name so that it isn't anonymous and can be filtered out by error reporting systems (when using source maps correctly). This diff should only add one byte in minified output for users of the ES2015 class transform.

@babel-bot
Copy link
Collaborator

babel-bot commented May 4, 2020

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/21772/

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 4, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5d89be3:

Sandbox Source
vigilant-morning-xffcx Configuration
headless-cloud-d4qiz Configuration

@existentialism existentialism added area: helpers PR: Polish 💅 A type of pull request used for our changelog categories labels May 4, 2020
@jridgewell
Copy link
Member

@cpojer: Can you update the tests? Run OVERWRITE=1 make test-only

@cpojer
Copy link
Member Author

cpojer commented May 4, 2020

Somehow I can't locally run the tests on my Facebook company laptop, possibly related to some watchman and Jest setup issue. Any chance you could update the test? 😬

@nicolo-ribaudo
Copy link
Member

@cpojer Can you allow edits from maintainers?

@cpojer
Copy link
Member Author

cpojer commented May 4, 2020

@nicolo-ribaudo should have already been enabled:
Screen Shot 2020-05-04 at 21 00 31

@existentialism
Copy link
Member

@nicolo-ribaudo @cpojer pushed updated fixtures

@nicolo-ribaudo nicolo-ribaudo merged commit 2bb2933 into babel:master May 4, 2020
@nicolo-ribaudo
Copy link
Member

CI failure related to preset-env should be fixed on master.

@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 Aug 4, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 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: Polish 💅 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

6 participants