mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-03 09:19:49 -06:00
Accept new baselines
This commit is contained in:
parent
979bda484c
commit
b7047e852b
@ -0,0 +1,27 @@
|
||||
//// [parameterDestructuringObjectLiteral.ts]
|
||||
// Repro from #22644
|
||||
|
||||
const fn1 = (options: { headers?: {} }) => { };
|
||||
fn1({ headers: { foo: 1 } });
|
||||
|
||||
const fn2 = ({ headers = {} }) => { };
|
||||
fn2({ headers: { foo: 1 } });
|
||||
|
||||
|
||||
//// [parameterDestructuringObjectLiteral.js]
|
||||
// Repro from #22644
|
||||
var fn1 = function (options) { };
|
||||
fn1({ headers: { foo: 1 } });
|
||||
var fn2 = function (_a) {
|
||||
var _b = _a.headers, headers = _b === void 0 ? {} : _b;
|
||||
};
|
||||
fn2({ headers: { foo: 1 } });
|
||||
|
||||
|
||||
//// [parameterDestructuringObjectLiteral.d.ts]
|
||||
declare const fn1: (options: {
|
||||
headers?: {};
|
||||
}) => void;
|
||||
declare const fn2: ({ headers }: {
|
||||
headers?: {};
|
||||
}) => void;
|
||||
@ -0,0 +1,22 @@
|
||||
=== tests/cases/compiler/parameterDestructuringObjectLiteral.ts ===
|
||||
// Repro from #22644
|
||||
|
||||
const fn1 = (options: { headers?: {} }) => { };
|
||||
>fn1 : Symbol(fn1, Decl(parameterDestructuringObjectLiteral.ts, 2, 5))
|
||||
>options : Symbol(options, Decl(parameterDestructuringObjectLiteral.ts, 2, 13))
|
||||
>headers : Symbol(headers, Decl(parameterDestructuringObjectLiteral.ts, 2, 23))
|
||||
|
||||
fn1({ headers: { foo: 1 } });
|
||||
>fn1 : Symbol(fn1, Decl(parameterDestructuringObjectLiteral.ts, 2, 5))
|
||||
>headers : Symbol(headers, Decl(parameterDestructuringObjectLiteral.ts, 3, 5))
|
||||
>foo : Symbol(foo, Decl(parameterDestructuringObjectLiteral.ts, 3, 16))
|
||||
|
||||
const fn2 = ({ headers = {} }) => { };
|
||||
>fn2 : Symbol(fn2, Decl(parameterDestructuringObjectLiteral.ts, 5, 5))
|
||||
>headers : Symbol(headers, Decl(parameterDestructuringObjectLiteral.ts, 5, 14))
|
||||
|
||||
fn2({ headers: { foo: 1 } });
|
||||
>fn2 : Symbol(fn2, Decl(parameterDestructuringObjectLiteral.ts, 5, 5))
|
||||
>headers : Symbol(headers, Decl(parameterDestructuringObjectLiteral.ts, 6, 5))
|
||||
>foo : Symbol(foo, Decl(parameterDestructuringObjectLiteral.ts, 6, 16))
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
=== tests/cases/compiler/parameterDestructuringObjectLiteral.ts ===
|
||||
// Repro from #22644
|
||||
|
||||
const fn1 = (options: { headers?: {} }) => { };
|
||||
>fn1 : (options: { headers?: {}; }) => void
|
||||
>(options: { headers?: {} }) => { } : (options: { headers?: {}; }) => void
|
||||
>options : { headers?: {}; }
|
||||
>headers : {}
|
||||
|
||||
fn1({ headers: { foo: 1 } });
|
||||
>fn1({ headers: { foo: 1 } }) : void
|
||||
>fn1 : (options: { headers?: {}; }) => void
|
||||
>{ headers: { foo: 1 } } : { headers: { foo: number; }; }
|
||||
>headers : { foo: number; }
|
||||
>{ foo: 1 } : { foo: number; }
|
||||
>foo : number
|
||||
>1 : 1
|
||||
|
||||
const fn2 = ({ headers = {} }) => { };
|
||||
>fn2 : ({ headers }: { headers?: {}; }) => void
|
||||
>({ headers = {} }) => { } : ({ headers }: { headers?: {}; }) => void
|
||||
>headers : {}
|
||||
>{} : {}
|
||||
|
||||
fn2({ headers: { foo: 1 } });
|
||||
>fn2({ headers: { foo: 1 } }) : void
|
||||
>fn2 : ({ headers }: { headers?: {}; }) => void
|
||||
>{ headers: { foo: 1 } } : { headers: { foo: number; }; }
|
||||
>headers : { foo: number; }
|
||||
>{ foo: 1 } : { foo: number; }
|
||||
>foo : number
|
||||
>1 : 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user