_id stringlengths 21 254 | text stringlengths 1 93.7k | metadata dict |
|---|---|---|
TypeScript/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts_0_35 | // @target: es6
class C {
*foo
} | {
"end_byte": 35,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration6_es6.ts"
} |
TypeScript/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts_0_49 | // @target: es6
class C {
public * foo() { }
} | {
"end_byte": 49,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES5iterable.ts_0_777 | // @target: es5
// @downlevelIteration: true
(function () {
var a: any;
var {} = a;
let {} = a;
const {} = a;
var [] = a;
let [] = a;
const [] = a;
var {} = a, [] = a;
let {} = a, [] = a;
const {} = a, [] = a;
var { p1: {}, p2: [] } = a;
let { p1: {}, p2: [] } = a;
... | {
"end_byte": 777,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES5iterable.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyArrayBindingPatternParameter01.ts_0_58 | // @declaration: true
function f([]) {
var x, y, z;
} | {
"end_byte": 58,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyArrayBindingPatternParameter01.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts_0_302 | //@target: ES6
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
next() {
return {
value: new Foo,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
function fun([a, ...b] = new FooIterator) { }
fun(new FooIterator); | {
"end_byte": 302,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/restElementWithInitializer1.ts_0_85 | var a: number[];
var [...x = a] = a; // Error, rest element cannot have initializer
| {
"end_byte": 85,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/restElementWithInitializer1.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts_0_147 | //@target: ES6
function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { }
takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); | {
"end_byte": 147,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern26.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyObjectBindingPatternParameter02.ts_0_61 | // @declaration: true
function f(a, {}) {
var x, y, z;
} | {
"end_byte": 61,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyObjectBindingPatternParameter02.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts_3_897 | Parameter Declaration with generic
interface F { }
class Class implements F {
constructor() { }
}
class SubClass extends Class {
foo: boolean;
constructor() { super(); }
}
class D implements F {
foo: boolean
constructor() { }
}
class SubD extends D {
bar: number
constructor() {
... | {
"end_byte": 897,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringParameterProperties3.ts_3_775 | ass C1<T, U, V> {
constructor(private k: T, private [a, b, c]: [T,U,V]) {
if ((b === undefined && c === undefined) || (this.b === undefined && this.c === undefined)) {
this.a = a || k;
}
}
public getA() {
return this.a
}
public getB() {
return this.b
... | {
"end_byte": 775,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringParameterProperties3.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers04.ts_4_41 | r { "while": while } = { while: 1 } | {
"end_byte": 41,
"start_byte": 4,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers04.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment5SiblingInitializer.ts_0_612 | // @noImplicitAny: true
// To be inferred as `number`
function f1() {
const [a1, b1 = a1] = [1];
const [a2, b2 = 1 + a2] = [1];
}
// To be inferred as `string`
function f2() {
const [a1, b1 = a1] = ['hi'];
const [a2, b2 = a2 + '!'] = ['hi'];
}
// To be inferred as `string | number`
function f3() {
... | {
"end_byte": 612,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment5SiblingInitializer.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns03_ES6.ts_0_81 | // @target: es6
// @declaration: true
var a: any;
({} = {} = a);
([] = [] = a); | {
"end_byte": 81,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns03_ES6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern3.ts_0_89 | var a: string, b: number;
var tuple: [string, number] = ["", 1];
[...[a, b = 0]] = tuple; | {
"end_byte": 89,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern3.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts_3_2104 | @target: es6
/* AssignmentPattern:
* ObjectAssignmentPattern
* ArrayAssignmentPattern
* ArrayAssignmentPattern:
* [Elision<opt> AssignmentRestElementopt ]
* [AssignmentElementList]
* [AssignmentElementList, Elision<opt> AssignmentRestElementopt ]
* AssignmentElementList:
* ... | {
"end_byte": 2104,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts_0_47 | //@target: ES6
var [...a] = { 0: "", 1: true }; | {
"end_byte": 47,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern22.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts_0_284 | //@target: ES6
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
next() {
return {
value: new Foo,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
var a: Bar, b: Bar[];
[a, ...b] = new FooIterator | {
"end_byte": 284,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts_0_500 | //@target: ES6
function fun(...[a, b]: [Bar, Bar][]) { }
fun(...new FooIteratorIterator);
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
next() {
return {
value: new Foo,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
class FooI... | {
"end_byte": 500,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts_3_1370 | V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V,
// S is the type Any, or
var [[a0], [[a1]]] = [] // Error
var [[a2], [[a3]]] = undefined // Error
// V is an array assignment pattern, S is the type Any or an array-like ty... | {
"end_byte": 1370,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts_0_691 | // Missing properties
function f1() {
var { x, y } = {};
var { x = 1, y } = {};
var { x, y = 1 } = {};
var { x = 1, y = 1 } = {};
}
// Missing properties
function f2() {
var x: number, y: number;
({ x, y } = {});
({ x: x = 1, y } = {});
({ x, y: y = 1 } = {});
({ x: x = 1, y: y = 1 ... | {
"end_byte": 691,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern2.ts_0_73 | //@target: ES6
var a: string, b: number;
[...{ 0: a = "", b }] = ["", 1]; | {
"end_byte": 73,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern2.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringReassignsRightHandSide.ts_0_187 | // @target: es5
var foo: any = { foo: 1, bar: 2 };
var bar: any;
// reassignment in destructuring pattern
({ foo, bar } = foo);
// reassignment in subsequent var
var { foo, baz } = foo; | {
"end_byte": 187,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringReassignsRightHandSide.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/restElementWithBindingPattern.ts_0_25 | var [...[a, b]] = [0, 1]; | {
"end_byte": 25,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/restElementWithBindingPattern.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts_0_70 | //@target: ES6
var a: string, b: boolean;
[a, b] = { 0: "", 1: true }; | {
"end_byte": 70,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern23.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES5.ts_0_136 | // @target: es5
// @declaration: true
(function () {
var {};
let {};
const {};
var [];
let [];
const [];
})(); | {
"end_byte": 136,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES5.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts_0_283 | //@target: ES6
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
next() {
return {
value: new Foo,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
var a: Bar, b: string;
[a, b] = new FooIterator; | {
"end_byte": 283,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyArrayBindingPatternParameter04.ts_0_70 | // @declaration: true
function f([] = [1,2,3,4]) {
var x, y, z;
} | {
"end_byte": 70,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyArrayBindingPatternParameter04.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts_0_291 | //@target: ES6
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
next() {
return {
value: new Foo,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
function fun(...[a, b]: Bar[]) { }
fun(new FooIterator); | {
"end_byte": 291,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment3.ts_0_304 | const [a, b = a] = [1]; // ok
const [c, d = c, e = e] = [1]; // error for e = e
const [f, g = f, h = i, i = f] = [1]; // error for h = i
(function ([a, b = a]) { // ok
})([1]);
(function ([c, d = c, e = e]) { // error for e = e
})([1]);
(function ([f, g = f, h = i, i = f]) { // error for h = i
})([1])
| {
"end_byte": 304,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment3.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES6.ts_3_1346 | @target: es6
// If the parameter is a rest parameter, the parameter type is any[]
// A type annotation for a rest parameter must denote an array type.
// RestParameter:
// ... Identifier TypeAnnotation(opt)
type arrayString = Array<String>
type someArray = Array<String> | number[];
type stringOrNumArray = A... | {
"end_byte": 1346,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers01.ts_4_32 | r { while } = { while: 1 } | {
"end_byte": 32,
"start_byte": 4,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers01.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns04_ES5.ts_0_126 | // @target: es5
// @declaration: true
var a: any;
let x, y, z, a1, a2, a3;
({ x, y, z } = {} = a);
([ a1, a2, a3] = [] = a); | {
"end_byte": 126,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns04_ES5.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads2.ts_4_169 | nction foo({ x, y, z }?: { x: string; y: number; z: boolean });
function foo(...rest: any[]) {
}
foo({ x: "", y: 0, z: false });
foo({ x: false, y: 0, z: "" }); | {
"end_byte": 169,
"start_byte": 4,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads2.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts_0_227 | //@target: ES6
class SymbolIterator {
next() {
return {
value: Symbol(),
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
var [a, b] = new SymbolIterator; | {
"end_byte": 227,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringSameNames.ts_0_898 | // Valid cases
let { foo, foo: bar } = { foo: 1 };
({ foo, foo } = { foo: 2 });
({ foo, foo: bar } = { foo: 3 });
({ foo: bar, foo } = { foo: 4 });
({ foo, bar: foo } = { foo: 3, bar: 33 });
({ bar: foo, foo } = { foo: 4, bar: 44 });
({ foo: bar, foo: bar } = { foo: 5 });
({ foo: bar, bar: foo } = { foo: 6, bar: 66 })... | {
"end_byte": 898,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringSameNames.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts_3_3683 | Conformance for emitting ES6
// @target: es6
// A parameter declaration may specify either an identifier or a binding pattern.
// The identifiers specified in parameter declarations and binding patterns
// in a parameter list must be unique within that parameter list.
// If the declaration includes a type annotation... | {
"end_byte": 3683,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts_0_284 | //@target: ES6
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
next() {
return {
value: new Foo,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
function fun([a, ...b]) { }
fun(new FooIterator); | {
"end_byte": 284,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts_0_150 | //@target: ES6
function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { }
takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); | {
"end_byte": 150,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern27.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyObjectBindingPatternParameter03.ts_0_61 | // @declaration: true
function f({}, a) {
var x, y, z;
} | {
"end_byte": 61,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyObjectBindingPatternParameter03.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES6.ts_0_71 | // @target: es6
// @declaration: true
var a: any;
({} = a);
([] = a); | {
"end_byte": 71,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts_3_1389 | If the parameter is a rest parameter, the parameter type is any[]
// A type annotation for a rest parameter must denote an array type.
// RestParameter:
// ... Identifier TypeAnnotation(opt)
type arrayString = Array<String>
type someArray = Array<String> | number[];
type stringOrNumArray = Array<String|Numbe... | {
"end_byte": 1389,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers05.ts_4_26 | r { as } = { as: 1 } | {
"end_byte": 26,
"start_byte": 4,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/objectBindingPatternKeywordIdentifiers05.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts_3_684 | ass C1 {
constructor(private k: number, private [a, b, c]: [number, string, boolean]) {
if ((b === undefined && c === undefined) || (this.b === undefined && this.c === undefined)) {
this.a = a || k;
}
}
public getA() {
return this.a
}
public getB() {
ret... | {
"end_byte": 684,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts_0_288 | //@target: ES6
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
next() {
return {
value: new Foo,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
function fun([a, b]: Bar[]) { }
fun(new FooIterator); | {
"end_byte": 288,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration7ES5iterable.ts_3_264 | @target: es5
// @downlevelIteration: true
interface ISomething {
foo: string,
bar: string
}
function foo({}, {foo, bar}: ISomething) {}
function baz([], {foo, bar}: ISomething) {}
function one([], {}) {}
function two([], [a, b, c]: number[]) {}
| {
"end_byte": 264,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration7ES5iterable.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES5iterable.ts_0_165 | // @target: es5
// @declaration: true
// @downlevelIteration: true
(function () {
var {};
let {};
const {};
var [];
let [];
const [];
})(); | {
"end_byte": 165,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES5iterable.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5iterable.ts_3_1375 | @target: es5
// @downlevelIteration: true
// If the parameter is a rest parameter, the parameter type is any[]
// A type annotation for a rest parameter must denote an array type.
// RestParameter:
// ... Identifier TypeAnnotation(opt)
type arrayString = Array<String>
type someArray = Array<String> | number... | {
"end_byte": 1375,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5iterable.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/nonIterableRestElement1.ts_0_29 | var c = {};
[...c] = ["", 0]; | {
"end_byte": 29,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/nonIterableRestElement1.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5iterable.ts_3_2464 | @downlevelIteration: true
// The type T associated with a destructuring variable declaration is determined as follows:
// If the declaration includes a type annotation, T is that type.
var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" }
var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["h... | {
"end_byte": 2464,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5iterable.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringObjectAssignmentPatternWithNestedSpread.ts_0_142 | // @target: es5, es2015, es2018
// @noTypesAndSymbols: true
let a: any, b: any, c: any = {x: {a: 1, y: 2}}, d: any;
({x: {a, ...b} = d} = c);
| {
"end_byte": 142,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringObjectAssignmentPatternWithNestedSpread.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES6.ts_3_1627 | @target: es6
// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left.
// An expression of type S is considered assignable to an assignment target V if one of the following is true
// V is an object assignment pattern and, for each as... | {
"end_byte": 1627,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts_0_170 | // @lib: es2015
// @target: ES6
function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { }
takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); | {
"end_byte": 170,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts_4_102 | nction foo([x,y,z]?: [string, number, boolean]) {
}
foo(["", 0, false]);
foo([false, 0, ""]); | {
"end_byte": 102,
"start_byte": 4,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES6.ts_3_2455 | @target: es6
// The type T associated with a destructuring variable declaration is determined as follows:
// If the declaration includes a type annotation, T is that type.
var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" }
var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true... | {
"end_byte": 2455,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment4.ts_0_120 | const {
a = 1,
b = 2,
c = b, // ok
d = a, // ok
e = f, // error
f = f // error
} = { } as any;
| {
"end_byte": 120,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment4.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringAssignabilityCheck.ts_0_301 | // @strict: true
const [] = {}; // should be error
const {} = undefined; // error correctly
(([]) => 0)({}); // should be error
(({}) => 0)(undefined); // should be error
function foo({}: undefined) {
return 0
}
function bar([]: {}) {
return 0
}
const { }: undefined = 1
const []: {} = {}
| {
"end_byte": 301,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringAssignabilityCheck.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_4.ts_0_43 | //@target: ES5
var { x } = <any><any>foo(); | {
"end_byte": 43,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_4.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringVoid.ts_0_65 | // @strictNullChecks: false
declare const v: void;
const {} = v;
| {
"end_byte": 65,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringVoid.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts_0_156 | //@target: ES6
function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { }
takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); | {
"end_byte": 156,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern29.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringEvaluationOrder.ts_0_865 | // @target: es5,es2015
// @noTypesAndSymbols: true
// https://github.com/microsoft/TypeScript/issues/39205
let trace: any[] = [];
let order = (n: any): any => trace.push(n);
// order(0) should evaluate before order(1) because the first element is undefined
let [{ [order(1)]: x } = order(0)] = [];
// order(0) should ... | {
"end_byte": 865,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringEvaluationOrder.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment5.ts_0_86 | function a () {
let x: number;
let y: any
({ x, ...y } = ({ } as any));
}
| {
"end_byte": 86,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment5.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES6.ts_0_748 | // @target: es6
(function () {
var a: any;
var {} = a;
let {} = a;
const {} = a;
var [] = a;
let [] = a;
const [] = a;
var {} = a, [] = a;
let {} = a, [] = a;
const {} = a, [] = a;
var { p1: {}, p2: [] } = a;
let { p1: {}, p2: [] } = a;
const { p1: {}, p2: [] } =... | {
"end_byte": 748,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_5.ts_0_34 | //@target: ES5
var { x } = <any>0; | {
"end_byte": 34,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_5.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts_0_304 | //@target: ES6
class Bar { x }
class Foo extends Bar { y }
class FooArrayIterator {
next() {
return {
value: [new Foo],
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
function fun([[a], b]: Bar[][]) { }
fun(new FooArrayIterator); | {
"end_byte": 304,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/optionalBindingParameters4.ts_0_175 | // @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /a.js
/**
* @param {{ cause?: string }} [options]
*/
function foo({ cause } = {}) {
return cause;
}
| {
"end_byte": 175,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/optionalBindingParameters4.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns02_ES5.ts_0_126 | // @target: es5
// @declaration: true
var a: any;
let x, y, z, a1, a2, a3;
({} = { x, y, z } = a);
([] = [ a1, a2, a3] = a); | {
"end_byte": 126,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns02_ES5.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_1.ts_0_38 | //@target: ES5
var { x } = <any>foo(); | {
"end_byte": 38,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_1.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringSpread.ts_0_246 | const { x } = {
...{},
x: 0
};
const { y } = {
y: 0,
...{}
};
const { z, a, b } = {
z: 0,
...{ a: 0, b: 0 }
};
const { c, d, e, f, g } = {
...{
...{
...{
c: 0,
},
d: 0
},
e: 0
},
f: 0
};
| {
"end_byte": 246,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringSpread.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/optionalBindingParameters3.ts_3_187 | @checkJs: true
// @allowJs: true
// @noEmit: true
// @filename: /a.js
/**
* @typedef Foo
* @property {string} a
*/
/**
* @param {Foo} [options]
*/
function f({ a = "a" }) {}
| {
"end_byte": 187,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/optionalBindingParameters3.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES5iterable.ts_0_100 | // @target: es5
// @declaration: true
// @downlevelIteration: true
var a: any;
({} = a);
([] = a); | {
"end_byte": 100,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES5iterable.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment6.ts_0_156 | // @target: es5,esnext
const a = "a";
const b = "b";
const { [a]: aVal, [b]: bVal } = (() => {
return { [a]: 1, [b]: 1 };
})();
console.log(aVal, bVal);
| {
"end_byte": 156,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES5.ts_0_748 | // @target: es5
(function () {
var a: any;
var {} = a;
let {} = a;
const {} = a;
var [] = a;
let [] = a;
const [] = a;
var {} = a, [] = a;
let {} = a, [] = a;
const {} = a, [] = a;
var { p1: {}, p2: [] } = a;
let { p1: {}, p2: [] } = a;
const { p1: {}, p2: [] } =... | {
"end_byte": 748,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES5.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_6.ts_0_40 | //@target: ES5
var { x } = <any>new Foo; | {
"end_byte": 40,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration9.ts_0_1071 | // @strict: true, false
// @noEmit: true
// @allowJs: true
// @checkJs: true
// https://github.com/microsoft/TypeScript/issues/59936
// @filename: index.js
/**
* @param {Object} [config]
* @param {Partial<Record<'json' | 'jsonc' | 'json5', string[]>>} [config.additionalFiles]
*/
export function prepareConfig({
... | {
"end_byte": 1071,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration9.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts_0_286 | //@target: ES6
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
next() {
return {
value: new Foo,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
var a: Bar, b: string;
[a, ...b] = new FooIterator; | {
"end_byte": 286,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts_3_1397 | The type T associated with a destructuring variable declaration is determined as follows:
// If the declaration includes a type annotation, T is that type.
var {a1, a2}: { a1: number, a2: string } = { a1: true, a2: 1 } // Error
var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [[false]], tru... | {
"end_byte": 1397,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns02_ES6.ts_0_126 | // @target: es6
// @declaration: true
var a: any;
let x, y, z, a1, a2, a3;
({} = { x, y, z } = a);
([] = [ a1, a2, a3] = a); | {
"end_byte": 126,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns02_ES6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts_0_947 | // @strict: true
function f1(obj: { a?: string }) {
if (obj.a) {
obj = {};
let a1 = obj["a"]; // string | undefined
let a2 = obj.a; // string | undefined
}
}
function f2(obj: [number, string] | null[]) {
let a0 = obj[0]; // number | null
let a1 = obj[1]; // string | null
... | {
"end_byte": 947,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringControlFlow.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5iterable.ts_3_3755 | @downlevelIteration: true
// A parameter declaration may specify either an identifier or a binding pattern.
// The identifiers specified in parameter declarations and binding patterns
// in a parameter list must be unique within that parameter list.
// If the declaration includes a type annotation, the parameter is o... | {
"end_byte": 3755,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5iterable.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment9SiblingInitializer.ts_0_678 | // @noImplicitAny: true
// To be inferred as `number`
function f1() {
const { a1, b1 = a1 } = { a1: 1 };
const { a2, b2 = 1 + a2 } = { a2: 1 };
}
// To be inferred as `string`
function f2() {
const { a1, b1 = a1 } = { a1: 'hi' };
const { a2, b2 = a2 + '!' } = { a2: 'hi' };
}
// To be inferred as `str... | {
"end_byte": 678,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment9SiblingInitializer.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/nonIterableRestElement3.ts_0_39 | var c = { bogus: 0 };
[...c] = ["", 0]; | {
"end_byte": 39,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/nonIterableRestElement3.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_2.ts_0_40 | //@target: ES5
var { x } = (<any>foo()); | {
"end_byte": 40,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_2.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts_0_276 | //@target: ES6
function fun([a, b] = new FooIterator) { }
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
next() {
return {
value: new Foo,
done: false
};
}
[Symbol.iterator]() {
return this;
}
} | {
"end_byte": 276,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern9.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers.ts_0_1326 | // (arg: { x: any, y: any }) => void
function f1({ x, y }) { }
f1({ x: 1, y: 1 });
// (arg: { x: any, y?: number }) => void
function f2({ x, y = 0 }) { }
f2({ x: 1 });
f2({ x: 1, y: 1 });
// (arg: { x?: number, y?: number }) => void
function f3({ x = 0, y = 0 }) { }
f3({});
f3({ x: 1 });
f3({ y: 1 });
f3({ x: 1, y: 1... | {
"end_byte": 1326,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts_3_218 | Error
var {h?} = { h?: 1 };
var {i}: string | number = { i: 2 };
var {i1}: string | number| {} = { i1: 2 };
var { f2: {f21} = { f212: "string" } }: any = undefined;
var {1} = { 1 };
var {"prop"} = { "prop": 1 };
| {
"end_byte": 218,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment3.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/nonIterableRestElement2.ts_0_44 | //@target: ES6
var c = {};
[...c] = ["", 0]; | {
"end_byte": 44,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/nonIterableRestElement2.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_3.ts_0_40 | //@target: ES5
var { x } = <any>(foo()); | {
"end_byte": 40,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_3.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES5.ts_3_1611 | In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left.
// An expression of type S is considered assignable to an assignment target V if one of the following is true
// V is an object assignment pattern and, for each assignment propert... | {
"end_byte": 1611,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment1ES5.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts_4_139 | nction foo({ x, y, z }?: { x: string; y: number; z: boolean }) {
}
foo({ x: "", y: 0, z: false });
foo({ x: false, y: 0, z: "" }); | {
"end_byte": 139,
"start_byte": 4,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment7.ts_0_169 | // @target: es5,esnext
enum K {
a = "a",
b = "b"
}
const { [K.a]: aVal, [K.b]: bVal } = (() => {
return { [K.a]: 1, [K.b]: 1 };
})();
console.log(aVal, bVal);
| {
"end_byte": 169,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment7.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5.ts_3_2439 | The type T associated with a destructuring variable declaration is determined as follows:
// If the declaration includes a type annotation, T is that type.
var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" }
var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true];
// The type ... | {
"end_byte": 2439,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_7.ts_0_45 | //@target: ES5
var { x } = <any><any>new Foo; | {
"end_byte": 45,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringTypeAssertionsES5_7.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration8.ts_0_388 | // explicit type annotation should cause `method` to have type 'x' | 'y'
// both inside and outside `test`.
function test({
method = 'z',
nested: { p = 'c' }
}: {
method?: 'x' | 'y',
nested?: { p: 'a' | 'b' }
})
{
method
p
}
test({});
test({ method: 'x', nested: { p: 'a' } })
test({ method: 'z'... | {
"end_byte": 388,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration8.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/restElementWithNullInitializer.ts_0_136 | function foo1([...r] = null) {
}
function foo2([...r] = undefined) {
}
function foo3([...r] = {}) {
}
function foo4([...r] = []) {
}
| {
"end_byte": 136,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/restElementWithNullInitializer.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern1.ts_0_67 | //@target: ES6
var a: string, b: number;
[...[a, b = 0]] = ["", 1]; | {
"end_byte": 67,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern1.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts_0_332 | //@target: ES6
class Bar { x }
class Foo extends Bar { y }
class FooArrayIterator {
next() {
return {
value: [new Foo],
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { }
fun(...new FooArr... | {
"end_byte": 332,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns02_ES5iterable.ts_0_155 | // @target: es5
// @declaration: true
// @downlevelIteration: true
var a: any;
let x, y, z, a1, a2, a3;
({} = { x, y, z } = a);
([] = [ a1, a2, a3] = a); | {
"end_byte": 155,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns02_ES5iterable.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts_0_287 | //@target: ES6
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
next() {
return {
value: new Foo,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
function fun(...[a, ...b]) { }
fun(new FooIterator); | {
"end_byte": 287,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES6.ts_0_136 | // @target: es6
// @declaration: true
(function () {
var {};
let {};
const {};
var [];
let [];
const [];
})(); | {
"end_byte": 136,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES6.ts"
} |
TypeScript/tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts_0_288 | //@target: ES6
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
next() {
return {
value: new Foo,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
var a: Bar, b: string[];
[a, ...b] = new FooIterator; | {
"end_byte": 288,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.