mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 02:06:08 +03:00
fix(es/compat): Fix name conflict of Array
(#5034)
This commit is contained in:
parent
c35cd242b8
commit
04fc1cb429
@ -1 +1 @@
|
||||
export function testme(){for(var a=arguments.length,b=new Array(a),c=0;c<a;c++)b[c]=arguments[c];/^toto.+/.test(b.join(""))&&global.other(!0)}
|
||||
export function testme(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];/^toto.+/.test(b.join(""))&&global.other(!0)}
|
||||
|
@ -11,7 +11,7 @@ var A = function() {
|
||||
return regeneratorRuntime.wrap(function(_ctx) {
|
||||
for(;;)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
for(_len = _args.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = _args[_key];
|
||||
for(args = Array(_len = _args.length), _key = 0; _key < _len; _key++)args[_key] = _args[_key];
|
||||
return _ctx.next = 3, Promise.resolve();
|
||||
case 3:
|
||||
obj = _define_property({}, "a", function() {
|
||||
|
@ -5,7 +5,7 @@ import _inherits from "@swc/helpers/src/_inherits.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
import _create_super from "@swc/helpers/src/_create_super.mjs";
|
||||
function foo(x, y) {
|
||||
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
}
|
||||
foo(1, 2, "abc"), foo.apply(void 0, [
|
||||
1,
|
||||
@ -47,14 +47,14 @@ foo(1, 2, "abc"), foo.apply(void 0, [
|
||||
var _obj, _obj1, _instance, _instance1, a, obj, xa, C = function() {
|
||||
"use strict";
|
||||
function C(x, y) {
|
||||
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
_class_call_check(this, C), this.foo(x, y), this.foo.apply(this, [
|
||||
x,
|
||||
y
|
||||
].concat(_to_consumable_array(z)));
|
||||
}
|
||||
return C.prototype.foo = function(x, y) {
|
||||
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
}, C;
|
||||
}(), D = function(C) {
|
||||
"use strict";
|
||||
|
@ -5,7 +5,7 @@ import _inherits from "@swc/helpers/src/_inherits.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
import _create_super from "@swc/helpers/src/_create_super.mjs";
|
||||
function foo(x, y) {
|
||||
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
}
|
||||
foo(1, 2, "abc"), foo.apply(void 0, [
|
||||
1,
|
||||
@ -81,14 +81,14 @@ foo(1, 2, "abc"), foo.apply(void 0, [
|
||||
var _obj, _obj1, _obj2, _obj3, _instance, _obj4, _instance1, _instance2, _instance3, a, obj, xa, C = function() {
|
||||
"use strict";
|
||||
function C(x, y) {
|
||||
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
_class_call_check(this, C), this.foo(x, y), this.foo.apply(this, [
|
||||
x,
|
||||
y
|
||||
].concat(_to_consumable_array(z)));
|
||||
}
|
||||
return C.prototype.foo = function(x, y) {
|
||||
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
}, C;
|
||||
}(), D = function(C) {
|
||||
"use strict";
|
||||
|
@ -3,22 +3,22 @@
|
||||
}(12), function() {
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
||||
}(), function() {
|
||||
for(var _len = arguments.length, numbers = new Array(_len), _key = 0; _key < _len; _key++)numbers[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, numbers = Array(_len), _key = 0; _key < _len; _key++)numbers[_key] = arguments[_key];
|
||||
numbers.every(function(n) {
|
||||
return n > 0;
|
||||
});
|
||||
}(5, 6, 7), function() {
|
||||
for(var _len = arguments.length, mixed = new Array(_len), _key = 0; _key < _len; _key++)mixed[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, mixed = Array(_len), _key = 0; _key < _len; _key++)mixed[_key] = arguments[_key];
|
||||
mixed.every(function(n) {
|
||||
return !!n;
|
||||
});
|
||||
}(5, "oops", "oh no"), function() {
|
||||
for(var _len = arguments.length, noNumbers = new Array(_len), _key = 0; _key < _len; _key++)noNumbers[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, noNumbers = Array(_len), _key = 0; _key < _len; _key++)noNumbers[_key] = arguments[_key];
|
||||
noNumbers.some(function(n) {
|
||||
return n > 0;
|
||||
});
|
||||
}(), function(first) {
|
||||
for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
}(8, 9, 10), function() {
|
||||
var ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {
|
||||
r: 18
|
||||
|
@ -3,22 +3,22 @@
|
||||
}(12), function() {
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
||||
}(), function() {
|
||||
for(var _len = arguments.length, numbers = new Array(_len), _key = 0; _key < _len; _key++)numbers[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, numbers = Array(_len), _key = 0; _key < _len; _key++)numbers[_key] = arguments[_key];
|
||||
numbers.every(function(n) {
|
||||
return n > 0;
|
||||
});
|
||||
}(5, 6, 7), function() {
|
||||
for(var _len = arguments.length, mixed = new Array(_len), _key = 0; _key < _len; _key++)mixed[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, mixed = Array(_len), _key = 0; _key < _len; _key++)mixed[_key] = arguments[_key];
|
||||
mixed.every(function(n) {
|
||||
return !!n;
|
||||
});
|
||||
}(5, "oops", "oh no"), function() {
|
||||
for(var _len = arguments.length, noNumbers = new Array(_len), _key = 0; _key < _len; _key++)noNumbers[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, noNumbers = Array(_len), _key = 0; _key < _len; _key++)noNumbers[_key] = arguments[_key];
|
||||
noNumbers.some(function(n) {
|
||||
return n > 0;
|
||||
});
|
||||
}(), function(first) {
|
||||
for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
}(8, 9, 10), function() {
|
||||
var ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {
|
||||
r: 18
|
||||
|
@ -8,7 +8,7 @@ var EventEmitter = function() {
|
||||
_class_call_check(this, EventEmitter);
|
||||
}
|
||||
return EventEmitter.prototype.off = function() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
}, EventEmitter;
|
||||
}(), TableBaseEnum = function() {
|
||||
"use strict";
|
||||
|
@ -1,3 +1,3 @@
|
||||
export default function f() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
};
|
||||
|
@ -11,15 +11,15 @@ var E, E1, array = [
|
||||
3
|
||||
];
|
||||
function foo() {
|
||||
for(var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
}
|
||||
function foo1() {
|
||||
for(var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
}
|
||||
!function() {
|
||||
for(var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
}(_to_consumable_array(array)), (function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}).apply(void 0, _to_consumable_array(array)), function(param) {
|
||||
var _param = _sliced_to_array(param, 3), ref = (_param[0], _param[1], _sliced_to_array(_param[2], 1)), ref1 = _sliced_to_array(ref[0], 1);
|
||||
ref1[0];
|
||||
|
@ -11,15 +11,15 @@ var E, E1, array = [
|
||||
3
|
||||
];
|
||||
function foo() {
|
||||
for(var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
}
|
||||
function foo1() {
|
||||
for(var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
}
|
||||
!function() {
|
||||
for(var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
}(_to_consumable_array(array)), (function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}).apply(void 0, _to_consumable_array(array)), function(param) {
|
||||
var _param = _sliced_to_array(param, 3), ref = (_param[0], _param[1], _sliced_to_array(_param[2], 1)), ref1 = _sliced_to_array(ref[0], 1);
|
||||
ref1[0];
|
||||
|
@ -11,15 +11,15 @@ var E, E1, array = [
|
||||
3
|
||||
];
|
||||
function foo() {
|
||||
for(var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
}
|
||||
function foo1() {
|
||||
for(var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
}
|
||||
!function() {
|
||||
for(var _len = arguments.length, a = new Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++)a[_key] = arguments[_key];
|
||||
}(_to_consumable_array(array)), (function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}).apply(void 0, _to_consumable_array(array)), function(param) {
|
||||
var _param = _sliced_to_array(param, 3), ref = (_param[0], _param[1], _sliced_to_array(_param[2], 1)), ref1 = _sliced_to_array(ref[0], 1);
|
||||
ref1[0];
|
||||
|
@ -9,7 +9,7 @@ var A = function() {
|
||||
"use strict";
|
||||
function B(x) {
|
||||
arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
||||
for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)args[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)args[_key - 2] = arguments[_key];
|
||||
_class_call_check(this, B), this.x = "hello", this.y = 10;
|
||||
}
|
||||
return B.prototype.baz = function(z, v) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function() {
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0], arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
||||
for(var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)rest[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)rest[_key - 2] = arguments[_key];
|
||||
})(), function(num) {
|
||||
arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
||||
for(var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)rest[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)rest[_key - 2] = arguments[_key];
|
||||
}(10);
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function() {
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0], arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
||||
for(var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)rest[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)rest[_key - 2] = arguments[_key];
|
||||
})(), function(num) {
|
||||
arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
||||
for(var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)rest[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)rest[_key - 2] = arguments[_key];
|
||||
}(10);
|
||||
|
@ -9,12 +9,12 @@ var C = function() {
|
||||
arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
||||
}, _proto.foo1 = function(x) {
|
||||
arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
||||
for(var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)rest[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)rest[_key - 2] = arguments[_key];
|
||||
}, _proto.bar = function() {
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
||||
}, _proto.boo = function() {
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
||||
for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
}, C;
|
||||
}(), D = function() {
|
||||
"use strict";
|
||||
@ -22,6 +22,6 @@ var C = function() {
|
||||
}, E = function() {
|
||||
"use strict";
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
||||
for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
_class_call_check(this, E);
|
||||
};
|
||||
|
@ -9,12 +9,12 @@ var C = function() {
|
||||
arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
||||
}, _proto.foo1 = function(x) {
|
||||
arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
|
||||
for(var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)rest[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)rest[_key - 2] = arguments[_key];
|
||||
}, _proto.bar = function() {
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
||||
}, _proto.boo = function() {
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
||||
for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
}, C;
|
||||
}(), D = function() {
|
||||
"use strict";
|
||||
@ -22,6 +22,6 @@ var C = function() {
|
||||
}, E = function() {
|
||||
"use strict";
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
||||
for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
_class_call_check(this, E);
|
||||
};
|
||||
|
@ -1,3 +1,3 @@
|
||||
!function() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}();
|
||||
|
@ -1,3 +1,3 @@
|
||||
!function() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}();
|
||||
|
@ -2,25 +2,25 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
var C = function() {
|
||||
"use strict";
|
||||
function C(name) {
|
||||
for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
_class_call_check(this, C);
|
||||
}
|
||||
var _proto = C.prototype;
|
||||
return _proto.bar = function() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}, _proto.foo = function(x) {
|
||||
for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
}, C;
|
||||
}(), D = function() {
|
||||
"use strict";
|
||||
function D() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
_class_call_check(this, D);
|
||||
}
|
||||
var _proto = D.prototype;
|
||||
return _proto.bar = function() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}, _proto.foo = function(x) {
|
||||
for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
}, D;
|
||||
}();
|
||||
|
@ -2,25 +2,25 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
var C = function() {
|
||||
"use strict";
|
||||
function C(name) {
|
||||
for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
_class_call_check(this, C);
|
||||
}
|
||||
var _proto = C.prototype;
|
||||
return _proto.bar = function() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}, _proto.foo = function(x) {
|
||||
for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
}, C;
|
||||
}(), D = function() {
|
||||
"use strict";
|
||||
function D() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
_class_call_check(this, D);
|
||||
}
|
||||
var _proto = D.prototype;
|
||||
return _proto.bar = function() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}, _proto.foo = function(x) {
|
||||
for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)rest[_key - 1] = arguments[_key];
|
||||
}, D;
|
||||
}();
|
||||
|
@ -2,7 +2,7 @@ export function f1() {
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
||||
}
|
||||
export function f2() {
|
||||
for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++)arg[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, arg = Array(_len), _key = 0; _key < _len; _key++)arg[_key] = arguments[_key];
|
||||
}
|
||||
export default function f3() {
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
||||
|
@ -2,7 +2,7 @@ export function f1() {
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
||||
}
|
||||
export function f2() {
|
||||
for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++)arg[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, arg = Array(_len), _key = 0; _key < _len; _key++)arg[_key] = arguments[_key];
|
||||
}
|
||||
export default function f3() {
|
||||
arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
|
||||
|
@ -1,6 +1,6 @@
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
function call(f) {
|
||||
for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)args[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)args[_key - 1] = arguments[_key];
|
||||
return f.apply(void 0, _to_consumable_array(args));
|
||||
}
|
||||
function callr(args, f) {
|
||||
@ -8,7 +8,7 @@ function callr(args, f) {
|
||||
}
|
||||
function bind(f, x) {
|
||||
return function() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
return f.apply(void 0, [
|
||||
x
|
||||
].concat(_to_consumable_array(rest)));
|
||||
|
@ -1,6 +1,6 @@
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
function bar() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
return args;
|
||||
}
|
||||
f1("foo", "abc"), f1("foo", 10, !0), f1.apply(void 0, [
|
||||
|
@ -29,7 +29,7 @@ var Bar = function() {
|
||||
}, FooIterator;
|
||||
}();
|
||||
!function() {
|
||||
for(var _len = arguments.length, _tmp = new Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, _tmp = Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
var __tmp = _to_array(_tmp);
|
||||
__tmp[0], __tmp.slice(1);
|
||||
}(new FooIterator);
|
||||
|
@ -30,7 +30,7 @@ var Bar = function() {
|
||||
}, FooIterator;
|
||||
}();
|
||||
(function() {
|
||||
for(var _len = arguments.length, _tmp = new Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, _tmp = Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
var __tmp = _sliced_to_array(_tmp, 2);
|
||||
__tmp[0], __tmp[1];
|
||||
}).apply(void 0, _to_consumable_array(new FooIterator));
|
||||
|
@ -4,7 +4,7 @@ import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
import _create_super from "@swc/helpers/src/_create_super.mjs";
|
||||
(function() {
|
||||
for(var _len = arguments.length, _tmp = new Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, _tmp = Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
var __tmp = _sliced_to_array(_tmp, 2);
|
||||
__tmp[0], __tmp[1];
|
||||
}).apply(void 0, _to_consumable_array(new FooIteratorIterator));
|
||||
|
@ -29,7 +29,7 @@ var Bar = function() {
|
||||
}, FooIterator;
|
||||
}();
|
||||
!function() {
|
||||
for(var _len = arguments.length, _tmp = new Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, _tmp = Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
var __tmp = _sliced_to_array(_tmp, 2);
|
||||
__tmp[0], __tmp[1];
|
||||
}(new FooIterator);
|
||||
|
@ -32,7 +32,7 @@ var Bar = function() {
|
||||
}, FooArrayIterator;
|
||||
}();
|
||||
(function() {
|
||||
for(var _len = arguments.length, _tmp = new Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, _tmp = Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
var __tmp = _sliced_to_array(_tmp, 2);
|
||||
void 0 === (void 0 === _sliced_to_array(__tmp[0], 1)[0] && new Foo, __tmp[1]) && new Foo;
|
||||
}).apply(void 0, _to_consumable_array(new FooArrayIterator));
|
||||
|
@ -1,6 +1,6 @@
|
||||
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
||||
!function() {
|
||||
for(var _len = arguments.length, _tmp = new Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, _tmp = Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
var __tmp = _sliced_to_array(_tmp, 2), ref = _sliced_to_array(__tmp[0], 2), ref1 = (ref[0], ref[1], _sliced_to_array(__tmp[1], 2));
|
||||
ref1[0], ref1[1];
|
||||
}(new Map([
|
||||
|
@ -1,6 +1,6 @@
|
||||
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
||||
!function() {
|
||||
for(var _len = arguments.length, _tmp = new Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, _tmp = Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
var __tmp = _sliced_to_array(_tmp, 2), ref = _sliced_to_array(__tmp[0], 2), ref1 = (ref[0], ref[1], _sliced_to_array(__tmp[1], 2));
|
||||
ref1[0], ref1[1];
|
||||
}(new Map([
|
||||
|
@ -1,7 +1,7 @@
|
||||
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
(function() {
|
||||
for(var _len = arguments.length, _tmp = new Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, _tmp = Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
var __tmp = _sliced_to_array(_tmp, 2), ref = _sliced_to_array(__tmp[0], 2), ref1 = (ref[0], ref[1], _sliced_to_array(__tmp[1], 2));
|
||||
ref1[0], ref1[1];
|
||||
}).apply(void 0, _to_consumable_array(new Map([
|
||||
|
@ -1,7 +1,7 @@
|
||||
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
(function() {
|
||||
for(var _len = arguments.length, _tmp = new Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, _tmp = Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
var __tmp = _sliced_to_array(_tmp, 2), ref = _sliced_to_array(__tmp[0], 2), ref1 = (ref[0], ref[1], _sliced_to_array(__tmp[1], 2));
|
||||
ref1[0], ref1[1];
|
||||
}).apply(void 0, _to_consumable_array(new Map([
|
||||
|
@ -1,7 +1,7 @@
|
||||
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
(function() {
|
||||
for(var _len = arguments.length, _tmp = new Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, _tmp = Array(_len), _key = 0; _key < _len; _key++)_tmp[_key] = arguments[_key];
|
||||
var __tmp = _sliced_to_array(_tmp, 2), ref = _sliced_to_array(__tmp[0], 2), ref1 = (ref[0], ref[1], _sliced_to_array(__tmp[1], 2));
|
||||
ref1[0], ref1[1];
|
||||
}).apply(void 0, _to_consumable_array(new Map([
|
||||
|
@ -16,6 +16,6 @@ var SymbolIterator = function() {
|
||||
}, SymbolIterator;
|
||||
}();
|
||||
(function() {
|
||||
for(var _len = arguments.length, s = new Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, s = Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
return s[0];
|
||||
}).apply(void 0, _to_consumable_array(new SymbolIterator));
|
||||
|
@ -3,7 +3,7 @@ import _construct from "@swc/helpers/src/_construct.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
var Foo = function() {
|
||||
"use strict";
|
||||
for(var _len = arguments.length, s = new Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, s = Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
_class_call_check(this, Foo);
|
||||
}, SymbolIterator = function() {
|
||||
"use strict";
|
||||
|
@ -16,5 +16,5 @@ var SymbolIterator = function() {
|
||||
}, SymbolIterator;
|
||||
}();
|
||||
(function() {
|
||||
for(var _len = arguments.length, s = new Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, s = Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
}).apply(void 0, _to_consumable_array(new SymbolIterator));
|
||||
|
@ -16,5 +16,5 @@ var SymbolIterator = function() {
|
||||
}, SymbolIterator;
|
||||
}();
|
||||
(function(s1) {
|
||||
for(var _len = arguments.length, s = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)s[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, s = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)s[_key - 1] = arguments[_key];
|
||||
}).apply(void 0, _to_consumable_array(new SymbolIterator));
|
||||
|
@ -30,5 +30,5 @@ var SymbolIterator = function() {
|
||||
}, _StringIterator;
|
||||
}();
|
||||
(function() {
|
||||
for(var _len = arguments.length, s = new Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, s = Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
}).apply(void 0, _to_consumable_array(new SymbolIterator).concat(_to_consumable_array(new _StringIterator)));
|
||||
|
@ -30,5 +30,5 @@ var SymbolIterator = function() {
|
||||
}, _StringIterator;
|
||||
}();
|
||||
(function() {
|
||||
for(var _len = arguments.length, s = new Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, s = Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
}).apply(void 0, _to_consumable_array(new SymbolIterator).concat(_to_consumable_array(new _StringIterator)));
|
||||
|
@ -30,6 +30,6 @@ var SymbolIterator = function() {
|
||||
}, _StringIterator;
|
||||
}();
|
||||
(function() {
|
||||
for(var _len = arguments.length, s = new Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, s = Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
return s[0];
|
||||
}).apply(void 0, _to_consumable_array(new SymbolIterator).concat(_to_consumable_array(new _StringIterator)));
|
||||
|
@ -3,7 +3,7 @@ import _construct from "@swc/helpers/src/_construct.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
var Foo = function() {
|
||||
"use strict";
|
||||
for(var _len = arguments.length, s = new Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, s = Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
_class_call_check(this, Foo);
|
||||
}, SymbolIterator = function() {
|
||||
"use strict";
|
||||
|
@ -3,7 +3,7 @@ import _construct from "@swc/helpers/src/_construct.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
var Foo = function() {
|
||||
"use strict";
|
||||
for(var _len = arguments.length, s = new Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, s = Array(_len), _key = 0; _key < _len; _key++)s[_key] = arguments[_key];
|
||||
_class_call_check(this, Foo);
|
||||
}, SymbolIterator = function() {
|
||||
"use strict";
|
||||
|
@ -1,7 +1,7 @@
|
||||
import _object_spread from "@swc/helpers/src/_object_spread.mjs";
|
||||
import _object_without_properties from "@swc/helpers/src/_object_without_properties.mjs";
|
||||
export function Set() {
|
||||
for(var _len = arguments.length, _$keys = new Array(_len), _key = 0; _key < _len; _key++)_$keys[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, _$keys = Array(_len), _key = 0; _key < _len; _key++)_$keys[_key] = arguments[_key];
|
||||
var result = {};
|
||||
return _$keys.forEach(function(key) {
|
||||
return result[key] = !0;
|
||||
|
@ -3,27 +3,27 @@ import _inherits from "@swc/helpers/src/_inherits.mjs";
|
||||
import _create_super from "@swc/helpers/src/_create_super.mjs";
|
||||
var Private = function() {
|
||||
"use strict";
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
_class_call_check(this, Private);
|
||||
}, Private2 = function() {
|
||||
"use strict";
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
_class_call_check(this, Private2);
|
||||
}, Protected = function() {
|
||||
"use strict";
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
_class_call_check(this, Protected);
|
||||
}, Protected2 = function() {
|
||||
"use strict";
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
_class_call_check(this, Protected2);
|
||||
}, Public = function() {
|
||||
"use strict";
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
_class_call_check(this, Public);
|
||||
}, Public2 = function() {
|
||||
"use strict";
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
_class_call_check(this, Public2);
|
||||
}, C1 = function(_superClass) {
|
||||
"use strict";
|
||||
|
@ -21,7 +21,7 @@ function Tagged(superClass) {
|
||||
_inherits(C, superClass);
|
||||
var _super = _create_super(C);
|
||||
function C() {
|
||||
for(var _this, _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _this, _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
return _class_call_check(this, C), (_this = _super.call.apply(_super, [
|
||||
this
|
||||
].concat(_to_consumable_array(args))))._tag = "hello", _this;
|
||||
|
@ -21,7 +21,7 @@ function Tagged(superClass) {
|
||||
_inherits(C, superClass);
|
||||
var _super = _create_super(C);
|
||||
function C() {
|
||||
for(var _this, _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _this, _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
return _class_call_check(this, C), (_this = _super.call.apply(_super, [
|
||||
this
|
||||
].concat(_to_consumable_array(args))))._tag = "hello", _this;
|
||||
|
@ -2,11 +2,11 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import _construct from "@swc/helpers/src/_construct.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
function f(x, y) {
|
||||
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
}
|
||||
var a, b, c, d, e, g, h, i, B = function(x, y) {
|
||||
"use strict";
|
||||
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
_class_call_check(this, B);
|
||||
};
|
||||
new f(1, 2, "string"), _construct(f, [
|
||||
@ -18,7 +18,7 @@ new f(1, 2, "string"), _construct(f, [
|
||||
].concat(_to_consumable_array(a), [
|
||||
"string"
|
||||
])), _construct(function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}, _to_consumable_array(a).concat(_to_consumable_array(a))), _construct(f, [
|
||||
1,
|
||||
2
|
||||
|
@ -2,11 +2,11 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import _construct from "@swc/helpers/src/_construct.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
function f(x, y) {
|
||||
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
}
|
||||
var a, b, c, d, e, g, h, i, B = function(x, y) {
|
||||
"use strict";
|
||||
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
_class_call_check(this, B);
|
||||
};
|
||||
new f(1, 2, "string"), _construct(f, [
|
||||
@ -18,7 +18,7 @@ new f(1, 2, "string"), _construct(f, [
|
||||
].concat(_to_consumable_array(a), [
|
||||
"string"
|
||||
])), _construct(function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}, _to_consumable_array(a).concat(_to_consumable_array(a))), _construct(f, [
|
||||
1,
|
||||
2
|
||||
|
@ -2,11 +2,11 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
|
||||
import _construct from "@swc/helpers/src/_construct.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
function f(x, y) {
|
||||
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
}
|
||||
var a, b, c, d, e, g, h, i, B = function(x, y) {
|
||||
"use strict";
|
||||
for(var _len = arguments.length, z = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, z = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)z[_key - 2] = arguments[_key];
|
||||
_class_call_check(this, B);
|
||||
};
|
||||
new f(1, 2, "string"), _construct(f, [
|
||||
@ -18,7 +18,7 @@ new f(1, 2, "string"), _construct(f, [
|
||||
].concat(_to_consumable_array(a), [
|
||||
"string"
|
||||
])), _construct(function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}, _to_consumable_array(a).concat(_to_consumable_array(a))), _construct(f, [
|
||||
1,
|
||||
2
|
||||
|
@ -1,5 +1,5 @@
|
||||
function foo() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}
|
||||
foo([
|
||||
"",
|
||||
|
@ -1,5 +1,5 @@
|
||||
function foo() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}
|
||||
foo({
|
||||
x: "",
|
||||
|
@ -1,5 +1,5 @@
|
||||
function fun() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}
|
||||
fun(function(x) {
|
||||
return x(void 0), x;
|
||||
|
@ -18,9 +18,9 @@ test(function(t1, t2) {
|
||||
}), test(function(t1, t2) {
|
||||
t2.test2;
|
||||
}), test(function() {}), test(function(t1) {}), test(function() {
|
||||
for(var _len = arguments.length, ts = new Array(_len), _key = 0; _key < _len; _key++)ts[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, ts = Array(_len), _key = 0; _key < _len; _key++)ts[_key] = arguments[_key];
|
||||
}), testRest(function(t1) {}), testRest(function(t1, t2, t3) {}), testRest(function(t1, t2, t3) {}), testRest(function(t1, t2, t3) {}), testRest(function(t2) {
|
||||
for(var _len = arguments.length, t3 = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)t3[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, t3 = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)t3[_key - 1] = arguments[_key];
|
||||
}), testRest(function(t2) {
|
||||
for(var _len = arguments.length, t3 = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)t3[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, t3 = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)t3[_key - 1] = arguments[_key];
|
||||
});
|
||||
|
@ -63,6 +63,6 @@ function get_fieldFunc() {
|
||||
}
|
||||
function get_fieldFunc2() {
|
||||
return function(a) {
|
||||
for(var _len = arguments.length, b = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)b[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, b = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)b[_key - 1] = arguments[_key];
|
||||
};
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ var _fieldFunc = new WeakMap(), _fieldFunc2 = new WeakMap(), A = function() {
|
||||
}), _class_private_field_init(this, _fieldFunc2, {
|
||||
writable: !0,
|
||||
value: function(a) {
|
||||
for(var _len = arguments.length, b = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)b[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, b = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)b[_key - 1] = arguments[_key];
|
||||
}
|
||||
}), this.x = 1;
|
||||
}
|
||||
|
@ -73,5 +73,5 @@ function method() {
|
||||
this.x = 10;
|
||||
}
|
||||
function method2(a) {
|
||||
for(var _len = arguments.length, b = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)b[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, b = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)b[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ var A = function() {
|
||||
}, _fieldFunc2 = {
|
||||
get: function() {
|
||||
return function(a) {
|
||||
for(var _len = arguments.length, b = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)b[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, b = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)b[_key - 1] = arguments[_key];
|
||||
};
|
||||
},
|
||||
set: void 0
|
||||
|
@ -56,6 +56,6 @@ var A = function() {
|
||||
}, _fieldFunc2 = {
|
||||
writable: !0,
|
||||
value: function(a) {
|
||||
for(var _len = arguments.length, b = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)b[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, b = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)b[_key - 1] = arguments[_key];
|
||||
}
|
||||
};
|
||||
|
@ -71,6 +71,6 @@ function method() {
|
||||
this.x = 10;
|
||||
}
|
||||
function method2(a) {
|
||||
for(var _len = arguments.length, b = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)b[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, b = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)b[_key - 1] = arguments[_key];
|
||||
}
|
||||
AA.x = 1;
|
||||
|
@ -3,13 +3,13 @@ function f0(a, b) {
|
||||
f0(a, b), f1(a, b), f2(a, b);
|
||||
}
|
||||
function f1() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
f0.apply(void 0, _to_consumable_array(args)), f1("abc", "def"), f1.apply(void 0, [
|
||||
"abc"
|
||||
].concat(_to_consumable_array(args))), f1.apply(void 0, _to_consumable_array(args));
|
||||
}
|
||||
function f2() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
f0.apply(void 0, _to_consumable_array(args)), f1("abc", "def"), f1.apply(void 0, [
|
||||
"abc"
|
||||
].concat(_to_consumable_array(args))), f1.apply(void 0, _to_consumable_array(args)), f2("abc", "def"), f2.apply(void 0, [
|
||||
|
@ -4,7 +4,7 @@ var _marked = regeneratorRuntime.mark(function() {
|
||||
return regeneratorRuntime.wrap(function(_ctx) {
|
||||
for(;;)switch(_ctx.prev = _ctx.next){
|
||||
case 0:
|
||||
for(_len = _args.length, strings = new Array(_len), _key = 0; _key < _len; _key++)strings[_key] = _args[_key];
|
||||
for(strings = Array(_len = _args.length), _key = 0; _key < _len; _key++)strings[_key] = _args[_key];
|
||||
for(_iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0, _ctx.prev = 2, _iterator = strings[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)str = _step.value;
|
||||
_ctx.next = 10;
|
||||
break;
|
||||
|
@ -1,63 +1,63 @@
|
||||
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
|
||||
import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
(function(a, b, c) {}).apply(this, _to_consumable_array(t1)), (function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}).apply(this, _to_consumable_array(t1)), (function(a) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key];
|
||||
}).apply(this, _to_consumable_array(t1)), (function(a, b) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key];
|
||||
}).apply(this, _to_consumable_array(t1)), (function(a, b, c) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key];
|
||||
}).apply(this, _to_consumable_array(t1)), f1(function(a, b, c) {}), f1(function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}), f1(function(a) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key];
|
||||
}), f1(function(a, b) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key];
|
||||
}), f1(function(a, b, c) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key];
|
||||
}), (function(a, b, c) {}).apply(this, _to_consumable_array(t2)), (function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}).apply(this, _to_consumable_array(t2)), (function(a) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key];
|
||||
}).apply(this, _to_consumable_array(t2)), (function(a, b) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key];
|
||||
}).apply(this, _to_consumable_array(t2)), (function(a, b, c) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key];
|
||||
}).apply(this, _to_consumable_array(t2)), f2(function(a, b, c) {}), f2(function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}), f2(function(a) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key];
|
||||
}), f2(function(a, b) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key];
|
||||
}), f2(function(a, b, c) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key];
|
||||
}), (function(a, b, c) {}).apply(this, [
|
||||
1
|
||||
].concat(_to_consumable_array(t3))), (function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}).apply(this, [
|
||||
1
|
||||
].concat(_to_consumable_array(t3))), (function(a) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key];
|
||||
}).apply(this, [
|
||||
1
|
||||
].concat(_to_consumable_array(t3))), (function(a, b) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key];
|
||||
}).apply(this, [
|
||||
1
|
||||
].concat(_to_consumable_array(t3))), (function(a, b, c) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key];
|
||||
}).apply(this, [
|
||||
1
|
||||
].concat(_to_consumable_array(t3))), f3(function(a, b, c) {}), f3(function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}), f3(function(a) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)x[_key - 1] = arguments[_key];
|
||||
}), f3(function(a, b) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)x[_key - 2] = arguments[_key];
|
||||
}), f3(function(a, b, c) {
|
||||
for(var _len = arguments.length, x = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++)x[_key - 3] = arguments[_key];
|
||||
}), f5(function() {
|
||||
return "hello";
|
||||
}), f5(function(x, y) {
|
||||
@ -67,7 +67,7 @@ import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
}), f5(function(x, y) {
|
||||
return x + y;
|
||||
}), f5(function() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
return !0;
|
||||
}), pipe(function() {
|
||||
return !0;
|
||||
@ -86,7 +86,7 @@ import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
|
||||
}, function(x) {
|
||||
return "" + x;
|
||||
}), (function(a, b) {}).apply(this, _to_consumable_array(tuple)), function() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}(1, ""), take(function() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
});
|
||||
|
@ -12,7 +12,7 @@ var E, C = function() {
|
||||
}, _proto.charCodeAt = function(index) {
|
||||
return null;
|
||||
}, _proto.concat = function() {
|
||||
for(var _len = arguments.length, strings = new Array(_len), _key = 0; _key < _len; _key++)strings[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, strings = Array(_len), _key = 0; _key < _len; _key++)strings[_key] = arguments[_key];
|
||||
return null;
|
||||
}, _proto.indexOf = function(searchString, position) {
|
||||
return null;
|
||||
|
@ -1,8 +1,8 @@
|
||||
var hello, world, helloOrWorld;
|
||||
function f() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
}
|
||||
function g() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
}
|
||||
f(hello), f(world), f(helloOrWorld), g(hello), g(world), g(helloOrWorld);
|
||||
|
@ -58,7 +58,7 @@ foo1(function(x) {
|
||||
return null;
|
||||
};
|
||||
}), foo10(function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
return x[0];
|
||||
}), foo11(function(x, y) {
|
||||
return x;
|
||||
|
@ -42,7 +42,7 @@ import _create_super from "@swc/helpers/src/_create_super.mjs";
|
||||
return null;
|
||||
};
|
||||
}), foo10(function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
return null;
|
||||
}), foo11(function(x, y) {
|
||||
return null;
|
||||
|
@ -43,7 +43,7 @@ function _templateObject3() {
|
||||
}, data;
|
||||
}
|
||||
function tempTag1() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}
|
||||
tempTag1(_templateObject(), function(x) {
|
||||
return x(void 0), x;
|
||||
|
@ -32,7 +32,7 @@ function _templateObject2() {
|
||||
}, data;
|
||||
}
|
||||
function tempTag2() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}
|
||||
tempTag2(_templateObject(), function(x) {
|
||||
return x(void 0), x;
|
||||
|
@ -8,5 +8,5 @@ function _templateObject() {
|
||||
}, data;
|
||||
}
|
||||
!function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}(_templateObject());
|
||||
|
@ -8,5 +8,5 @@ function _templateObject() {
|
||||
}, data;
|
||||
}
|
||||
!function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}(_templateObject());
|
||||
|
@ -37,5 +37,5 @@ function _templateObject() {
|
||||
}, data;
|
||||
}
|
||||
!function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
}(_templateObject(), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ");
|
||||
|
@ -58,6 +58,6 @@ function _templateObject5() {
|
||||
}, data;
|
||||
}
|
||||
function foo() {
|
||||
for(var _len = arguments.length, stuff = new Array(_len), _key = 0; _key < _len; _key++)stuff[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, stuff = Array(_len), _key = 0; _key < _len; _key++)stuff[_key] = arguments[_key];
|
||||
}
|
||||
foo([]), foo([], 1), foo([], 1, 2), foo([], 1, !0), foo([], 1, "2"), foo([], 1, 2, 3), foo(_templateObject()), foo(_templateObject1(), 1), foo(_templateObject2(), 1, 2), foo(_templateObject3(), 1, !0), foo(_templateObject4(), 1, "2"), foo(_templateObject5(), 1, 2, 3);
|
||||
|
@ -58,6 +58,6 @@ function _templateObject5() {
|
||||
}, data;
|
||||
}
|
||||
function foo() {
|
||||
for(var _len = arguments.length, stuff = new Array(_len), _key = 0; _key < _len; _key++)stuff[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, stuff = Array(_len), _key = 0; _key < _len; _key++)stuff[_key] = arguments[_key];
|
||||
}
|
||||
foo([]), foo([], 1), foo([], 1, 2), foo([], 1, !0), foo([], 1, "2"), foo([], 1, 2, 3), foo(_templateObject()), foo(_templateObject1(), 1), foo(_templateObject2(), 1, 2), foo(_templateObject3(), 1, !0), foo(_templateObject4(), 1, "2"), foo(_templateObject5(), 1, 2, 3);
|
||||
|
@ -18,9 +18,9 @@ function _templateObject1() {
|
||||
}, data;
|
||||
}
|
||||
function foo1() {
|
||||
for(var _len = arguments.length, stuff = new Array(_len), _key = 0; _key < _len; _key++)stuff[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, stuff = Array(_len), _key = 0; _key < _len; _key++)stuff[_key] = arguments[_key];
|
||||
}
|
||||
function foo2() {
|
||||
for(var _len = arguments.length, stuff = new Array(_len), _key = 0; _key < _len; _key++)stuff[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, stuff = Array(_len), _key = 0; _key < _len; _key++)stuff[_key] = arguments[_key];
|
||||
}
|
||||
foo1(_templateObject(), 1), foo1([], 1), foo2(_templateObject1(), 1), foo2([], 1);
|
||||
|
@ -18,9 +18,9 @@ function _templateObject1() {
|
||||
}, data;
|
||||
}
|
||||
function foo1() {
|
||||
for(var _len = arguments.length, stuff = new Array(_len), _key = 0; _key < _len; _key++)stuff[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, stuff = Array(_len), _key = 0; _key < _len; _key++)stuff[_key] = arguments[_key];
|
||||
}
|
||||
function foo2() {
|
||||
for(var _len = arguments.length, stuff = new Array(_len), _key = 0; _key < _len; _key++)stuff[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, stuff = Array(_len), _key = 0; _key < _len; _key++)stuff[_key] = arguments[_key];
|
||||
}
|
||||
foo1(_templateObject(), 1), foo1([], 1), foo2(_templateObject1(), 1), foo2([], 1);
|
||||
|
@ -9,5 +9,5 @@ function _templateObject() {
|
||||
}, data;
|
||||
}
|
||||
!function(x) {
|
||||
for(var _len = arguments.length, ys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)ys[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, ys = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)ys[_key - 1] = arguments[_key];
|
||||
}(_templateObject(), 0);
|
||||
|
@ -9,5 +9,5 @@ function _templateObject() {
|
||||
}, data;
|
||||
}
|
||||
!function(x) {
|
||||
for(var _len = arguments.length, ys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)ys[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, ys = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)ys[_key - 1] = arguments[_key];
|
||||
}(_templateObject(), 0);
|
||||
|
@ -9,5 +9,5 @@ function _templateObject() {
|
||||
}, data;
|
||||
}
|
||||
!function() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}(_templateObject(), function(x) {});
|
||||
|
@ -9,5 +9,5 @@ function _templateObject() {
|
||||
}, data;
|
||||
}
|
||||
!function() {
|
||||
for(var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++)rest[_key] = arguments[_key];
|
||||
}(_templateObject(), function(x) {});
|
||||
|
@ -6,7 +6,7 @@ function fun2(x, y) {
|
||||
return randBool() ? x : y;
|
||||
}
|
||||
function fun3() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
return args[+randBool()];
|
||||
}
|
||||
!function(n1) {
|
||||
|
@ -4,9 +4,9 @@ function concat(t, u) {
|
||||
return _to_consumable_array(t).concat(_to_consumable_array(u));
|
||||
}
|
||||
function curry(f) {
|
||||
for(var _len = arguments.length, _$a = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)_$a[_key - 1] = arguments[_key];
|
||||
for(var _len = arguments.length, _$a = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)_$a[_key - 1] = arguments[_key];
|
||||
return function() {
|
||||
for(var _len = arguments.length, b = new Array(_len), _key = 0; _key < _len; _key++)b[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, b = Array(_len), _key = 0; _key < _len; _key++)b[_key] = arguments[_key];
|
||||
return f.apply(void 0, _to_consumable_array(_$a).concat(_to_consumable_array(b)));
|
||||
};
|
||||
}
|
||||
@ -75,12 +75,12 @@ curry(fn1), curry(fn1, 1), curry(fn1, 1, "abc"), curry(fn1, 1, "abc", !0), curry
|
||||
"y"
|
||||
]);
|
||||
var fn2 = function(x, b) {
|
||||
for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)args[_key - 2] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++)args[_key - 2] = arguments[_key];
|
||||
return 0;
|
||||
};
|
||||
curry(fn2), curry(fn2, 1), curry(fn2, 1, !0), curry(fn2, 1, !0, "abc", "def");
|
||||
var fn3 = function() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
return 0;
|
||||
};
|
||||
function curry2(f, t, u) {
|
||||
@ -88,7 +88,7 @@ function curry2(f, t, u) {
|
||||
}
|
||||
function callApi(method) {
|
||||
return function() {
|
||||
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
|
||||
return method.apply(void 0, _to_consumable_array(args).concat([
|
||||
{}
|
||||
]));
|
||||
@ -138,7 +138,7 @@ curry(fn3), curry(fn3, "abc", "def"), curry.apply(void 0, [
|
||||
return 42;
|
||||
}), call.apply(void 0, _to_consumable_array(sa).concat([
|
||||
function() {
|
||||
for(var _len = arguments.length, x = new Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
for(var _len = arguments.length, x = Array(_len), _key = 0; _key < _len; _key++)x[_key] = arguments[_key];
|
||||
return 42;
|
||||
}
|
||||
])), a.bind("", 1), callApi(getUser), callApi(getOrgUser);
|
||||
|
@ -203,12 +203,12 @@ export default function r(i) {
|
||||
a._cacheHydrated = !0;
|
||||
var f = a.search;
|
||||
a.search = function(d) {
|
||||
for(var g = arguments.length, h = new Array(g > 1 ? g - 1 : 0), i = 1; i < g; i++)h[i - 1] = arguments[i];
|
||||
for(var g = arguments.length, h = Array(g > 1 ? g - 1 : 0), i = 1; i < g; i++)h[i - 1] = arguments[i];
|
||||
var j = d.map(function(a) {
|
||||
var d, e;
|
||||
return c(b({}, a), {
|
||||
params: (d = a.params, e = function(a) {
|
||||
for(var b = arguments.length, c = new Array(b > 1 ? b - 1 : 0), d = 1; d < b; d++)c[d - 1] = arguments[d];
|
||||
for(var b = arguments.length, c = Array(b > 1 ? b - 1 : 0), d = 1; d < b; d++)c[d - 1] = arguments[d];
|
||||
var e = 0;
|
||||
return a.replace(/%s/g, function() {
|
||||
return encodeURIComponent(c[e++]);
|
||||
|
@ -221,9 +221,12 @@ where
|
||||
let pass = add!(
|
||||
pass,
|
||||
Parameters,
|
||||
es2015::parameters(es2015::parameters::Config {
|
||||
ignore_function_length: loose || assumptions.ignore_function_length
|
||||
})
|
||||
es2015::parameters(
|
||||
es2015::parameters::Config {
|
||||
ignore_function_length: loose || assumptions.ignore_function_length
|
||||
},
|
||||
global_mark
|
||||
)
|
||||
);
|
||||
let pass = add!(
|
||||
pass,
|
||||
|
@ -80,7 +80,7 @@ where
|
||||
for_of(c.for_of),
|
||||
// Should come before parameters
|
||||
// See: https://github.com/swc-project/swc/issues/1036
|
||||
parameters(c.parameters),
|
||||
parameters(c.parameters, unresolved_mark),
|
||||
computed_properties(c.computed_props),
|
||||
destructuring(c.destructuring),
|
||||
block_scoping(),
|
||||
|
@ -16,9 +16,10 @@ use swc_trace_macro::swc_trace;
|
||||
use tracing::trace;
|
||||
|
||||
#[tracing::instrument(level = "info", skip_all)]
|
||||
pub fn parameters(c: Config) -> impl 'static + Fold {
|
||||
pub fn parameters(c: Config, unresolved_mark: Mark) -> impl 'static + Fold {
|
||||
as_folder(Params {
|
||||
c,
|
||||
unresolved_mark,
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
@ -28,6 +29,7 @@ struct Params {
|
||||
/// Used to store `this, in case if `arguments` is used and we should
|
||||
/// transform an arrow expression to a function expression.
|
||||
hoister: FnEnvHoister,
|
||||
unresolved_mark: Mark,
|
||||
in_subclass: bool,
|
||||
in_prop: bool,
|
||||
c: Config,
|
||||
@ -298,7 +300,13 @@ impl Params {
|
||||
name: arg.clone().into(),
|
||||
init: Some(Box::new(Expr::New(NewExpr {
|
||||
span,
|
||||
callee: Box::new(quote_ident!("Array").into()),
|
||||
callee: Box::new(
|
||||
quote_ident!(
|
||||
DUMMY_SP.apply_mark(self.unresolved_mark),
|
||||
"Array"
|
||||
)
|
||||
.into(),
|
||||
),
|
||||
args: Some(vec![{
|
||||
// `len` or `len - $i`
|
||||
make_minus_i(&len_ident, true).as_arg()
|
||||
|
@ -114,13 +114,19 @@ test!(
|
||||
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
issue_1948,
|
||||
"
|
||||
const fn2 = (arg1, {opt1, opt2}, arg2, {opt3, opt4}, ...arg3) => {
|
||||
@ -970,7 +976,6 @@ test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
@ -1002,13 +1007,19 @@ for (ref of test.expectation.registers){
|
||||
// destructuring_object_basic
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_object_basic,
|
||||
r#"
|
||||
var coords = [1, 2];
|
||||
@ -1026,13 +1037,19 @@ var x = coords.x,
|
||||
// destructuring_assignment_arrow_function_block
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_assignment_arrow_function_block,
|
||||
r#"
|
||||
() => { [a, b] = [1, 2] }
|
||||
@ -1049,13 +1066,19 @@ test!(
|
||||
// destructuring_non_iterable
|
||||
test_exec!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_non_iterable_exec,
|
||||
r#"
|
||||
expect(
|
||||
@ -1074,13 +1097,19 @@ expect(
|
||||
// destructuring_empty_object_pattern
|
||||
test_exec!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_empty_object_pattern_exec,
|
||||
r#"
|
||||
expect(function () {
|
||||
@ -1093,13 +1122,19 @@ expect(function () {
|
||||
// destructuring_chained
|
||||
test_exec!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_chained_exec,
|
||||
r#"
|
||||
var a, b, c, d;
|
||||
@ -1115,13 +1150,19 @@ expect(d).toBe(4);
|
||||
// destructuring_object_rest_impure_computed_keys
|
||||
test_exec!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
)
|
||||
},
|
||||
destructuring_object_rest_impure_computed_keys_exec,
|
||||
r#"
|
||||
var key, x, y, z;
|
||||
@ -1165,13 +1206,19 @@ expect(order).toEqual(["right", "left"]);
|
||||
// destructuring_issue_5090
|
||||
test_exec!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_issue_5090_exec,
|
||||
r#"
|
||||
const assign = function([...arr], index, value) {
|
||||
@ -1190,13 +1237,19 @@ expect(arr).toEqual([1, 2, 3]);
|
||||
// destructuring_default_precedence
|
||||
test_exec!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_default_precedence_exec,
|
||||
r#"
|
||||
var f0 = function (a, b = a, c = b) {
|
||||
@ -1273,13 +1326,19 @@ expect(f2({a: 1})).toEqual([1, 1, 1]);
|
||||
// destructuring_parameters
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_parameters,
|
||||
r#"
|
||||
function somethingAdvanced({topLeft: {x: x1, y: y1} = {}, bottomRight: {x: x2, y: y2} = {}}, p2, p3){
|
||||
@ -1338,13 +1397,19 @@ console.log(unpackArray(["hello", ", ", "world"], [1, 2, 3]));
|
||||
// destructuring_array_unpack_optimisation
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_array_unpack_optimisation,
|
||||
r#"
|
||||
var [a, b] = [1, 2];
|
||||
@ -1417,13 +1482,19 @@ test!(
|
||||
// We will use constant propagation instead of optimizing in each pass
|
||||
ignore,
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_known_array,
|
||||
r#"
|
||||
var z = [];
|
||||
@ -1441,14 +1512,20 @@ var x = z[0],
|
||||
// destructuring_es7_object_rest
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_es7_object_rest,
|
||||
r#"
|
||||
var z = {};
|
||||
@ -1500,13 +1577,19 @@ expect(oldCourses).toEqual([]);
|
||||
// destructuring_assignment_expression_pattern
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
)
|
||||
},
|
||||
destructuring_assignment_expression_pattern,
|
||||
r#"
|
||||
var z = {};
|
||||
@ -1522,13 +1605,19 @@ var tmp = z.x, y = (tmp === void 0 ? {} : tmp).y;
|
||||
// destructuring_object_advanced
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
)
|
||||
},
|
||||
destructuring_object_advanced,
|
||||
r#"
|
||||
var rect = {};
|
||||
@ -1554,13 +1643,19 @@ var ref = [0, 1, 2, 3, 4, 5, 6],
|
||||
// destructuring_spread
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
)
|
||||
},
|
||||
destructuring_spread,
|
||||
r#"
|
||||
function isSorted([x, y, ...wow]) {
|
||||
@ -1588,13 +1683,19 @@ function isSorted(param) {
|
||||
// destructuring_mixed
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
)
|
||||
},
|
||||
destructuring_mixed,
|
||||
r#"
|
||||
var rect = {};
|
||||
@ -1657,13 +1758,19 @@ ref = f(), a = ref[0], b = ref[1], ref;
|
||||
// destructuring_array
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_array,
|
||||
r#"
|
||||
var [a, [b], [c]] = ["hello", [", ", "junk"], ["world"]];
|
||||
@ -1689,13 +1796,19 @@ var ref1, ref2;
|
||||
// destructuring_assignment_arrow_function_no_block
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_assignment_arrow_function_no_block,
|
||||
r#"
|
||||
() => [a, b] = [1, 2]
|
||||
@ -1710,14 +1823,20 @@ var ref;
|
||||
// destructuring_issue_9834
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
object_rest_spread(Default::default()),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_issue_9834,
|
||||
r#"
|
||||
const input = {};
|
||||
@ -1776,7 +1895,6 @@ test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
@ -1811,7 +1929,6 @@ test!(
|
||||
spread(spread::Config {
|
||||
..Default::default()
|
||||
}),
|
||||
parameters(Default::default()),
|
||||
destructuring(Config { loose: true }),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
@ -1842,13 +1959,19 @@ for(ref in obj){
|
||||
// destructuring_issue_5744
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_issue_5744,
|
||||
r#"
|
||||
if (true) [a, b] = [b, a];
|
||||
@ -1864,13 +1987,19 @@ if (true) ref = [b, a], a = ref[0], b = ref[1], ref;
|
||||
// destructuring_spread_generator
|
||||
test_exec!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
spread(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
spread(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
object_rest_spread(Default::default()),
|
||||
)
|
||||
},
|
||||
destructuring_spread_generator_exec,
|
||||
r#"
|
||||
function* f() {
|
||||
|
@ -20,7 +20,7 @@ fn tr(c: Config) -> impl Fold {
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
parameters(c),
|
||||
parameters(c, unresolved_mark),
|
||||
destructuring(destructuring::Config { loose: false }),
|
||||
block_scoping(),
|
||||
)
|
||||
@ -1556,11 +1556,16 @@ test!(
|
||||
// See https://github.com/swc-project/swc/issues/490
|
||||
ignore,
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
async_to_generator(Default::default()),
|
||||
arrow(),
|
||||
parameters(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
async_to_generator(Default::default()),
|
||||
arrow(),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
)
|
||||
},
|
||||
parameters_rest_async_arrow_functions_1,
|
||||
r#"
|
||||
var concat = async (...arrs) => {
|
||||
@ -1587,11 +1592,16 @@ test!(
|
||||
// See https://github.com/swc-project/swc/issues/490
|
||||
ignore,
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
async_to_generator(Default::default()),
|
||||
arrow(),
|
||||
parameters(Default::default()),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
async_to_generator(Default::default()),
|
||||
arrow(),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
)
|
||||
},
|
||||
parameters_rest_async_arrow_functions_2,
|
||||
r#"
|
||||
var x = async (...rest) => {
|
||||
@ -1623,7 +1633,14 @@ var x = function () {
|
||||
// regression_6057_simple
|
||||
test!(
|
||||
syntax(),
|
||||
|_| parameters(Default::default()),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
)
|
||||
},
|
||||
regression_6057_simple,
|
||||
r#"
|
||||
const a = 'bar';
|
||||
@ -1650,7 +1667,15 @@ function foo() {
|
||||
// parameters_regression_4333
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(parameters(Default::default()), block_scoping(),),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
block_scoping()
|
||||
)
|
||||
},
|
||||
parameters_regression_4333,
|
||||
r#"
|
||||
const args = 'bar';
|
||||
@ -1675,10 +1700,15 @@ function foo() {
|
||||
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default())
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default())
|
||||
)
|
||||
},
|
||||
issue_760,
|
||||
"const initialState = 'foo'
|
||||
export default function reducer(state = initialState, action = {}) {
|
||||
@ -1692,7 +1722,14 @@ export default function reducer(state = initialState, action = {}) {
|
||||
|
||||
test!(
|
||||
syntax(),
|
||||
|_| parameters(Default::default()),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
)
|
||||
},
|
||||
rest_in_top_level_arrow_1,
|
||||
"
|
||||
const arrow = (...args) => {
|
||||
@ -1711,7 +1748,14 @@ test!(
|
||||
|
||||
test!(
|
||||
syntax(),
|
||||
|_| parameters(Default::default()),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
)
|
||||
},
|
||||
rest_in_top_level_arrow_2,
|
||||
"
|
||||
const arrow = () => (...args) => {
|
||||
@ -1730,7 +1774,14 @@ test!(
|
||||
|
||||
test!(
|
||||
syntax(),
|
||||
|_| parameters(Default::default()),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
)
|
||||
},
|
||||
rest_in_top_level_arrow_3,
|
||||
"
|
||||
const arrow = () => (...args) => {
|
||||
@ -1753,7 +1804,14 @@ test!(
|
||||
|
||||
test!(
|
||||
syntax(),
|
||||
|_| parameters(Default::default()),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
)
|
||||
},
|
||||
rest_in_top_level_arrow_4,
|
||||
"
|
||||
const arrow = () => (this, (...args) => {
|
||||
@ -1775,7 +1833,14 @@ test!(
|
||||
|
||||
test!(
|
||||
syntax(),
|
||||
|_| parameters(Default::default()),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
)
|
||||
},
|
||||
rest_in_top_level_arrow_nested_1,
|
||||
"
|
||||
const arrow = (...args) => (this, () => (...args) => {
|
||||
@ -1870,7 +1935,14 @@ constructor() {
|
||||
|
||||
test!(
|
||||
syntax(),
|
||||
|_| parameters(Default::default()),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
)
|
||||
},
|
||||
issue_3471,
|
||||
"
|
||||
class A {
|
||||
@ -1911,7 +1983,14 @@ class A {
|
||||
|
||||
test!(
|
||||
syntax(),
|
||||
|_| parameters(Default::default()),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
)
|
||||
},
|
||||
issue_3569,
|
||||
"
|
||||
export class TableView extends React.Component {
|
||||
@ -2197,3 +2276,24 @@ test_exec!(
|
||||
|
||||
expect(t()).toBe(3);"
|
||||
);
|
||||
|
||||
test!(
|
||||
syntax(),
|
||||
|_| tr(Config {
|
||||
ignore_function_length: true
|
||||
}),
|
||||
issue_5030,
|
||||
r#"
|
||||
let v0 = (Array, Int8Array, ...Int32Array) => (NaN + Infinity) * Int32Array.length;
|
||||
console.log(v0(1, 2, 'hello', true, 7));
|
||||
"#,
|
||||
r#"
|
||||
var v0 = function(Array1, Int8Array) {
|
||||
for(var _len = arguments.length, Int32Array = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
||||
Int32Array[_key - 2] = arguments[_key];
|
||||
}
|
||||
return (NaN + Infinity) * Int32Array.length;
|
||||
};
|
||||
console.log(v0(1, 2, 'hello', true, 7));
|
||||
"#
|
||||
);
|
||||
|
@ -1,4 +1,5 @@
|
||||
use swc_common::chain;
|
||||
use swc_common::{chain, Mark};
|
||||
use swc_ecma_transforms_base::resolver;
|
||||
use swc_ecma_transforms_compat::es2015::{block_scoping, parameters, spread};
|
||||
use swc_ecma_transforms_testing::{test, test_exec};
|
||||
use swc_ecma_visit::Fold;
|
||||
@ -8,7 +9,14 @@ fn syntax() -> ::swc_ecma_parser::Syntax {
|
||||
}
|
||||
|
||||
fn tr() -> impl Fold {
|
||||
chain!(parameters(Default::default()), spread(Default::default()))
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
spread(Default::default())
|
||||
)
|
||||
}
|
||||
|
||||
test!(
|
||||
|
@ -39,10 +39,14 @@ fn syntax() -> Syntax {
|
||||
}
|
||||
|
||||
fn tr() -> impl Fold {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
ParenRemover,
|
||||
arrow(),
|
||||
parameters(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(destructuring::Config { loose: false }),
|
||||
function_name(),
|
||||
async_to_generator(Default::default()),
|
||||
@ -1429,11 +1433,17 @@ function foo() {
|
||||
// regression_4943
|
||||
test!(
|
||||
syntax(),
|
||||
|_| chain!(
|
||||
async_to_generator(Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(destructuring::Config { loose: false }),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
async_to_generator(Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(destructuring::Config { loose: false }),
|
||||
)
|
||||
},
|
||||
regression_4943,
|
||||
r#"
|
||||
"use strict";
|
||||
|
@ -4683,13 +4683,18 @@ console.log(props);
|
||||
// regression_4209
|
||||
test!(
|
||||
syntax(),
|
||||
|t| chain!(
|
||||
classes(Some(t.comments.clone()), Default::default()),
|
||||
parameters(Default::default()),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
common_js(Mark::fresh(Mark::root()), Default::default(), None),
|
||||
),
|
||||
|t| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, false),
|
||||
classes(Some(t.comments.clone()), Default::default()),
|
||||
parameters(Default::default(), unresolved_mark),
|
||||
destructuring(Default::default()),
|
||||
block_scoping(),
|
||||
common_js(Mark::fresh(Mark::root()), Default::default(), None),
|
||||
)
|
||||
},
|
||||
regression_4209,
|
||||
r#"
|
||||
import { copy } from './copyPaste';
|
||||
|
@ -250,7 +250,7 @@ fn es2015_duplicate_keys(b: &mut Bencher) {
|
||||
|
||||
fn es2015_parameters(b: &mut Bencher) {
|
||||
run(b, || {
|
||||
swc_ecma_transforms_compat::es2015::parameters(Default::default())
|
||||
swc_ecma_transforms_compat::es2015::parameters(Default::default(), Default::default())
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -83,14 +83,22 @@ macro_rules! test_with_config {
|
||||
|
||||
test!(
|
||||
Syntax::Typescript(Default::default()),
|
||||
|_| chain!(
|
||||
tr(),
|
||||
parameters(parameters::Config {
|
||||
ignore_function_length: true
|
||||
}),
|
||||
destructuring(destructuring::Config { loose: false }),
|
||||
block_scoping(),
|
||||
),
|
||||
|_| {
|
||||
let unresolved_mark = Mark::new();
|
||||
let top_level_mark = Mark::new();
|
||||
chain!(
|
||||
resolver(unresolved_mark, top_level_mark, true),
|
||||
tr(),
|
||||
parameters(
|
||||
parameters::Config {
|
||||
ignore_function_length: true
|
||||
},
|
||||
unresolved_mark
|
||||
),
|
||||
destructuring(destructuring::Config { loose: false }),
|
||||
block_scoping(),
|
||||
)
|
||||
},
|
||||
fn_len_default_assignment_with_types,
|
||||
"export function transformFileSync(
|
||||
filename: string,
|
||||
|
Loading…
Reference in New Issue
Block a user