file_path
stringlengths
3
280
file_language
stringclasses
66 values
content
stringlengths
1
1.04M
repo_name
stringlengths
5
92
repo_stars
int64
0
154k
repo_description
stringlengths
0
402
repo_primary_language
stringclasses
108 values
developer_username
stringlengths
1
25
developer_name
stringlengths
0
30
developer_company
stringlengths
0
82
crates/swc_ecma_parser/tests/tsc/intersectionTypeOverloading.ts
TypeScript
// Check that order is preserved in intersection types for purposes of // overload resolution type F = (s: string) => string; type G = (x: any) => any; var fg: F & G; var gf: G & F; var x = fg("abc"); var x: string; var y = gf("abc"); var y: any;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/intersectionTypeReadonly.ts
TypeScript
interface Base { readonly value: number; } interface Identical { readonly value: number; } interface Mutable { value: number; } interface DifferentType { readonly value: string; } interface DifferentName { readonly other: number; } let base: Base; base.value = 12 // error, lhs can't be a readonly pr...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/intersectionWithIndexSignatures.ts
TypeScript
// @strict: true type A = { a: string }; type B = { b: string }; declare let sa1: { x: A & B }; declare let sa2: { x: A } & { x: B }; declare let ta1: { [key: string]: A & B }; declare let ta2: { [key: string]: A } & { [key: string]: B }; ta1 = sa1; ta1 = sa2; ta2 = sa1; ta2 = sa2; declare let sb1: { x: A } & { y: ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/intersectionWithUnionConstraint.ts
TypeScript
// @strict: true function f1<T extends string | number, U extends string | number>(x: T & U) { // Combined constraint of 'T & U' is 'string | number' let y: string | number = x; } function f2<T extends string | number | undefined, U extends string | null | undefined>(x: T & U) { let y1: string | number = ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/intersectionsAndEmptyObjects.ts
TypeScript
// @target: es2015 // @module: commonjs // @esModuleInterop: true // @filename: intersectionsAndEmptyObjects.ts // Empty object type literals are removed from intersections types // that contain other object types type A = { a: number }; type B = { b: string }; type C = {}; let x01: A & B; let x02: A & C; let x03: B...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/intlDateTimeFormatRangeES2021.ts
TypeScript
// @lib: es2021 new Intl.DateTimeFormat().formatRange(new Date(0), new Date()); const [ part ] = new Intl.DateTimeFormat().formatRangeToParts(1000, 1000000000);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/intlNumberFormatES2020.ts
TypeScript
// @target: es2020 // @strict: true // New/updated resolved options in ES2020 const { notation, style, signDisplay } = new Intl.NumberFormat('en-NZ').resolvedOptions(); // Empty options new Intl.NumberFormat('en-NZ', {}); // Override numbering system new Intl.NumberFormat('en-NZ', { numberingSystem: 'arab' }); // C...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/intlNumberFormatES2023.ts
TypeScript
// @target: es2022 // @lib: es2022,es2023.intl // @strict: true // New / updated resolved options in ES2023, including type change for useGrouping const { roundingPriority, roundingMode, roundingIncrement, trailingZeroDisplay, useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions(); // Empty options new Int...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/intlNumberFormatES5UseGrouping.ts
TypeScript
// @target: es5 // @strict: true new Intl.NumberFormat('en-GB', { useGrouping: true }); new Intl.NumberFormat('en-GB', { useGrouping: 'true' }); // expect error new Intl.NumberFormat('en-GB', { useGrouping: 'always' }); // expect error const { useGrouping } = new Intl.NumberFormat('en-GB').resolvedOptions();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/intraExpressionInferences.ts
TypeScript
// @strict: true // @declaration: true // Repros from #47599 declare function callIt<T>(obj: { produce: (n: number) => T, consume: (x: T) => void }): void; callIt({ produce: () => 0, consume: n => n.toFixed() }); callIt({ produce: _a => 0, consume: n => n.toFixed(), }); callIt({ produce...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/intraExpressionInferencesJsx.tsx
TypeScript (TSX)
// @strict: true // @jsx: react-jsx // @noEmit: true /// <reference path="/.lib/react16.d.ts" /> // repro from #52798 type A = { a: boolean; }; type B = { b: string; }; type C = { c: number; }; type Animations = { [key: string]: { value: number } & ( | ({ kind: "a"; func?(): Partial<A> } & A) | ({...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/intrinsicKeyword.ts
TypeScript
// @strict: true let e1: intrinsic; let e2: { intrinsic: intrinsic }; type TE1 = (intrinsic); type TE2<intrinsic> = intrinsic; type TE3<T extends intrinsic> = T; type TE4<intrinsic extends intrinsic> = intrinsic; type TE5<intrinsic extends intrinsic> = (intrinsic); function f1() { let intrinsic: intrinsic.intrins...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/intrinsicTypes.ts
TypeScript
// @strict: true // @declaration: true type TU1 = Uppercase<'hello'>; // "HELLO" type TU2 = Uppercase<'foo' | 'bar'>; // "FOO" | "BAR" type TU3 = Uppercase<string>; // Uppercase<string> type TU4 = Uppercase<any>; // Uppercase<`${any}`> type TU5 = Uppercase<never>; // never type TU6 = Uppercase<42>; // Error typ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidAssignmentsToVoid.ts
TypeScript
var x: void; x = 1; x = true; x = ''; x = {} class C { foo: string; } var c: C; x = C; x = c; interface I { foo: string; } var i: I; x = i; module M { export var x = 1; } x = M; function f<T>(a: T) { x = a; } x = f;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidBooleanAssignments.ts
TypeScript
var x = true; var a: number = x; var b: string = x; var c: void = x; var d: typeof undefined = x; enum E { A } var e: E = x; class C { foo: string } var f: C = x; interface I { bar: string } var g: I = x; var h: { (): string } = x; var h2: { toString(): string } = x; // no error module M { export var a = 1; } M =...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidEnumAssignments.ts
TypeScript
enum E { A, B } enum E2 { A, B } var e: E; var e2: E2; e = E2.A; e2 = E.A; e = <void>null; e = {}; e = ''; function f<T>(a: T) { e = a; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidImportAliasIdentifiers.ts
TypeScript
// none of these should work, since non are actually modules var V = 12; import v = V; class C { name: string; } import c = C; enum E { Red, Blue } import e = E; interface I { id: number; } import i = I;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidInstantiatedModule.ts
TypeScript
module M { export class Point { x: number; y: number } export var Point = 1; // Error } module M2 { export interface Point { x: number; y: number } export var Point = 1; } var m = M2; var p: m.Point; // Error
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidMultipleVariableDeclarations.ts
TypeScript
interface I { id: number; } class C implements I { id: number; valid: boolean; } class C2 extends C { name: string; } class D<T>{ source: T; recurse: D<T>; wrapped: D<D<T>> } function F(x: string): number { return 42; } module M { export class A { name: string; } ex...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidNestedModules.ts
TypeScript
module A.B.C { export class Point { x: number; y: number; } } module A { export module B { export class C { // Error name: string; } } } module M2.X { export class Point { x: number; y: number; } } module M2 { export module X { e...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidNumberAssignments.ts
TypeScript
var x = 1; var a: boolean = x; var b: string = x; var c: void = x; var d: typeof undefined = x; class C { foo: string; } var e: C = x; interface I { bar: string; } var f: I = x; var g: { baz: string } = 1; var g2: { 0: number } = 1; module M { export var x = 1; } M = x; function i<T>(a: T) { a = x; } i = x;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidReturnStatements.ts
TypeScript
// all the following should be error function fn1(): number { } function fn2(): string { } function fn3(): boolean { } function fn4(): Date { } function fn7(): any { } // should be valid: any includes void interface I { id: number } class C implements I { id: number; dispose() {} } class D extends C { n...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidStringAssignments.ts
TypeScript
var x = ''; var a: boolean = x; var b: number = x; var c: void = x; var d: typeof undefined = x; class C { foo: string; } var e: C = x; interface I { bar: string; } var f: I = x; var g: { baz: string } = 1; var g2: { 0: number } = 1; module M { export var x = 1; } M = x; function i<T>(a: T) { a = x; } i = x; ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidSwitchBreakStatement.ts
TypeScript
// break is not allowed in a switch statement switch (12) { case 5: break; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidUndefinedAssignments.ts
TypeScript
var x: typeof undefined; enum E { A } E = x; E.A = x; class C { foo: string } var f: C; C = x; interface I { foo: string } var g: I; g = x; I = x; module M { export var x = 1; } M = x; function i<T>(a: T) { } // BUG 767030 i = x;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidUndefinedValues.ts
TypeScript
var x: typeof undefined; x = 1; x = ''; x = true; var a: void; x = a; x = null; class C { foo: string } var b: C; x = C; x = b; interface I { foo: string } var c: I; x = c; module M { export var x = 1; } x = M; x = { f() { } } function f<T>(a: T) { x = a; } x = f; enum E { A } x = E; x = E.A;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidVoidAssignments.ts
TypeScript
var x: void; var a: boolean = x; var b: string = x; var c: number = x; var d: typeof undefined = x; class C { foo: string; } var e: C = x; interface I { bar: string; } var f: I = x; var g: { baz: string } = 1; var g2: { 0: number } = 1; module M { export var x = 1; } M = x; function i<T>(a: T) { a = x; } i = ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/invalidVoidValues.ts
TypeScript
var x: void; x = 1; x = ''; x = true; enum E { A } x = E; x = E.A; class C { foo: string } var a: C; x = a; interface I { foo: string } var b: I; x = b; x = { f() {} } module M { export var x = 1; } x = M; function f<T>(a: T) { x = a; } x = f;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/isomorphicMappedTypeInference.ts
TypeScript
// @strictNullChecks: true // @noimplicitany: true // @declaration: true type Box<T> = { value: T; } type Boxified<T> = { [P in keyof T]: Box<T[P]>; } function box<T>(x: T): Box<T> { return { value: x }; } function unbox<T>(x: Box<T>): T { return x.value; } function boxify<T>(obj: T): Boxified<T> {...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern1.ts
TypeScript
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } var [a, b] = new SymbolIterator;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern10.ts
TypeScript
//@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);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern11.ts
TypeScript
//@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);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern12.ts
TypeScript
//@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);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern13.ts
TypeScript
//@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);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern14.ts
TypeScript
//@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);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern15.ts
TypeScript
//@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);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern16.ts
TypeScript
//@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...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern17.ts
TypeScript
//@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);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern18.ts
TypeScript
//@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);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern19.ts
TypeScript
//@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);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern2.ts
TypeScript
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } var [a, ...b] = new SymbolIterator;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern20.ts
TypeScript
//@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...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern21.ts
TypeScript
//@target: ES6 var [a, b] = { 0: "", 1: true };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern22.ts
TypeScript
//@target: ES6 var [...a] = { 0: "", 1: true };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern23.ts
TypeScript
//@target: ES6 var a: string, b: boolean; [a, b] = { 0: "", 1: true };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern24.ts
TypeScript
//@target: ES6 var a: string, b: boolean[]; [a, ...b] = { 0: "", 1: true };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern25.ts
TypeScript
//@target: ES6 function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } takeFirstTwoEntries(new Map([["", 0], ["hello", 1]]));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern26.ts
TypeScript
//@target: ES6 function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(new Map([["", 0], ["hello", 1]]));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern27.ts
TypeScript
//@target: ES6 function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]]));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern28.ts
TypeScript
// @lib: es2015 // @target: ES6 function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", true]]));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern29.ts
TypeScript
//@target: ES6 function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", true], ["hello", true]]));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern3.ts
TypeScript
//@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;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern30.ts
TypeScript
//@target: ES6 const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]])
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern4.ts
TypeScript
//@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
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern5.ts
TypeScript
//@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;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern6.ts
TypeScript
//@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;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern7.ts
TypeScript
//@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;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern8.ts
TypeScript
//@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;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableArrayPattern9.ts
TypeScript
//@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; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iterableContextualTyping1.ts
TypeScript
//@target: ES6 var iter: Iterable<(x: string) => number> = [s => s.length];
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInArray.ts
TypeScript
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } var array = [...new SymbolIterator];
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInArray10.ts
TypeScript
//@target: ES6 class SymbolIterator { [Symbol.iterator]() { return this; } } var array = [...new SymbolIterator];
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInArray11.ts
TypeScript
//@target: ES6 var iter: Iterable<number>; var array = [...iter];
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInArray2.ts
TypeScript
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } class NumberIterator { next() { return { value: 0, done: false }; } [Sym...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInArray3.ts
TypeScript
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } var array = [...[0, 1], ...new SymbolIterator];
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInArray4.ts
TypeScript
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } var array = [0, 1, ...new SymbolIterator];
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInArray5.ts
TypeScript
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } var array: number[] = [0, 1, ...new SymbolIterator];
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInArray6.ts
TypeScript
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } var array: number[] = [0, 1]; array.concat([...new SymbolIterator]);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInArray7.ts
TypeScript
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } var array: symbol[]; array.concat([...new SymbolIterator]);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInArray8.ts
TypeScript
//@target: ES6 class SymbolIterator { next() { return { value: Symbol(), done: false }; } } var array = [...new SymbolIterator];
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInArray9.ts
TypeScript
//@target: ES6 class SymbolIterator { next() { return { value: Symbol() }; } [Symbol.iterator]() { return this; } } var array = [...new SymbolIterator];
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall.ts
TypeScript
//@target: ES6 function foo(s: symbol) { } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } foo(...new SymbolIterator);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall10.ts
TypeScript
//@target: ES6 function foo<T>(s: T[]) { return s[0] } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } foo(...new SymbolIterator);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall11.ts
TypeScript
//@target: ES6 function foo<T>(...s: T[]) { return s[0] } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } foo(...new SymbolIterator);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall12.ts
TypeScript
//@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: "",...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall2.ts
TypeScript
//@target: ES6 function foo(s: symbol[]) { } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } foo(...new SymbolIterator);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall3.ts
TypeScript
//@target: ES6 function foo(...s: symbol[]) { } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } foo(...new SymbolIterator);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall4.ts
TypeScript
//@target: ES6 function foo(s1: symbol, ...s: symbol[]) { } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } foo(...new SymbolIterator);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall5.ts
TypeScript
//@target: ES6 function foo(...s: (symbol | string)[]) { } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } class _StringIterator { next() { return { value: "", ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall6.ts
TypeScript
//@target: ES6 function foo(...s: (symbol | number)[]) { } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } class _StringIterator { next() { return { value: "", ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall7.ts
TypeScript
//@target: ES6 function foo<T>(...s: T[]) { return s[0]; } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } class _StringIterator { next() { return { value: "", ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall8.ts
TypeScript
//@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: "",...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/iteratorSpreadInCall9.ts
TypeScript
//@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: "",...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsContainerMergeJsContainer.ts
TypeScript
// @noEmit: true // @allowJs: true // @checkJs: true // #24131 // @Filename: a.js const a = {}; a.d = function() {}; // @Filename: b.js a.d.prototype = {};
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsContainerMergeTsDeclaration.ts
TypeScript
// @allowJs: true // @checkJs: true // @noEmit: true // @Filename: a.js var /*1*/x = function foo() { } x.a = function bar() { } // @Filename: b.ts var x = function () { return 1; }();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsContainerMergeTsDeclaration2.ts
TypeScript
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: a.d.ts declare namespace C { function bar(): void } // @Filename: b.js C.prototype = {}; C.bar = 2;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsContainerMergeTsDeclaration3.ts
TypeScript
// @noEmit: true // @allowJs: true // @checkJs: true // @Filename: a.d.ts declare class A {} // @Filename: b.js const A = { }; A.d = { };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsClassAccessor.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es2019 // @outDir: ./out // @declaration: true // @filename: supplement.d.ts export { }; declare module "./argument.js" { interface Argument { idlType: any; default: null; } } // @filename: base.js export class Base { constructor() { } toJ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsClassExtendsVisibility.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: bar.js class Bar {} module.exports = Bar; // @filename: cls.js const Bar = require("./bar"); const Strings = { a: "A", b: "B" }; class Foo extends Bar {} module.exports = Foo; module.exports.Strings = Strin...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsClassImplementsGenericsSerialization.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: interface.ts export interface Encoder<T> { encode(value: T): Uint8Array } // @filename: lib.js /** * @template T * @implements {IEncoder<T>} */ export class Encoder { /** * @param {T} value */...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsClassLeadingOptional.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: bar.js export class Z { f(x = 1, y) { return [x, y]; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsClassLikeHeuristic.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js // https://github.com/microsoft/TypeScript/issues/35801 let A; A = {}; A.prototype.b = {};
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsClassMethod.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: esnext // @noImplicitAny: true // @declaration: true // @outDir: out // @Filename: jsDeclarationsClassMethod.js function C1() { /** * A comment prop * @param {number} x * @param {number} y * @returns {number} */ this.prop = function (x, y...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsClassStatic.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js class Handler { static get OPTIONS() { return 1; } process() { } } Handler.statische = function() { } const Strings = { a: "A", b: "B" } module.exports = Handler; module.exports.Strings = ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsClassStatic2.ts
TypeScript
// @allowJs: true // @checkJs: true // @declaration: true // @emitDeclarationOnly: true // @outDir: ./out/ // @filename: Foo.js class Base { static foo = ""; } export class Foo extends Base {} Foo.foo = "foo"; // @filename: Bar.ts import { Foo } from "./Foo.js"; class Bar extends Foo {} Bar.foo = "foo";
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsClassStaticMethodAugmentation.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: source.js export class Clazz { static method() { } } Clazz.method.prop = 5;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsClasses.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js export class A {} export class B { static cat = "cat"; } export class C { static Cls = class {} } export class D { /** * @param {number} a * @param {number} b */ construct...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsClassesErr.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @outDir: ./out // @declaration: true // @filename: index.js // Pretty much all of this should be an error, (since index signatures and generics are forbidden in js), // but we should be able to synthesize declarations from the symbols regardless export class M<T>...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsCommonjsRelativePath.ts
TypeScript
// @checkJs: true // @declaration: true // @emitDeclarationOnly: true // @module: commonjs // @Filename: thing.js 'use strict'; class Thing {} module.exports = { Thing } // @Filename: reexport.js 'use strict'; const Thing = require('./thing').Thing module.exports = { Thing }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/jsDeclarationsComputedNames.ts
TypeScript
// @allowJs: true // @checkJs: true // @target: es5 // @lib: es6 // @outDir: ./out // @declaration: true // @filename: index.js const TopLevelSym = Symbol(); const InnerSym = Symbol(); module.exports = { [TopLevelSym](x = 12) { return x; }, items: { [InnerSym]: (arg = {x: 12}) => arg.x }...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University