-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Breaks with some transformations #280
Comments
Wow! It was fast! |
@theKashey :). As this is bugfix, I'll publish v1.0.28 soon |
Sorry @kdy, but that's not the end source
function Ii(e, t, n) {
if ("selectionStart" in a) var o = {
start: a.selectionStart,
end: a.selectionEnd
};
else e:{ <-----
var l = (o = (o = a.ownerDocument) && o.defaultView || window).getSelection && o.getSelection();
if (l && 0 !== l.rangeCount) {
o = l.anchorNode;
var c = l.anchorOffset, s = l.focusNode;
l = l.focusOffset;
try {
o.nodeType, s.nodeType
} catch (e) {
o = null;
break e <-----
} result
var Ii = function Ii(e1, t1, n1) {
if ('selectionStart' in a) var o = {
start: a.selectionStart,
end: a.selectionEnd
};
else e1: { <<-----
var l = (o = (o = a.ownerDocument) && o.defaultView || window).getSelection && o.getSelection();
if (l && 0 !== l.rangeCount) {
o = l.anchorNode;
var c = l.anchorOffset, s = l.focusNode;
l = l.focusOffset;
try {
o.nodeType, s.nodeType;
} catch (e2) {
o = null;
break e2; <-----, this label does not exists
} SWC is used on minified bundle. The same code, without minification produces almost identical source code, and does not contain the issue. original source codefunction Sh(a, b, c) {
if (Ud(e)) {
if ("selectionStart" in e) var f = {
start: e.selectionStart,
end: e.selectionEnd
};else a: {
f = (f = e.ownerDocument) && f.defaultView || window;
var g = f.getSelection && f.getSelection();
if (g && 0 !== g.rangeCount) {
f = g.anchorNode;
var h = g.anchorOffset,
k = g.focusNode;
g = g.focusOffset;
try {
f.nodeType, k.nodeType;
} catch (db) {
f = null;
break a;
} Produced code - almost identical. Link to the scripts:
|
source code !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
return classNames;
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); result code!__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
return classNames;
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
Yet again - syntax error :( |
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. |
I've tried to apply swc for
node_modules
and run into the issue withreact
codebefore transpilation
after transpilation
The key moment is
&& ((t = e[a]) ?
!==&& t1 = e1[a] ?
, in the second case this is a syntax error (just drop code to the dev console).I didn't found a way how to disable this transformation, and it's a critical for me.
What I did
The text was updated successfully, but these errors were encountered: