_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
TypeScript/tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts_0_255
//@target: ES6 function foo(...s: symbol[]) { } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } foo(...new SymbolIterator);
{ "end_byte": 255, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/spread/iteratorSpreadInCall3.ts" }
TypeScript/tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts_0_428
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } class NumberIterator { next() { return { value: 0, done: false }; } [Sym...
{ "end_byte": 428, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts" }
TypeScript/tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts_0_250
//@target: ES6 function foo(s: symbol) { } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } foo(...new SymbolIterator);
{ "end_byte": 250, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/spread/iteratorSpreadInCall.ts" }
TypeScript/tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts_0_252
//@target: ES6 function foo(s: symbol[]) { } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } foo(...new SymbolIterator);
{ "end_byte": 252, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/spread/iteratorSpreadInCall2.ts" }
TypeScript/tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts_0_242
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } var array = [...[0, 1], ...new SymbolIterator];
{ "end_byte": 242, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/spread/iteratorSpreadInArray3.ts" }
TypeScript/tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts_0_465
//@target: ES6 function foo(...s: (symbol | number)[]) { } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } class _StringIterator { next() { return { value: "", ...
{ "end_byte": 465, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts" }
TypeScript/tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts_0_254
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } var array: symbol[]; array.concat([...new SymbolIterator]);
{ "end_byte": 254, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/spread/iteratorSpreadInArray7.ts" }
TypeScript/tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts_0_484
//@target: ES6 class Foo<T> { constructor(...s: T[]) { } } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } class _StringIterator { next() { return { value: "",...
{ "end_byte": 484, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts" }
TypeScript/tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts_0_65
//@target: ES6 var iter: Iterable<number>; var array = [...iter];
{ "end_byte": 65, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts" }
TypeScript/tests/cases/conformance/es6/propertyAccess/propertyAccessNumericLiterals.es6.ts_0_116
// @target: es6 0xffffffff.toString(); 0o01234.toString(); 0b01101101.toString(); 1234..toString(); 1e0.toString();
{ "end_byte": 116, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/propertyAccess/propertyAccessNumericLiterals.es6.ts" }
TypeScript/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralES6.ts_3_4191
@target: es6 var bin1 = 0b11010; var bin2 = 0B11010; var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; var bin4 = 0B11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
{ "end_byte": 4191, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralES6.ts" }
TypeScript/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralES6.ts_4193_9007
r obj1 = { 0b11010: "Hello", a: bin1, bin1, b: 0b11010, 0B11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
{ "end_byte": 9007, "start_byte": 4193, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralES6.ts" }
TypeScript/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts_3_129
error var bin1 = 0B1102110; var bin1 = 0b11023410; var obj1 = { 0b11010: "hi", 26: "Hello", "26": "world", };
{ "end_byte": 129, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts" }
TypeScript/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteral.ts_3_2498
@target: es5 var oct1 = 0o45436; var oct2 = 0O45436; var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777...
{ "end_byte": 2498, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteral.ts" }
TypeScript/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralES6.ts_3_2498
@target: es6 var oct1 = 0o45436; var oct2 = 0O45436; var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777...
{ "end_byte": 2498, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralES6.ts" }
TypeScript/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts_3_136
error var oct1 = 0O13334823; var oct2 = 0o34318592; var obj1 = { 0O45436: "hi", 19230: "Hello", "19230": "world", };
{ "end_byte": 136, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts" }
TypeScript/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteral.ts_3_4191
@target: es5 var bin1 = 0b11010; var bin2 = 0B11010; var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111; var bin4 = 0B11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
{ "end_byte": 4191, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteral.ts" }
TypeScript/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteral.ts_4193_9007
r obj1 = { 0b11010: "Hello", a: bin1, bin1, b: 0b11010, 0B11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
{ "end_byte": 9007, "start_byte": 4193, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteral.ts" }
TypeScript/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/invalidBinaryIntegerLiteralAndOctalIntegerLiteral.ts_3_98
Error var binary = 0b21010; var binary1 = 0B21010; var octal = 0o81010; var octal = 0O91010;
{ "end_byte": 98, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/invalidBinaryIntegerLiteralAndOctalIntegerLiteral.ts" }
TypeScript/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts_0_42
// @target: es6 var v = { *[foo()]() { } }
{ "end_byte": 42, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments3_es6.ts_0_32
// @target: es6 var v = { *{ } }
{ "end_byte": 32, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments3_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts_0_38
// @target: es6 var v = { *foo() { } }
{ "end_byte": 38, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments4_es6.ts_0_29
// @target: es6 var v = { * }
{ "end_byte": 29, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments4_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts_0_38
// @target: es6 var v = { *<T>() { } }
{ "end_byte": 38, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments2_es6.ts_0_35
// @target: es6 var v = { *() { } }
{ "end_byte": 35, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments2_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts_0_46
// @target: es6 var v = function * yield() { }
{ "end_byte": 46, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration12_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration2_es6.ts_0_37
// @target: es6 function f(yield) { }
{ "end_byte": 37, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration2_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts_0_54
// @target: es6 function * foo(a = yield => yield) { }
{ "end_byte": 54, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts_0_43
// @target: es6 function*foo(a = yield) { }
{ "end_byte": 43, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration4_es6.ts_0_36
// @target: es6 function yield() { }
{ "end_byte": 36, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration4_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts_0_24
var v = { [yield]: foo }
{ "end_byte": 24, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts_0_100
// @target: es6 function * foo() { // Legal to use 'yield' in a type context. var v: yield; }
{ "end_byte": 100, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts_0_36
// @target: es6 function * foo() { }
{ "end_byte": 36, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts_0_38
// @target: es6 function * yield() { }
{ "end_byte": 38, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration3_es6.ts_0_45
// @target: es6 function f(yield = yield) { }
{ "end_byte": 45, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration3_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts_0_130
// @target: es6 function*bar() { // 'yield' here is an identifier, and not a yield expression. function*foo(a = yield) { } }
{ "end_byte": 130, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts_0_39
// @target: es6 function*foo(yield) { }
{ "end_byte": 39, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration5_es6.ts" }
TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts_0_63
// @target: es6 function * foo() { var v = { [yield]: foo } }
{ "end_byte": 63, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModuleES6.ts_0_122
// @target: es6 module m { export var x; } module m { var z = x; var y = { a: x, x }; }
{ "end_byte": 122, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModuleES6.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts_3_197
@lib: es5 var id: number = 10000; var name: string = "my name"; var person = { name, id }; function foo(p: { name: string; id: number }) { } foo(person); var obj = { name: name, id: id };
{ "end_byte": 197, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts_3_565
@lib: es5 // @target: es6 var id: number = 10000; var name: string = "my name"; var person: { name: string; id: number } = { name, id }; function foo(obj: { name: string }): void { }; function bar(name: string, id: number) { return { name, id }; } function bar1(name: string, id: number) { return { name }; } function ...
{ "end_byte": 565, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts_0_56
var x = { x, // OK undefinedVariable // Error }
{ "end_byte": 56, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNoneExistingIdentifier.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts_3_548
@lib: es5 var id: number = 10000; var name: string = "my name"; var person: { name: string; id: number } = { name, id }; function foo( obj:{ name: string }): void { }; function bar(name: string, id: number) { return { name, id }; } function bar1(name: string, id: number) { return { name }; } function baz(name: string...
{ "end_byte": 548, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts_0_154
// module export var x = "Foo"; module m { export var x; } module n { var z = 10000; export var y = { m.x // error }; } m.y.x;
{ "end_byte": 154, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts_3_356
@lib: es5 var id: number = 10000; var name: string = "my name"; var person: { b: string; id: number } = { name, id }; // error var person1: { name, id }; // ok function foo(name: string, id: number): { id: string, name: number } { return { name, id }; } // error function bar(obj: { name: string; id: boolean }) { }...
{ "end_byte": 356, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts_3_437
@lib: es5 var id: number = 10000; var name: string = "my name"; var person: { b: string; id: number } = { name, id }; // error function bar(name: string, id: number): { name: number, id: string } { return { name, id }; } // error function foo(name: string, id: number): { name: string, id: number } { return { name, ...
{ "end_byte": 437, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandProperties.ts_0_147
// @target: es5 var a, b, c; var x1 = { a }; var x2 = { a, } var x3 = { a: 0, b, c, d() { }, x3, parent: x3 };
{ "end_byte": 147, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandProperties.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts_3_169
@lib: es5 var id: number = 10000; var name: string = "my name"; var person = { name, id }; function foo(p: { a: string; id: number }) { } foo(person); // error
{ "end_byte": 169, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesES6.ts_0_147
// @target: es6 var a, b, c; var x1 = { a }; var x2 = { a, } var x3 = { a: 0, b, c, d() { }, x3, parent: x3 };
{ "end_byte": 147, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesES6.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModule.ts_0_123
// module export module m { export var x; } module m { var z = x; var y = { a: x, x }; }
{ "end_byte": 123, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesWithModule.ts" }
TypeScript/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts_0_201
// errors var y = { "stringLiteral", 42, get e, set f, this, super, var, class, typeof }; var x = { a.b, a["ss"], a[1], }; var v = { class }; // error
{ "end_byte": 201, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts" }
TypeScript/tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts_0_576
// @target: es5 const a = new.target; const b = () => new.target; class C { [new.target]() { } c() { return new.target; } get d() { return new.target; } set e(_) { _ = new.target; } f = () => new.target; static [new.target]() { } static g() { return new.target; } static get h() { retur...
{ "end_byte": 576, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/newTarget/invalidNewTarget.es5.ts" }
TypeScript/tests/cases/conformance/es6/newTarget/newTarget.es6.ts_0_567
// @target: es6 class A { constructor() { const a = new.target; const b = () => new.target; } static c = function () { return new.target; } d = function () { return new.target; } } class B extends A { constructor() { super(); const e = new.target; const f = (...
{ "end_byte": 567, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/newTarget/newTarget.es6.ts" }
TypeScript/tests/cases/conformance/es6/newTarget/newTargetNarrowing.ts_0_164
// @target: es6 // @strict: true function foo(x: true) { } function f() { if (new.target.marked === true) { foo(new.target.marked); } } f.marked = true;
{ "end_byte": 164, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/newTarget/newTargetNarrowing.ts" }
TypeScript/tests/cases/conformance/es6/newTarget/newTarget.es5.ts_0_567
// @target: es5 class A { constructor() { const a = new.target; const b = () => new.target; } static c = function () { return new.target; } d = function () { return new.target; } } class B extends A { constructor() { super(); const e = new.target; const f = (...
{ "end_byte": 567, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/newTarget/newTarget.es5.ts" }
TypeScript/tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts_0_576
// @target: es6 const a = new.target; const b = () => new.target; class C { [new.target]() { } c() { return new.target; } get d() { return new.target; } set e(_) { _ = new.target; } f = () => new.target; static [new.target]() { } static g() { return new.target; } static get h() { retur...
{ "end_byte": 576, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty8.ts_0_92
//@target: ES6 interface I { [Symbol.unscopables]: number; [Symbol.toPrimitive](); }
{ "end_byte": 92, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty8.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty19.ts_0_183
//@target: ES6 var i = { [Symbol.iterator]: { p: null }, [Symbol.toStringTag]() { return { p: undefined }; } } var it = i[Symbol.iterator]; var str = i[Symbol.toStringTag]();
{ "end_byte": 183, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty19.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty48.ts_0_96
//@target: ES6 module M { var Symbol; class C { [Symbol.iterator]() { } } }
{ "end_byte": 96, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty48.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty58.ts_0_98
//@target: ES6 interface SymbolConstructor { foo: string; } var obj = { [Symbol.foo]: 0 }
{ "end_byte": 98, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty58.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty29.ts_0_126
//@target: ES6 class C1 { [Symbol.toStringTag]() { return { x: "" }; } [s: symbol]: () => { x: string }; }
{ "end_byte": 126, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty29.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty39.ts_0_238
//@target: ES6 class C { [Symbol.iterator](x: string): string; [Symbol.iterator](x: number): number; [Symbol.iterator](x: any) { return undefined; } [Symbol.iterator](x: any) { return undefined; } }
{ "end_byte": 238, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty39.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolType9.ts_0_118
//@target: ES6 var s = Symbol.for("equal"); s == s; s == true; s != s; 0 != s; s === s; s === 1; s !== s; false !== s;
{ "end_byte": 118, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolType9.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty28.ts_0_162
//@target: ES6 class C1 { [Symbol.toStringTag]() { return { x: "" }; } } class C2 extends C1 { } var c: C2; var obj = c[Symbol.toStringTag]().x;
{ "end_byte": 162, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty28.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty38.ts_0_128
//@target: ES6 interface I { [Symbol.isConcatSpreadable]: string; } interface I { [Symbol.isConcatSpreadable]: string; }
{ "end_byte": 128, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty38.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolType8.ts_0_136
//@target: ES6 var s = Symbol.for("compare"); s < s; s < 0; s > s; s > 0; s <= s; s <= 0; s >= s; s >= 0; 0 >= (s || 0); (s || 0) >= s;
{ "end_byte": 136, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolType8.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty9.ts_0_141
//@target: ES6 class C { [Symbol.iterator]: { x; y }; } interface I { [Symbol.iterator]: { x }; } var i: I; i = new C; var c: C = i;
{ "end_byte": 141, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty9.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty18.ts_0_235
//@target: ES6 var i = { [Symbol.iterator]: 0, [Symbol.toStringTag]() { return "" }, set [Symbol.toPrimitive](p: boolean) { } } var it = i[Symbol.iterator]; var str = i[Symbol.toStringTag](); i[Symbol.toPrimitive] = false;
{ "end_byte": 235, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty18.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty49.ts_0_103
//@target: ES6 module M { export var Symbol; class C { [Symbol.iterator]() { } } }
{ "end_byte": 103, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty49.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty59.ts_0_59
//@target: ES6 interface I { [Symbol.keyFor]: string; }
{ "end_byte": 59, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty59.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty2.ts_0_111
//@target: ES6 var s = Symbol(); var x = { [s]: 0, [s]() { }, get [s]() { return 0; } }
{ "end_byte": 111, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty2.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty13.ts_0_270
//@target: ES6 class C { [Symbol.iterator]: { x; y }; } interface I { [Symbol.iterator]: { x }; } declare function foo(i: I): I; declare function foo(a: any): any; declare function bar(i: C): C; declare function bar(a: any): any; foo(new C); var i: I; bar(i);
{ "end_byte": 270, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty13.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty42.ts_0_181
//@target: ES6 class C { [Symbol.iterator](x: string): string; static [Symbol.iterator](x: number): number; [Symbol.iterator](x: any) { return undefined; } }
{ "end_byte": 181, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty42.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty27.ts_0_160
//@target: ES6 class C1 { [Symbol.toStringTag]() { return {}; } } class C2 extends C1 { [Symbol.toStringTag]() { return ""; } }
{ "end_byte": 160, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty27.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolType15.ts_0_80
//@target: ES6 var sym: symbol; var symObj: Symbol; symObj = sym; sym = symObj;
{ "end_byte": 80, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolType15.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit1.ts_0_81
//@target: ES6 //@declaration: true class C { [Symbol.toPrimitive]: number; }
{ "end_byte": 81, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit1.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolType7.ts_0_93
//@target: ES6 var s = Symbol.for("shift"); s << s; s << 0; s >> s; s >> 0; s >>> s; s >>> 0;
{ "end_byte": 93, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolType7.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty37.ts_0_112
//@target: ES6 interface I { [Symbol.isConcatSpreadable]: string; [Symbol.isConcatSpreadable]: string; }
{ "end_byte": 112, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty37.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty52.ts_0_88
//@target: ES6 var obj = { [Symbol.nonsense]: 0 }; obj = {}; obj[Symbol.nonsense];
{ "end_byte": 88, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty52.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty23.ts_0_153
//@target: ES6 interface I { [Symbol.toPrimitive]: () => boolean; } class C implements I { [Symbol.toPrimitive]() { return true; } }
{ "end_byte": 153, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty23.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty46.ts_0_220
//@target: ES6 class C { get [Symbol.hasInstance]() { return ""; } // Should take a string set [Symbol.hasInstance](x) { } } (new C)[Symbol.hasInstance] = 0; (new C)[Symbol.hasInstance] = "";
{ "end_byte": 220, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty46.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty6.ts_0_175
//@target: ES6 class C { [Symbol.iterator] = 0; [Symbol.unscopables]: number; [Symbol.toPrimitive]() { } get [Symbol.toStringTag]() { return 0; } }
{ "end_byte": 175, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty6.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty17.ts_0_153
//@target: ES6 interface I { [Symbol.iterator]: number; [s: symbol]: string; "__@iterator": string; } var i: I; var it = i[Symbol.iterator];
{ "end_byte": 153, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty17.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit5.ts_0_94
//@target: ES6 //@declaration: true interface I { [Symbol.isConcatSpreadable](): string; }
{ "end_byte": 94, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit5.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolType11.ts_0_97
//@target: ES6 var s = Symbol.for("logical"); s && s; s && []; 0 && s; s || s; s || 1; ({}) || s;
{ "end_byte": 97, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolType11.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit11.ts_0_222
//@target: ES6 //@declaration: true class C { static [Symbol.iterator] = 0; static [Symbol.isConcatSpreadable]() { } static get [Symbol.toPrimitive]() { return ""; } static set [Symbol.toPrimitive](x) { } }
{ "end_byte": 222, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit11.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty56.ts_0_352
//@target: ES6 var obj = { [Symbol.iterator]: 0 }; module M { var Symbol: {}; // The following should be of type 'any'. This is because even though obj has a property keyed by Symbol.iterator, // the key passed in here is the *wrong* Symbol.iterator. It is not the iterator property of the global Symbol...
{ "end_byte": 352, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty56.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolType3.ts_0_185
//@target: ES6 var s = Symbol(); delete Symbol.iterator; void Symbol.toPrimitive; typeof Symbol.toStringTag; ++s; --s; + Symbol(); - Symbol(); ~ Symbol(); ! Symbol(); +(Symbol() || 0);
{ "end_byte": 185, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolType3.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty33.ts_0_150
//@target: ES6 class C1 extends C2 { [Symbol.toStringTag]() { return { x: "" }; } } class C2 { [s: symbol]: () => { x: string }; }
{ "end_byte": 150, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty33.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty22.ts_0_174
//@target: ES6 interface I<T, U> { [Symbol.unscopables](x: T): U; } declare function foo<T, U>(p1: T, p2: I<T, U>): U; foo("", { [Symbol.unscopables]: s => s.length });
{ "end_byte": 174, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty22.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty47.ts_0_228
//@target: ES6 class C { get [Symbol.hasInstance]() { return ""; } // Should take a string set [Symbol.hasInstance](x: number) { } } (new C)[Symbol.hasInstance] = 0; (new C)[Symbol.hasInstance] = "";
{ "end_byte": 228, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty47.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty7.ts_0_138
//@target: ES6 class C { [Symbol()] = 0; [Symbol()]: number; [Symbol()]() { } get [Symbol()]() { return 0; } }
{ "end_byte": 138, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty7.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty16.ts_0_275
//@target: ES6 class C { private [Symbol.iterator]: { x }; } interface I { [Symbol.iterator]: { x }; } declare function foo(i: I): I; declare function foo(a: any): any; declare function bar(i: C): C; declare function bar(a: any): any; foo(new C); var i: I; bar(i);
{ "end_byte": 275, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty16.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit4.ts_0_129
//@target: ES6 //@declaration: true class C { get [Symbol.toPrimitive]() { return ""; } set [Symbol.toPrimitive](x) { } }
{ "end_byte": 129, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit4.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolType10.ts_0_81
//@target: ES6 var s = Symbol.for("bitwise"); s & s; s | s; s ^ s; s & 0; 0 | s;
{ "end_byte": 81, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolType10.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit10.ts_0_145
//@target: ES6 //@declaration: true var obj = { get [Symbol.isConcatSpreadable]() { return '' }, set [Symbol.isConcatSpreadable](x) { } }
{ "end_byte": 145, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolDeclarationEmit10.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty57.ts_0_107
//@target: ES6 var obj = { [Symbol.iterator]: 0 }; // Should give type 'any'. obj[Symbol["nonsense"]];
{ "end_byte": 107, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty57.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolType2.ts_0_73
//@target: ES6 Symbol.isConcatSpreadable in {}; "" in Symbol.toPrimitive;
{ "end_byte": 73, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolType2.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty32.ts_0_150
//@target: ES6 class C1 { [Symbol.toStringTag]() { return { x: "" }; } } class C2 extends C1 { [s: symbol]: () => { x: number }; }
{ "end_byte": 150, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty32.ts" }
TypeScript/tests/cases/conformance/es6/Symbols/symbolProperty3.ts_0_109
//@target: ES6 var s = Symbol; var x = { [s]: 0, [s]() { }, get [s]() { return 0; } }
{ "end_byte": 109, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/conformance/es6/Symbols/symbolProperty3.ts" }