mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 00:23:10 +03:00
b887b30092
**Description:** This is required for https://github.com/swc-project/swc/pull/6981 and https://github.com/swc-project/swc/pull/6950
21 lines
594 B
TypeScript
21 lines
594 B
TypeScript
// @target:es6
|
|
var f1 = () => { }
|
|
var f2 = (x: string, y: string) => { }
|
|
var f3 = (x: string, y: number, ...rest) => { }
|
|
var f4 = (x: string, y: number, z=10) => { }
|
|
function foo(func: () => boolean) { }
|
|
foo(() => true);
|
|
foo(() => { return false; });
|
|
|
|
// Binding patterns in arrow functions
|
|
var p1 = ([a]) => { };
|
|
var p2 = ([...a]) => { };
|
|
var p3 = ([, a]) => { };
|
|
var p4 = ([, ...a]) => { };
|
|
var p5 = ([a = 1]) => { };
|
|
var p6 = ({ a }) => { };
|
|
var p7 = ({ a: { b } }) => { };
|
|
var p8 = ({ a = 1 }) => { };
|
|
var p9 = ({ a: { b = 1 } = { b: 1 } }) => { };
|
|
var p10 = ([{ value, done }]) => { };
|