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

add `allowTopLevelThis` option to `transform-modules-systemjs` #10780


Copy link

JLHwung commented Nov 29, 2019

Q                       A
Fixed Issues? Fixes #10775
Major: Breaking Change? See discussion below.
Minor: New Feature? Yes
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes? Yes, @babel/plugin-transform-modules-systemjs now depends on @babel/helper-module-transforms.
License MIT

This PR adds allowTopLevelThis option to transform-modules-systemjs. To be consistent with other module transforms plugin, the default value of allowTopLevelThis is false, which means the top level this will be replaced by void 0 by default.

The spec dictates that in the module executing context, this is always undefined. So the default value does make it align to the specs. Though I am not sure how many people rely on the previous incompliant behaviour.

  • add document PR if we agree on the interface

This comment has been minimized.

Copy link

nicolo-ribaudo commented Jan 10, 2020

@JLHwung Docs 🙏

@nicolo-ribaudo nicolo-ribaudo merged commit 44f9d85 into babel:master Jan 10, 2020
4 of 5 checks passed
4 of 5 checks passed
test262 Workflow: test262
Travis CI - Pull Request Build Passed
codecov/project 88.15% (target 80%)
e2e Workflow: e2e
test Workflow: test
@nicolo-ribaudo nicolo-ribaudo deleted the JLHwung:allow-top-level-this-transform-modules-systemjs branch Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.