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/directReferenceToNull.ts
TypeScript
var x: Null;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/directReferenceToUndefined.ts
TypeScript
var x: Undefined; var y = undefined;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/discriminatedUnionInference.ts
TypeScript
// @strict: true // Repro from #28862 type Foo<A> = { type: "foo", (): A[] }; type Bar<A> = { type: "bar", (): A }; type FooBar<A> = Foo<A> | Bar<A>; type InferA<T> = T extends FooBar<infer A> ? A : never; type FooA = InferA<Foo<number>>; // number // Repro from #28862 type Item<T> = { kind: 'a', data: T } | { kind: 'b', data: T[] }; declare function foo<T>(item: Item<T>): T; let x1 = foo({ kind: 'a', data: 42 }); // number let x2 = foo({ kind: 'b', data: [1, 2] }); // number
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/discriminatedUnionTypes1.ts
TypeScript
interface Square { kind: "square"; size: number; } interface Rectangle { kind: "rectangle"; width: number; height: number; } interface Circle { kind: "circle"; radius: number; } type Shape = Square | Rectangle | Circle; function area1(s: Shape) { if (s.kind === "square") { return s.size * s.size; } else if (s.kind === "circle") { return Math.PI * s.radius * s.radius; } else if (s.kind === "rectangle") { return s.width * s.height; } else { return 0; } } function area2(s: Shape) { switch (s.kind) { case "square": return s.size * s.size; case "rectangle": return s.width * s.height; case "circle": return Math.PI * s.radius * s.radius; } } function assertNever(x: never): never { throw new Error("Unexpected object: " + x); } function area3(s: Shape) { switch (s.kind) { case "square": return s.size * s.size; case "rectangle": return s.width * s.height; case "circle": return Math.PI * s.radius * s.radius; default: return assertNever(s); } } function area4(s: Shape) { switch (s.kind) { case "square": return s.size * s.size; case "rectangle": return s.width * s.height; case "circle": return Math.PI * s.radius * s.radius; } return assertNever(s); } type Message = { kind: "A", x: string } | { kind: "B" | "C", y: number } | { kind: "D" }; function f1(m: Message) { if (m.kind === "A") { m; // { kind: "A", x: string } } else if (m.kind === "D") { m; // { kind: "D" } } else { m; // { kind: "B" | "C", y: number } } } function f2(m: Message) { if (m.kind === "A") { return; } m; // { kind: "B" | "C", y: number } | { kind: "D" } } function f3(m: Message) { if (m.kind === "X") { m; // never } } function f4(m: Message, x: "A" | "D") { if (m.kind == x) { m; // { kind: "A", x: string } | { kind: "D" } } } function f5(m: Message) { switch (m.kind) { case "A": m; // { kind: "A", x: string } break; case "D": m; // { kind: "D" } break; default: m; // { kind: "B" | "C", y: number } } } function f6(m: Message) { switch (m.kind) { case "A": m; // { kind: "A", x: string } case "D": m; // { kind: "A", x: string } | { kind: "D" } break; default: m; // { kind: "B" | "C", y: number } } } function f7(m: Message) { switch (m.kind) { case "A": case "B": return; } m; // { kind: "B" | "C", y: number } | { kind: "D" } } function f8(m: Message) { switch (m.kind) { case "A": return; case "D": throw new Error(); } m; // { kind: "B" | "C", y: number } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/discriminatedUnionTypes2.ts
TypeScript
// @strict: true function f10(x : { kind: false, a: string } | { kind: true, b: string } | { kind: string, c: string }) { if (x.kind === false) { x.a; } else if (x.kind === true) { x.b; } else { x.c; } } function f11(x : { kind: false, a: string } | { kind: true, b: string } | { kind: string, c: string }) { switch (x.kind) { case false: x.a; break; case true: x.b; break; default: x.c; } } function f13(x: { a: null; b: string } | { a: string, c: number }) { x = { a: null, b: "foo", c: 4}; // Error } function f14<T>(x: { a: 0; b: string } | { a: T, c: number }) { if (x.a === 0) { x.b; // Error } } type Result<T> = { error?: undefined, value: T } | { error: Error }; function f15(x: Result<number>) { if (!x.error) { x.value; } else { x.error.message; } } f15({ value: 10 }); f15({ error: new Error("boom") }); // Repro from #24193 interface WithError { error: Error data: null } interface WithoutError<Data> { error: null data: Data } type DataCarrier<Data> = WithError | WithoutError<Data> function f20<Data>(carrier: DataCarrier<Data>) { if (carrier.error === null) { const error: null = carrier.error const data: Data = carrier.data } else { const error: Error = carrier.error const data: null = carrier.data } } // Repro from #28935 type Foo = { tag: true, x: number } | { tag: false, y: number } | { [x: string]: string }; function f30(foo: Foo) { if (foo.tag) { foo; } else { foo; } } function f31(foo: Foo) { if (foo.tag === true) { foo; } else { foo; } } // Repro from #33448 type a = { type: 'a', data: string } type b = { type: 'b', name: string } type c = { type: 'c', other: string } type abc = a | b | c; function f(problem: abc & (b | c)) { if (problem.type === 'b') { problem.name; } else { problem.other; } } type RuntimeValue = | { type: 'number', value: number } | { type: 'string', value: string } | { type: 'boolean', value: boolean }; function foo1(x: RuntimeValue & { type: 'number' }) { if (x.type === 'number') { x.value; // number } else { x.value; // number } } function foo2(x: RuntimeValue & ({ type: 'number' } | { type: 'string' })) { if (x.type === 'number') { x.value; // number } else { x.value; // string } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/discriminatedUnionTypes3.ts
TypeScript
// @strict: true // Repro from #44435 type Correct = { code: string property: true err: undefined } type Err = { err: `${string} is wrong!` } type SomeReturnType = Correct | Err; const example: SomeReturnType = {} as SomeReturnType; if (example.err === undefined) { example.property; // true }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/doWhileBreakStatements.ts
TypeScript
// @allowUnusedLabels: true // @allowUnreachableCode: true do { break; } while(true) ONE: do { break ONE; } while (true) TWO: THREE: do { break THREE; }while (true) FOUR: do { FIVE: do { break FOUR; }while (true) }while (true) do { SIX: do break SIX; while(true) }while (true) SEVEN: do do do break SEVEN; while (true) while (true) while (true) EIGHT: do{ var fn = function () { } break EIGHT; }while(true)
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/doWhileContinueStatements.ts
TypeScript
// @allowUnreachableCode: true do { continue; } while(true) ONE: do { continue ONE; } while (true) TWO: THREE: do { continue THREE; }while (true) FOUR: do { FIVE: do { continue FOUR; }while (true) }while (true) do { SIX: do continue SIX; while(true) }while (true) SEVEN: do do do continue SEVEN; while (true) while (true) while (true) EIGHT: do{ var fn = function () { } continue EIGHT; }while(true)
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/duplicateExportAssignments.ts
TypeScript
// @Filename: foo1.ts var x = 10; var y = 20; export = x; export = y; // @Filename: foo2.ts var x = 10; class y {}; export = x; export = y; // @Filename: foo3.ts module x { export var x = 10; } class y { y: number; } export = x; export = y; // @Filename: foo4.ts export = x; function x(){ return 42; } function y(){ return 42; } export = y; // @Filename: foo5.ts var x = 5; var y = "test"; var z = {}; export = x; export = y; export = z;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/duplicateNumericIndexers.ts
TypeScript
// @skipDefaultLibCheck: false // it is an error to have duplicate index signatures of the same kind in a type interface Number { [x: number]: string; [x: number]: string; } interface String { [x: number]: string; [x: number]: string; } interface Array<T> { [x: number]: T; [x: number]: T; } class C { [x: number]: string; [x: number]: string; } interface I { [x: number]: string; [x: number]: string; } var a: { [x: number]: string; [x: number]: string; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/duplicatePropertiesInTypeAssertions01.ts
TypeScript
// @declaration: true let x = <{a: number; a: number}>{};
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/duplicatePropertiesInTypeAssertions02.ts
TypeScript
// @declaration: true let x = {} as {a: number; a: number};
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/duplicateStringIndexers.ts
TypeScript
// it is an error to have duplicate index signatures of the same kind in a type module test { interface Number { [x: string]: string; [x: string]: string; } interface String { [x: string]: string; [x: string]: string; } interface Array<T> { [x: string]: T; [x: string]: T; } class C { [x: string]: string; [x: string]: string; } interface I { [x: string]: string; [x: string]: string; } var a: { [x: string]: string; [x: string]: string; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/elementAccessChain.2.ts
TypeScript
// @strict: false declare const o1: undefined | { b: string }; o1?.["b"]; declare const o2: undefined | { b: { c: string } }; o2?.["b"].c; o2?.b["c"]; declare const o3: { b: undefined | { c: string } }; o3["b"]?.c; o3.b?.["c"];
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/elementAccessChain.3.ts
TypeScript
// @strict: true declare const obj: any; obj?.["a"]++; obj?.a["b"]++; obj?.["a"]--; obj?.a["b"]--; ++obj?.["a"]; ++obj?.a["b"]; --obj?.["a"]; --obj?.a["b"]; obj?.["a"] = 1; obj?.a["b"] = 1; obj?.["a"] += 1; obj?.a["b"] += 1; for (obj?.["a"] in {}); for (obj?.a["b"] in {}); for (obj?.["a"] of []); for (obj?.a["b"] of []); ({ a: obj?.["a"] } = { a: 1 }); ({ a: obj?.a["b"] } = { a: 1 }); ({ ...obj?.["a"] } = { a: 1 }); ({ ...obj?.a["b"] } = { a: 1 }); [...obj?.["a"]] = []; [...obj?.a["b"]] = [];
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/elementAccessChain.ts
TypeScript
// @strict: true declare const o1: undefined | { b: string }; o1?.["b"]; declare const o2: undefined | { b: { c: string } }; o2?.["b"].c; o2?.b["c"]; declare const o3: { b: undefined | { c: string } }; o3["b"]?.c; o3.b?.["c"]; declare const o4: { b?: { c: { d?: { e: string } } } }; o4.b?.["c"].d?.e; o4.b?.["c"].d?.["e"]; declare const o5: { b?(): { c: { d?: { e: string } } } }; o5.b?.()["c"].d?.e; o5.b?.()["c"].d?.["e"]; o5["b"]?.()["c"].d?.e; o5["b"]?.()["c"].d?.["e"]; // GH#33744 declare const o6: <T>() => undefined | ({ x: number }); o6<number>()?.["x"]; // GH#36031 o2?.["b"]!.c; o2?.["b"]!["c"]; o2?.["b"]!.c!; o2?.["b"]!["c"]!;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunction.ts
TypeScript
// @target:es5 var f1 = () => { } var f2 = (x: string, y: string) => { } var f3 = (x: string, y: number, ...rest) => { } var f4 = (x: string, y: number, z = 10) => { } function foo(func: () => boolean) { } foo(() => true); foo(() => { return false; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionAsIs.ts
TypeScript
// @target:ES5 var arrow1 = a => { }; var arrow2 = (a) => { }; var arrow3 = (a, b) => { };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionAsIsES6.ts
TypeScript
// @target:ES6 var arrow1 = a => { }; var arrow2 = (a) => { }; var arrow3 = (a, b) => { };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionES6.ts
TypeScript
// @target:es6 var f1 = () => { } var f2 = (x: string, y: string) => { } var f3 = (x: string, y: number, ...rest) => { } var f4 = (x: string, y: number, z=10) => { } function foo(func: () => boolean) { } foo(() => true); foo(() => { return false; }); // Binding patterns in arrow functions var p1 = ([a]) => { }; var p2 = ([...a]) => { }; var p3 = ([, a]) => { }; var p4 = ([, ...a]) => { }; var p5 = ([a = 1]) => { }; var p6 = ({ a }) => { }; var p7 = ({ a: { b } }) => { }; var p8 = ({ a = 1 }) => { }; var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; var p10 = ([{ value, done }]) => { };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionThisCapturing.ts
TypeScript
// @target:es5 var f1 = () => { this.age = 10 }; var f2 = (x: string) => { this.name = x } function foo(func: () => boolean) { } foo(() => { this.age = 100; return true; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionThisCapturingES6.ts
TypeScript
// @target:es6 var f1 = () => { this.age = 10 }; var f2 = (x: string) => { this.name = x } function foo(func: () => boolean){ } foo(() => { this.age = 100; return true; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments01.ts
TypeScript
// @target: es5 var a = () => { var arg = arguments[0]; // error } var b = function () { var a = () => { var arg = arguments[0]; // error } } function baz() { () => { var arg = arguments[0]; } } function foo(inputFunc: () => void) { } foo(() => { var arg = arguments[0]; // error }); function bar() { var arg = arguments[0]; // no error } () => { function foo() { var arg = arguments[0]; // no error } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments01_ES6.ts
TypeScript
// @target: es6 var a = () => { var arg = arguments[0]; // error } var b = function () { var a = () => { var arg = arguments[0]; // error } } function baz() { () => { var arg = arguments[0]; } } function foo(inputFunc: () => void) { } foo(() => { var arg = arguments[0]; // error }); function bar() { var arg = arguments[0]; // no error } () => { function foo() { var arg = arguments[0]; // no error } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments02.ts
TypeScript
// @target: es5 var a = () => arguments;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments02_ES6.ts
TypeScript
// @target: es6 var a = () => arguments;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments03.ts
TypeScript
// @target: es5 var arguments; var a = () => arguments;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments03_ES6.ts
TypeScript
// @target: es6 var arguments; var a = () => arguments;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments04.ts
TypeScript
// @target: es5 function f() { var arguments; var a = () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments04_ES6.ts
TypeScript
// @target: es6 function f() { var arguments; var a = () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments05.ts
TypeScript
// @target: es5 function f(arguments) { var a = () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments05_ES6.ts
TypeScript
// @target: es6 function f(arguments) { var a = () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments06.ts
TypeScript
// @target: es5 function f(arguments) { var a = () => () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments06_ES6.ts
TypeScript
// @target: es6 function f(arguments) { var a = () => () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments07.ts
TypeScript
// @target: es5 function f(arguments) { var a = (arguments) => () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments07_ES6.ts
TypeScript
// @target: es6 function f(arguments) { var a = (arguments) => () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments08.ts
TypeScript
// @target: es5 function f(arguments) { var a = () => (arguments) => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments08_ES6.ts
TypeScript
// @target: es6 function f(arguments) { var a = () => (arguments) => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments09.ts
TypeScript
// @target: es5 function f(_arguments) { var a = () => () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments09_ES6.ts
TypeScript
// @target: es6 function f(_arguments) { var a = () => () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments10.ts
TypeScript
// @target: es5 function f() { var _arguments = 10; var a = () => () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments10_ES6.ts
TypeScript
// @target: es6 function f() { var _arguments = 10; var a = () => () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments11.ts
TypeScript
// @target: es5 function f(arguments) { var _arguments = 10; var a = () => () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments11_ES6.ts
TypeScript
// @target: es6 function f(arguments) { var _arguments = 10; var a = () => () => arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments13.ts
TypeScript
// @target: es5 function f() { var _arguments = 10; var a = (arguments) => () => _arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments13_ES6.ts
TypeScript
// @target: es6 function f() { var _arguments = 10; var a = (arguments) => () => _arguments; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments14.ts
TypeScript
// @target: es5 function f() { if (Math.random()) { const arguments = 100; return () => arguments; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments14_ES6.ts
TypeScript
// @target: es6 function f() { if (Math.random()) { let arguments = 100; return () => arguments; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments15.ts
TypeScript
// @target: es5 function f() { var arguments = "hello"; if (Math.random()) { const arguments = 100; return () => arguments; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments15_ES6.ts
TypeScript
// @target: es6 function f() { var arguments = "hello"; if (Math.random()) { const arguments = 100; return () => arguments; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments16.ts
TypeScript
// @target: es5 function f() { var arguments = "hello"; if (Math.random()) { return () => arguments[0]; } var arguments = "world"; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments16_ES6.ts
TypeScript
// @target: es6 function f() { var arguments = "hello"; if (Math.random()) { return () => arguments[0]; } var arguments = "world"; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments17.ts
TypeScript
// @target: es5 function f() { var { arguments } = { arguments: "hello" }; if (Math.random()) { return () => arguments[0]; } var arguments = "world"; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments17_ES6.ts
TypeScript
// @target: es6 function f() { var { arguments } = { arguments: "hello" }; if (Math.random()) { return () => arguments[0]; } var arguments = "world"; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments18.ts
TypeScript
// @target: es5 function f() { var { arguments: args } = { arguments }; if (Math.random()) { return () => arguments; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments18_ES6.ts
TypeScript
// @target: es6 function f() { var { arguments: args } = { arguments }; if (Math.random()) { return () => arguments; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments19.ts
TypeScript
// @target: es5 function f() { function g() { var _arguments = 10; // No capture in 'g', so no conflict. function h() { var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' foo(_arguments); // Error as this does not resolve to the user defined '_arguments' } } function foo(x: any) { return 100; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionWhenUsingArguments19_ES6.ts
TypeScript
// @target: es6 function f() { function g() { var _arguments = 10; // No capture in 'g', so no conflict. function h() { var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h' foo(_arguments); // Error as this does not resolve to the user defined '_arguments' } } function foo(x: any) { return 100; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionsAsIs.ts
TypeScript
// @target:ES5 var arrow1 = a => { }; var arrow2 = (a) => { }; var arrow3 = (a, b) => { };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitArrowFunctionsAsIsES6.ts
TypeScript
// @target:ES6 var arrow1 = a => { }; var arrow2 = (a) => { }; var arrow3 = (a, b) => { };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationOverloadInES6.ts
TypeScript
// @target: es6 class C { constructor(y: any) constructor(x: number) { } } class D { constructor(y: any) constructor(x: number, z="hello") {} }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithConstructorInES6.ts
TypeScript
// @target: es6 class A { y: number; constructor(x: number) { } foo(a: any); foo() { } } class B { y: number; x: string = "hello"; _bar: string; constructor(x: number, z = "hello", ...args) { this.y = 10; } baz(...args): string; baz(z: string, v: number): string { return this._bar; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithExtensionAndTypeArgumentInES6.ts
TypeScript
// @target: es6 class B<T> { constructor(a: T) { } } class C extends B<string> { } class D extends B<number> { constructor(a: any) constructor(b: number) { super(b); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithExtensionInES6.ts
TypeScript
// @target: es6 class B { baz(a: string, y = 10) { } } class C extends B { foo() { } baz(a: string, y:number) { super.baz(a, y); } } class D extends C { constructor() { super(); } foo() { super.foo(); } baz() { super.baz("hello", 10); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithGetterSetterInES6.ts
TypeScript
// @target:es6 class C { _name: string; get name(): string { return this._name; } static get name2(): string { return "BYE"; } static get ["computedname"]() { return ""; } get ["computedname1"]() { return ""; } get ["computedname2"]() { return ""; } set ["computedname3"](x: any) { } set ["computedname4"](y: string) { } set foo(a: string) { } static set bar(b: number) { } static set ["computedname"](b: string) { } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithLiteralPropertyNameInES6.ts
TypeScript
// @target: es6 class B { "hello" = 10; 0b110 = "world"; 0o23534 = "WORLD"; 20 = "twenty"; "foo"() { } 0b1110() {} 11() { } interface() { } static "hi" = 10000; static 22 = "twenty-two"; static 0b101 = "binary"; static 0o3235 = "octal"; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithMethodInES6.ts
TypeScript
// @target:es6 class D { _bar: string; foo() { } ["computedName1"]() { } ["computedName2"](a: string) { } ["computedName3"](a: string): number { return 1; } bar(): string { return this._bar; } baz(a: any, x: string): string { return "HELLO"; } static ["computedname4"]() { } static ["computedname5"](a: string) { } static ["computedname6"](a: string): boolean { return true; } static staticMethod() { var x = 1 + 2; return x } static foo(a: string) { } static bar(a: string): number { return 1; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithPropertyAccessInHeritageClause1.ts
TypeScript
class B {} function foo() { return {B: B}; } class C extends (foo()).B {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithPropertyAssignmentInES6.ts
TypeScript
// @target:es6 class C { x: string = "Hello world"; } class D { x: string = "Hello world"; y: number; constructor() { this.y = 10; } } class E extends D{ z: boolean = true; } class F extends D{ z: boolean = true; j: string; constructor() { super(); this.j = "HI"; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithStaticPropertyAssignmentInES6.ts
TypeScript
// @target:es6 class C { static z: string = "Foo"; } class D { x = 20000; static b = true; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithSuperMethodCall01.ts
TypeScript
//@target: es6 class Parent { foo() { } } class Foo extends Parent { foo() { var x = () => super.foo(); } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithThisKeywordInES6.ts
TypeScript
// @target: es6 class B { x = 10; constructor() { this.x = 10; } static log(a: number) { } foo() { B.log(this.x); } get X() { return this.x; } set bX(y: number) { this.x = y; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithTypeArgumentAndOverloadInES6.ts
TypeScript
// @target: es6 class B<T> { x: T; B: T; constructor(a: any) constructor(a: any,b: T) constructor(a: T) { this.B = a;} foo(a: T) foo(a: any) foo(b: string) foo(): T { return this.x; } get BB(): T { return this.B; } set BBWith(c: T) { this.B = c; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitClassDeclarationWithTypeArgumentInES6.ts
TypeScript
// @target: es6 class B<T> { x: T; B: T; constructor(a: T) { this.B = a;} foo(): T { return this.x; } get BB(): T { return this.B; } set BBWith(c: T) { this.B = c; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS1.ts
TypeScript
// @target: es5 var array0 = [1, 2, 3] var i0 = 0; array0[++i0] **= 2; var array1 = [1, 2, 3] var i1 = 0; array1[++i1] **= array1[++i1] **= 2; var array2 = [1, 2, 3] var i2 = 0; array2[++i2] **= array2[++i2] ** 2; var array3 = [2, 2, 3]; var j0 = 0, j1 = 1; array3[j0++] **= array3[j1++] **= array3[j0++] **= 1;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.ts
TypeScript
// @target: es5 var globalCounter = 0; function foo() { globalCounter += 1; return { 0: 2 }; } foo()[0] **= foo()[0]; var result_foo1 = foo()[0] **= foo()[0]; foo()[0] **= foo()[0] **= 2; var result_foo2 = foo()[0] **= foo()[0] **= 2; foo()[0] **= foo()[0] ** 2; var result_foo3 = foo()[0] **= foo()[0] ** 2;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.ts
TypeScript
// @target: es5 var object = { _0: 2, get 0() { return this._0; }, set 0(x: number) { this._0 = x; }, } object[0] **= object[0]; object[0] **= object[0] **= 2; object[0] **= object[0] ** 2;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithIndexingOnLHS4.ts
TypeScript
// @target: es5 var globalCounter = 0; function incrementIdx(max: number) { globalCounter += 1; let idx = Math.floor(Math.random() * max); return idx; } var array1 = [1, 2, 3, 4, 5]; array1[incrementIdx(array1.length)] **= 3; array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] **= 2; array1[incrementIdx(array1.length)] **= array1[incrementIdx(array1.length)] ** 2;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationAssignmentWithPropertyAccessingOnLHS1.ts
TypeScript
// @target: es5 var globalCounter = 0; function foo() { globalCounter += 1; return { prop: 2 }; } foo().prop **= 2; var result0 = foo().prop **= 2; foo().prop **= foo().prop **= 2; var result1 = foo().prop **= foo().prop **= 2; foo().prop **= foo().prop ** 2; var result2 = foo().prop **= foo().prop ** 2;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationOperator1.ts
TypeScript
// @target:es5 var comp: number; comp **= 1; comp **= comp ** comp; comp **= comp ** comp ** 2; comp **= comp ** comp + 2; comp **= comp ** comp - 2; comp **= comp ** comp * 2; comp **= comp ** comp / 2; comp **= comp ** comp % 2; comp **= (comp - 2) ** 5; comp **= (comp + 2) ** 5; comp **= (comp * 2) ** 5; comp **= (comp / 2) ** 5; comp **= (comp % 2) ** 5; comp **= comp ** (5 + 2); comp **= comp ** (5 - 2); comp **= comp ** (5 * 2); comp **= comp ** (5 / 2); comp **= comp ** (5 % 2);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitCompoundExponentiationOperator2.ts
TypeScript
// @target:es5 var comp: number; comp **= 1; comp **= comp **= 1; comp **= comp **= 1 + 2; comp **= comp **= 1 - 2; comp **= comp **= 1 * 2; comp **= comp **= 1 / 2; comp **= comp **= (1 + 2); comp **= comp **= (1 - 2); comp **= comp **= (1 * 2); comp **= comp **= (1 / 2); comp **= comp **= 1 + 2 ** 3; comp **= comp **= 1 - 2 ** 4; comp **= comp **= 1 * 2 ** 5; comp **= comp **= 1 / 2 ** 6; comp **= comp **= (1 + 2) ** 3; comp **= comp **= (1 - 2) ** 4; comp **= comp **= (1 * 2) ** 5; comp **= comp **= (1 / 2) ** 6;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunction.ts
TypeScript
// @target: es5 function foo(x: string, y = 10) { } function baz(x: string, y = 5, ...rest) { } function bar(y = 10) { } function bar1(y = 10, ...rest) { }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionES6.ts
TypeScript
// @target:es6 function foo(x: string, y = 10) { } function baz(x: string, y = 5, ...rest) { } function bar(y = 10) { } function bar1(y = 10, ...rest) { }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionExpression.ts
TypeScript
// @target: es5 var lambda1 = (y = "hello") => { } var lambda2 = (x: number, y = "hello") => { } var lambda3 = (x: number, y = "hello", ...rest) => { } var lambda4 = (y = "hello", ...rest) => { } var x = function (str = "hello", ...rest) { } var y = (function (num = 10, boo = false, ...rest) { })() var z = (function (num: number, boo = false, ...rest) { })(10)
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionExpressionES6.ts
TypeScript
// @target:es6 var lambda1 = (y = "hello") => { } var lambda2 = (x: number, y = "hello") => { } var lambda3 = (x: number, y = "hello", ...rest) => { } var lambda4 = (y = "hello", ...rest) => { } var x = function (str = "hello", ...rest) { } var y = (function (num = 10, boo = false, ...rest) { })() var z = (function (num: number, boo = false, ...rest) { })(10)
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionProperty.ts
TypeScript
// @target: es5 var obj2 = { func1(y = 10, ...rest) { }, func2(x = "hello") { }, func3(x: string, z: number, y = "hello") { }, func4(x: string, z: number, y = "hello", ...rest) { }, }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitDefaultParametersFunctionPropertyES6.ts
TypeScript
// @target:es6 var obj2 = { func1(y = 10, ...rest) { }, func2(x = "hello") { }, func3(x: string, z: number, y = "hello") { }, func4(x: string, z: number, y = "hello", ...rest) { }, }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitDefaultParametersMethod.ts
TypeScript
// @target: es5 class C { constructor(t: boolean, z: string, x: number, y = "hello") { } public foo(x: string, t = false) { } public foo1(x: string, t = false, ...rest) { } public bar(t = false) { } public boo(t = false, ...rest) { } } class D { constructor(y = "hello") { } } class E { constructor(y = "hello", ...rest) { } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitDefaultParametersMethodES6.ts
TypeScript
// @target:es6 class C { constructor(t: boolean, z: string, x: number, y = "hello") { } public foo(x: string, t = false) { } public foo1(x: string, t = false, ...rest) { } public bar(t = false) { } public boo(t = false, ...rest) { } } class D { constructor(y = "hello") { } } class E { constructor(y = "hello", ...rest) { } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator1.ts
TypeScript
// @target: es5 1 ** -2; 1 ** 2; (-1) ** 2 1 ** 2 ** 3; 1 ** 2 ** -3; 1 ** -(2 ** 3); (-(1 ** 2)) ** 3; (-(1 ** 2)) ** -3; 1 ** 2 + 3; 1 ** 2 - 3; 1 ** 2 * 3; 1 ** 2 / 3; 1 ** 2 % 3; 1 ** -2 + 3; 1 ** -2 - 3; 1 ** -2 * 3; 1 ** -2 / 3; 1 ** -2 % 3; 2 + 3 ** 3; 2 - 3 ** 3; 2 * 3 ** 3; 2 / 3 ** 3; 2 % 3 ** 3; (2 + 3) ** 4; (2 - 3) ** 4; (2 * 3) ** 4; (2 / 3) ** 4;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator2.ts
TypeScript
// @target:es5 var temp = 10; ++temp ** 3; --temp ** 3; temp++ ** 3; temp-- ** 3; --temp + temp ** 3; --temp - temp ** 3; --temp * temp ** 3; --temp / temp ** 3; --temp % temp ** 3; temp-- ** 3; temp++ ** 3; temp-- ** -temp; temp++ ** +temp; temp-- + temp ** 3; temp-- - temp ** 3; temp-- * temp ** 3; temp-- / temp ** 3; temp-- % temp ** 3; --temp + 2 ** 3; --temp - 2 ** 3; --temp * 2 ** 3; --temp / 2 ** 3; --temp % 2 ** 3; ++temp + 2 ** 3; ++temp - 2 ** 3; ++temp * 2 ** 3; ++temp / 2 ** 3; 3 ** ++temp; 3 ** --temp; 3 ** temp++; 3 ** temp--; 3 ** ++temp ** 2; 3 ** --temp ** 2; 3 ** temp++ ** 2; 3 ** temp-- ** 2; 3 ** ++temp + 2; 3 ** ++temp - 2; 3 ** ++temp * 2; 3 ** ++temp / 2; 3 ** ++temp % 2; 3 ** --temp + 2; 3 ** --temp - 2; 3 ** --temp * 2; 3 ** --temp / 2; 3 ** --temp % 2;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator3.ts
TypeScript
// @target:es5 var temp = 10; (-++temp) ** 3; (+--temp) ** 3; (-temp++) ** 3; (+temp--) ** 3; (-(1 ** ++temp)) ** 3; (-(1 ** --temp)) ** 3; (-(1 ** temp++)) ** 3; (-(1 ** temp--)) ** 3; (-3) ** temp++; (-3) ** temp--; (-3) ** ++temp; (-3) ** --temp; (+3) ** temp++; (+3) ** temp--; (+3) ** ++temp; (+3) ** --temp; (-3) ** temp++ ** 2; (-3) ** temp-- ** 2; (-3) ** ++temp ** 2; (-3) ** --temp ** 2; (+3) ** temp++ ** 2; (+3) ** temp-- ** 2; (+3) ** ++temp ** 2; (+3) ** --temp ** 2; 3 ** -temp++; 3 ** -temp--; 3 ** -++temp; 3 ** +--temp; 3 ** (-temp++) ** 2; 3 ** (-temp--) ** 2; 3 ** (+temp++) ** 2; 3 ** (+temp--) ** 2; 3 ** (-++temp) ** 2; 3 ** (+--temp) ** 2;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitExponentiationOperator4.ts
TypeScript
// @target: es5 var temp: any; (<number>temp) ** 3; (<number>--temp) ** 3; (<number>++temp) ** 3; (<number>temp--) ** 3; (<number>temp++) ** 3; 1 ** (<number>--temp) ** 3; 1 ** (<number>++temp) ** 3; 1 ** (<number>temp--) ** 3; 1 ** (<number>temp++) ** 3; (void --temp) ** 3; (void temp--) ** 3; (void 3) ** 4; (void temp++) ** 4; (void temp--) ** 4; 1 ** (void --temp) ** 3; 1 ** (void temp--) ** 3; 1 ** (void 3) ** 4; 1 ** (void temp++) ** 4; 1 ** (void temp--) ** 4; (~ --temp) ** 3; (~ temp--) ** 3; (~ 3) ** 4; (~ temp++) ** 4; (~ temp--) ** 4; 1 ** (~ --temp) ** 3; 1 ** (~ temp--) ** 3; 1 ** (~ 3) ** 4; 1 ** (~ temp++) ** 4; 1 ** (~ temp--) ** 4;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTempalteString4.ts
TypeScript
// @target: es5 var t1 = 10; var t2 = 10; var s; // With TemplateTail `${t1 ** -t2} world`; `${(-t1) ** t2 - t1} world`; `${(-++t1) ** t2 - t1} world`; `${(-t1++) ** t2 - t1} world`; `${(~t1) ** t2 ** --t1 } world`; `${typeof (t1 ** t2 ** t1) } world`; // TempateHead & TemplateTail are empt `${t1 ** -t2} hello world ${t1 ** -t2}`; `${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}`; `${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}`; `${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}`; `${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }`; `${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}`; // With templateHead `hello ${(-t1) ** t2 - t1}`; `hello ${(-++t1) ** t2 - t1}`; `hello ${(-t1++) ** t2 - t1}`; `hello ${(~t1) ** t2 ** --t1 }`; `hello ${typeof (t1 ** t2 ** t1)}`;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTempalteString4ES6.ts
TypeScript
// @target: es6 var t1 = 10; var t2 = 10; var s; // With TemplateTail `${t1 ** -t2} world`; `${(-t1) ** t2 - t1} world`; `${(-++t1) ** t2 - t1} world`; `${(-t1++) ** t2 - t1} world`; `${(~t1) ** t2 ** --t1 } world`; `${typeof (t1 ** t2 ** t1) } world`; // TempateHead & TemplateTail are empt `${t1 ** -t2} hello world ${t1 ** -t2}`; `${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}`; `${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}`; `${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}`; `${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }`; `${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}`; // With templateHead `hello ${(-t1) ** t2 - t1}`; `hello ${(-++t1) ** t2 - t1}`; `hello ${(-t1++) ** t2 - t1}`; `hello ${(~t1) ** t2 ** --t1 }`; `hello ${typeof (t1 ** t2 ** t1)}`;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString1.ts
TypeScript
// @target: es5 var t1 = 10; var t2 = 10; var s; // TempateHead & TemplateTail are empty `${t1 ** t2}`; `${t1 ** t2 ** t1}`; `${t1 + t2 ** t1}`; `${t1 ** t2 + t1}`; `${t1 + t2 ** t2 + t1 }`; `${typeof (t1 ** t2 ** t1) }`; `${1 + typeof (t1 ** t2 ** t1) }`; `${t1 ** t2}${t1 ** t2}`; `${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; `${t1 + t2 ** t1}${t1 + t2 ** t1}`; `${t1 ** t2 + t1}${t1 ** t2 + t1}`; `${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; `${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; `${t1 ** t2} hello world ${t1 ** t2}`; `${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; `${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; `${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; `${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; `${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString1ES6.ts
TypeScript
// @target: es6 var t1 = 10; var t2 = 10; var s; // TempateHead & TemplateTail are empty `${t1 ** t2}`; `${t1 ** t2 ** t1}`; `${t1 + t2 ** t1}`; `${t1 ** t2 + t1}`; `${t1 + t2 ** t2 + t1 }`; `${typeof (t1 ** t2 ** t1) }`; `${1 + typeof (t1 ** t2 ** t1) }`; `${t1 ** t2}${t1 ** t2}`; `${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; `${t1 + t2 ** t1}${t1 + t2 ** t1}`; `${t1 ** t2 + t1}${t1 ** t2 + t1}`; `${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; `${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; `${t1 ** t2} hello world ${t1 ** t2}`; `${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; `${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; `${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; `${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; `${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString2.ts
TypeScript
// @target: es5 var t1 = 10; var t2 = 10; var s; // With templateHead `hello ${t1 ** t2}`; `hello ${t1 ** t2 ** t1}`; `hello ${t1 + t2 ** t1}`; `hello ${t1 ** t2 + t1}`; `hello ${t1 + t2 ** t2 + t1 }`; `hello ${typeof (t1 ** t2 ** t1) }`; `hello ${1 + typeof (t1 ** t2 ** t1) }`; `hello ${t1 ** t2}${t1 ** t2}`; `hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; `hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; `hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; `hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; `hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; `hello ${t1 ** t2} hello world ${t1 ** t2}`; `hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; `hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; `hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; `hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; `hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString2ES6.ts
TypeScript
// @target: es6 var t1 = 10; var t2 = 10; var s; // With templateHead `hello ${t1 ** t2}`; `hello ${t1 ** t2 ** t1}`; `hello ${t1 + t2 ** t1}`; `hello ${t1 ** t2 + t1}`; `hello ${t1 + t2 ** t2 + t1 }`; `hello ${typeof (t1 ** t2 ** t1) }`; `hello ${1 + typeof (t1 ** t2 ** t1) }`; `hello ${t1 ** t2}${t1 ** t2}`; `hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; `hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; `hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; `hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; `hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; `hello ${t1 ** t2} hello world ${t1 ** t2}`; `hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; `hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; `hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; `hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; `hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/emitExponentiationOperatorInTemplateString3.ts
TypeScript
// @target: es5 var t1 = 10; var t2 = 10; var s; // With TemplateTail `${t1 ** t2} world`; `${t1 ** t2 ** t1} world`; `${t1 + t2 ** t1} world`; `${t1 ** t2 + t1} world`; `${t1 + t2 ** t2 + t1 } world`; `${typeof (t1 ** t2 ** t1) } world`; `${1 + typeof (t1 ** t2 ** t1) } world`; `${t1 ** t2}${t1 ** t2} world`; `${t1 ** t2 ** t1}${t1 ** t2 ** t1} world`; `${t1 + t2 ** t1}${t1 + t2 ** t1} world`; `${t1 ** t2 + t1}${t1 ** t2 + t1} world`; `${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; `${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; `${t1 ** t2} hello world ${t1 ** t2} !!`; `${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; `${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; `${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; `${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; `${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University