-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Suboptimal code generation for transpiled class expressions #1660
Comments
kdy1
added a commit
to kdy1/swc
that referenced
this issue
May 9, 2021
kdy1
added a commit
to kdy1/swc
that referenced
this issue
May 9, 2021
kdy1
added a commit
that referenced
this issue
May 9, 2021
With your PR, I'm still seeing the additional wrapper console.log(function() {
var _class = /*#__PURE__*/ function() {
"use strict";
function _class() {
_classCallCheck(this, _class);
}
_createClass(_class, [
{
key: "run",
value: function run() {
}
}
]);
return _class;
}();
return _class;
}()); |
kdy1
added a commit
to kdy1/swc
that referenced
this issue
May 9, 2021
kdy1
added a commit
to kdy1/swc
that referenced
this issue
May 9, 2021
kdy1
added a commit
to kdy1/swc
that referenced
this issue
May 9, 2021
kdy1
added a commit
to kdy1/swc
that referenced
this issue
May 9, 2021
1 task
kdy1
added a commit
that referenced
this issue
May 10, 2021
swc_ecma_transforms_compat: - `class_properties`: Do not create iife if possible. (#1660)
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
There is a unnecessary IIFE wrapper (which is also missing a pure comment, but ideally it would be removed entirely) around class expressions (not declarations)
Input code
Output code
Expected behavior
Something like
so without that
function(){var _class = ...; return _class;}()
wrapperConfig
Full example
Version
c3bf517
The text was updated successfully, but these errors were encountered: