mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 06:41:59 -06:00
Add test
This commit is contained in:
parent
217f5583c6
commit
8b9afce894
26
tests/baselines/reference/declarationEmit_bindingPatters.js
Normal file
26
tests/baselines/reference/declarationEmit_bindingPatters.js
Normal file
@ -0,0 +1,26 @@
|
||||
//// [declarationEmit_bindingPatters.ts]
|
||||
|
||||
const k = ({x: z = 'y'}) => { }
|
||||
|
||||
var a;
|
||||
function f({} = a, [] = a, { p: {} = a} = a) {
|
||||
}
|
||||
|
||||
//// [declarationEmit_bindingPatters.js]
|
||||
var k = function (_a) {
|
||||
var _b = _a.x, z = _b === void 0 ? 'y' : _b;
|
||||
};
|
||||
var a;
|
||||
function f(_a, _b, _c) {
|
||||
var _a = a;
|
||||
var _b = a;
|
||||
var _d = (_c === void 0 ? a : _c).p, _e = _d === void 0 ? a : _d;
|
||||
}
|
||||
|
||||
|
||||
//// [declarationEmit_bindingPatters.d.ts]
|
||||
declare const k: ({x:z}: {
|
||||
x?: string;
|
||||
}) => void;
|
||||
declare var a: any;
|
||||
declare function f({}?: any, []?: any, {p: {}}?: any): void;
|
||||
@ -0,0 +1,17 @@
|
||||
=== tests/cases/compiler/declarationEmit_bindingPatters.ts ===
|
||||
|
||||
const k = ({x: z = 'y'}) => { }
|
||||
>k : Symbol(k, Decl(declarationEmit_bindingPatters.ts, 1, 5))
|
||||
>x : Symbol(x)
|
||||
>z : Symbol(z, Decl(declarationEmit_bindingPatters.ts, 1, 12))
|
||||
|
||||
var a;
|
||||
>a : Symbol(a, Decl(declarationEmit_bindingPatters.ts, 3, 3))
|
||||
|
||||
function f({} = a, [] = a, { p: {} = a} = a) {
|
||||
>f : Symbol(f, Decl(declarationEmit_bindingPatters.ts, 3, 6))
|
||||
>a : Symbol(a, Decl(declarationEmit_bindingPatters.ts, 3, 3))
|
||||
>a : Symbol(a, Decl(declarationEmit_bindingPatters.ts, 3, 3))
|
||||
>a : Symbol(a, Decl(declarationEmit_bindingPatters.ts, 3, 3))
|
||||
>a : Symbol(a, Decl(declarationEmit_bindingPatters.ts, 3, 3))
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
=== tests/cases/compiler/declarationEmit_bindingPatters.ts ===
|
||||
|
||||
const k = ({x: z = 'y'}) => { }
|
||||
>k : ({x:z}: { x?: string; }) => void
|
||||
>({x: z = 'y'}) => { } : ({x:z}: { x?: string; }) => void
|
||||
>x : any
|
||||
>z : string
|
||||
>'y' : string
|
||||
|
||||
var a;
|
||||
>a : any
|
||||
|
||||
function f({} = a, [] = a, { p: {} = a} = a) {
|
||||
>f : ({}?: any, []?: any, {p:{}}?: any) => void
|
||||
>a : any
|
||||
>a : any
|
||||
>p : any
|
||||
>a : any
|
||||
>a : any
|
||||
}
|
||||
7
tests/cases/compiler/declarationEmit_bindingPatters.ts
Normal file
7
tests/cases/compiler/declarationEmit_bindingPatters.ts
Normal file
@ -0,0 +1,7 @@
|
||||
// @declaration: true
|
||||
|
||||
const k = ({x: z = 'y'}) => { }
|
||||
|
||||
var a;
|
||||
function f({} = a, [] = a, { p: {} = a} = a) {
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user