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/asyncFunctionDeclaration14_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
async function foo(): Promise<void> {
return;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration16_es5.ts | TypeScript | // @target: ES5
// @noEmitHelpers: true
// @lib: es5,es2015.promise
// @allowJs: true
// @checkJs: true
// @noEmit: true
// @filename: /types.d.ts
declare class Thenable { then(): void; }
// @filename: /a.js
/**
* @callback T1
* @param {string} str
* @returns {string}
*/
/**
* @callback T2
* @param {string} str
* @returns {Promise<string>}
*/
/**
* @callback T3
* @param {string} str
* @returns {Thenable}
*/
/**
* @param {string} str
* @returns {string}
*/
const f1 = async str => {
return str;
}
/** @type {T1} */
const f2 = async str => {
return str;
}
/**
* @param {string} str
* @returns {Promise<string>}
*/
const f3 = async str => {
return str;
}
/** @type {T2} */
const f4 = async str => {
return str;
}
/** @type {T3} */
const f5 = async str => {
return str;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration1_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
async function foo(): Promise<void> {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration1_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
async function foo(): Promise<void> {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration1_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
async function foo(): Promise<void> {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration2_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
function f(await) {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration2_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
function f(await) {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration2_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
function f(await) {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration3_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
function f(await = await) {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration3_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
function f(await = await) {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration3_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
function f(await = await) {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration4_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
function await() {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration4_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
function await() {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration4_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
function await() {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration8_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
var v = { [await]: foo } | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration8_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
var v = { [await]: foo } | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclaration8_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
var v = { [await]: foo } | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclarationCapturesArguments_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
class C {
method() {
function other() {}
async function fn () {
await other.apply(this, arguments);
}
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncFunctionDeclarationParameterEvaluation.ts | TypeScript | // @target: es2015,es2017
// @lib: esnext
// @noEmitHelpers: true
// @noTypesAndSymbols: true
// https://github.com/microsoft/TypeScript/issues/40410
async function f1(x, y = z) {}
async function f2({[z]: x}) {}
async function f3(x = z) { return async () => arguments; }
async function f4(x = z) { return async () => async () => arguments; }
async function f5(x = z, ...args) { }
async function f6(x = z, ...args) { return async () => arguments; }
async function f7(x = z, ...args) { return async () => async () => arguments; }
async function f8() { return async (x = z) => arguments; }
async function f9() { return async (x = z) => async () => arguments; }
async function f10(x = z) { return async () => async function () { return async () => arguments; }; }
function f11() { return async (x = z) => arguments; }
function f12() { return async (x = z) => async () => arguments; }
function f() {
const a1 = async (x, y = z) => {};
const a2 = async ({[z]: x}) => {};
const a3 = async (x = z) => { return async () => arguments; };
const a4 = async (x = z) => { return async () => async () => arguments; };
const a5 = async (x = z, ...args) => { };
const a6 = async (x = z, ...args) => { return async () => arguments; };
const a7 = async (x = z, ...args) => { return async () => async () => arguments; };
const a8 = async () => { return async (x = z) => arguments; };
const a9 = async () => { return async (x = z) => async () => arguments; };
const a10 = async (x = z) => { return async () => async function () { return async () => arguments; }; };
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncGeneratorGenericNonWrappedReturn.ts | TypeScript | // @target: esnext
// @strict: true
// @noEmit: true
// #48966
export async function* test<T>(a: T): AsyncGenerator<T, T, T> {
return a // `T` should be allowed here even though the generator's `returnType` is `Awaited<T>`
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncGeneratorParameterEvaluation.ts | TypeScript | // @target: es2015,es2017,es2018
// @lib: esnext
// @noEmitHelpers: true
// @noTypesAndSymbols: true
// https://github.com/microsoft/TypeScript/issues/40410
async function* f1(x, y = z) {}
async function* f2({[z]: x}) {}
declare class Super { foo(): void; }
class Sub extends Super {
async * m(x, y = z, { ...w }) { super.foo(); }
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncImportedPromise_es5.ts | TypeScript | // @target: es5
// @lib: es5,es2015.promise
// @module: commonjs
// @filename: task.ts
export class Task<T> extends Promise<T> { }
// @filename: test.ts
import { Task } from "./task";
class Test {
async example<T>(): Task<T> { return; }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncImportedPromise_es6.ts | TypeScript | // @target: es6
// @module: commonjs
// @filename: task.ts
export class Task<T> extends Promise<T> { }
// @filename: test.ts
import { Task } from "./task";
class Test {
async example<T>(): Task<T> { return; }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncMethodWithSuperConflict_es6.ts | TypeScript | // @target: es6
class A {
x() {
}
y() {
}
}
class B extends A {
// async method with only call/get on 'super' does not require a binding
async simple() {
const _super = null;
const _superIndex = null;
// call with property access
super.x();
// call additional property.
super.y();
// call with element access
super["x"]();
// property access (read)
const a = super.x;
// element access (read)
const b = super["x"];
}
// async method with assignment/destructuring on 'super' requires a binding
async advanced() {
const _super = null;
const _superIndex = null;
const f = () => {};
// call with property access
super.x();
// call with element access
super["x"]();
// property access (read)
const a = super.x;
// element access (read)
const b = super["x"];
// property access (assign)
super.x = f;
// element access (assign)
super["x"] = f;
// destructuring assign with property access
({ f: super.x } = { f });
// destructuring assign with element access
({ f: super["x"] } = { f });
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncMethodWithSuper_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
class A {
x() {
}
y() {
}
}
class B extends A {
// async method with only call/get on 'super' does not require a binding
async simple() {
// call with property access
super.x();
// call additional property.
super.y();
// call with element access
super["x"]();
// property access (read)
const a = super.x;
// element access (read)
const b = super["x"];
}
// async method with assignment/destructuring on 'super' requires a binding
async advanced() {
const f = () => {};
// call with property access
super.x();
// call with element access
super["x"]();
// property access (read)
const a = super.x;
// element access (read)
const b = super["x"];
// property access (assign)
super.x = f;
// element access (assign)
super["x"] = f;
// destructuring assign with property access
({ f: super.x } = { f });
// destructuring assign with element access
({ f: super["x"] } = { f });
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncMethodWithSuper_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
class A {
x() {
}
y() {
}
}
class B extends A {
// async method with only call/get on 'super' does not require a binding
async simple() {
// call with property access
super.x();
// call additional property.
super.y();
// call with element access
super["x"]();
// property access (read)
const a = super.x;
// element access (read)
const b = super["x"];
}
// async method with assignment/destructuring on 'super' requires a binding
async advanced() {
const f = () => {};
// call with property access
super.x();
// call with element access
super["x"]();
// property access (read)
const a = super.x;
// element access (read)
const b = super["x"];
// property access (assign)
super.x = f;
// element access (assign)
super["x"] = f;
// destructuring assign with property access
({ f: super.x } = { f });
// destructuring assign with element access
({ f: super["x"] } = { f });
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncMethodWithSuper_es6.ts | TypeScript | // @target: ES6
// @lib: esnext
// @noEmitHelpers: true
class A {
x() {
}
y() {
}
}
class B extends A {
// async method with only call/get on 'super' does not require a binding
async simple() {
// call with property access
super.x();
// call additional property.
super.y();
// call with element access
super["x"]();
// property access (read)
const a = super.x;
// element access (read)
const b = super["x"];
}
// async method with assignment/destructuring on 'super' requires a binding
async advanced() {
const f = () => {};
// call with property access
super.x();
// call with element access
super["x"]();
// property access (read)
const a = super.x;
// element access (read)
const b = super["x"];
// property access (assign)
super.x = f;
// element access (assign)
super["x"] = f;
// destructuring assign with property access
({ f: super.x } = { f });
// destructuring assign with element access
({ f: super["x"] } = { f });
// property access in arrow
(() => super.x());
// element access in arrow
(() => super["x"]());
// property access in async arrow
(async () => super.x());
// element access in async arrow
(async () => super["x"]());
}
async property_access_only_read_only() {
// call with property access
super.x();
// property access (read)
const a = super.x;
// property access in arrow
(() => super.x());
// property access in async arrow
(async () => super.x());
}
async property_access_only_write_only() {
const f = () => {};
// property access (assign)
super.x = f;
// destructuring assign with property access
({ f: super.x } = { f });
// property access (assign) in arrow
(() => super.x = f);
// property access (assign) in async arrow
(async () => super.x = f);
}
async element_access_only_read_only() {
// call with element access
super["x"]();
// element access (read)
const a = super["x"];
// element access in arrow
(() => super["x"]());
// element access in async arrow
(async () => super["x"]());
}
async element_access_only_write_only() {
const f = () => {};
// element access (assign)
super["x"] = f;
// destructuring assign with element access
({ f: super["x"] } = { f });
// element access (assign) in arrow
(() => super["x"] = f);
// element access (assign) in async arrow
(async () => super["x"] = f);
}
async * property_access_only_read_only_in_generator() {
// call with property access
super.x();
// property access (read)
const a = super.x;
// property access in arrow
(() => super.x());
// property access in async arrow
(async () => super.x());
}
async * property_access_only_write_only_in_generator() {
const f = () => {};
// property access (assign)
super.x = f;
// destructuring assign with property access
({ f: super.x } = { f });
// property access (assign) in arrow
(() => super.x = f);
// property access (assign) in async arrow
(async () => super.x = f);
}
async * element_access_only_read_only_in_generator() {
// call with element access
super["x"]();
// element access (read)
const a = super["x"];
// element access in arrow
(() => super["x"]());
// element access in async arrow
(async () => super["x"]());
}
async * element_access_only_write_only_in_generator() {
const f = () => {};
// element access (assign)
super["x"] = f;
// destructuring assign with element access
({ f: super["x"] } = { f });
// element access (assign) in arrow
(() => super["x"] = f);
// element access (assign) in async arrow
(async () => super["x"] = f);
}
}
// https://github.com/microsoft/TypeScript/issues/46828
class Base {
set setter(x: any) {}
get getter(): any { return; }
method(x: string): any {}
static set setter(x: any) {}
static get getter(): any { return; }
static method(x: string): any {}
}
class Derived extends Base {
a() { return async () => super.method('') }
b() { return async () => super.getter }
c() { return async () => super.setter = '' }
d() { return async () => super["method"]('') }
e() { return async () => super["getter"] }
f() { return async () => super["setter"] = '' }
static a() { return async () => super.method('') }
static b() { return async () => super.getter }
static c() { return async () => super.setter = '' }
static d() { return async () => super["method"]('') }
static e() { return async () => super["getter"] }
static f() { return async () => super["setter"] = '' }
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncMultiFile_es5.ts | TypeScript | // @target: es5
// @lib: es5,es2015.promise
// @filename: a.ts
async function f() {}
// @filename: b.ts
function g() { } | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncMultiFile_es6.ts | TypeScript | // @target: es6
// @filename: a.ts
async function f() {}
// @filename: b.ts
function g() { } | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncUnParenthesizedArrowFunction_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare function someOtherFunction(i: any): Promise<void>;
const x = async i => await someOtherFunction(i)
const x1 = async (i) => await someOtherFunction(i); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncUnParenthesizedArrowFunction_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare function someOtherFunction(i: any): Promise<void>;
const x = async i => await someOtherFunction(i)
const x1 = async (i) => await someOtherFunction(i); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncUnParenthesizedArrowFunction_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare function someOtherFunction(i: any): Promise<void>;
const x = async i => await someOtherFunction(i)
const x1 = async (i) => await someOtherFunction(i); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncUseStrict_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
async function func(): Promise<void> {
"use strict";
var b = await p || a;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncUseStrict_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
async function func(): Promise<void> {
"use strict";
var b = await p || a;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncUseStrict_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
async function func(): Promise<void> {
"use strict";
var b = await p || a;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/asyncWithVarShadowing_es6.ts | TypeScript | // @target: es2015
// @noEmitHelpers: true
// https://github.com/Microsoft/TypeScript/issues/20461
declare const y: any;
async function fn1(x) {
var x;
}
async function fn2(x) {
var x, z;
}
async function fn3(x) {
var z;
}
async function fn4(x) {
var x = y;
}
async function fn5(x) {
var { x } = y;
}
async function fn6(x) {
var { x, z } = y;
}
async function fn7(x) {
var { x = y } = y;
}
async function fn8(x) {
var { z: x } = y;
}
async function fn9(x) {
var { z: { x } } = y;
}
async function fn10(x) {
var { z: { x } = y } = y;
}
async function fn11(x) {
var { ...x } = y;
}
async function fn12(x) {
var [x] = y;
}
async function fn13(x) {
var [x = y] = y;
}
async function fn14(x) {
var [, x] = y;
}
async function fn15(x) {
var [...x] = y;
}
async function fn16(x) {
var [[x]] = y;
}
async function fn17(x) {
var [[x] = y] = y;
}
async function fn18({ x }) {
var x;
}
async function fn19([x]) {
var x;
}
async function fn20(x) {
{
var x;
}
}
async function fn21(x) {
if (y) {
var x;
}
}
async function fn22(x) {
if (y) {
}
else {
var x;
}
}
async function fn23(x) {
try {
var x;
}
catch (e) {
}
}
async function fn24(x) {
try {
}
catch (e) {
var x;
}
}
async function fn25(x) {
try {
}
catch (x) {
var x;
}
}
async function fn26(x) {
try {
}
catch ({ x }) {
var x;
}
}
async function fn27(x) {
try {
}
finally {
var x;
}
}
async function fn28(x) {
while (y) {
var x;
}
}
async function fn29(x) {
do {
var x;
}
while (y);
}
async function fn30(x) {
for (var x = y;;) {
}
}
async function fn31(x) {
for (var { x } = y;;) {
}
}
async function fn32(x) {
for (;;) {
var x;
}
}
async function fn33(x: string) {
for (var x in y) {
}
}
async function fn34(x) {
for (var z in y) {
var x;
}
}
async function fn35(x) {
for (var x of y) {
}
}
async function fn36(x) {
for (var { x } of y) {
}
}
async function fn37(x) {
for (var z of y) {
var x;
}
}
async function fn38(x) {
switch (y) {
case y:
var x;
}
}
async function fn39(x) {
foo: {
var x;
break foo;
}
}
async function fn40(x) {
try {
}
catch {
var x;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/augmentedTypeAssignmentCompatIndexSignature.ts | TypeScript | interface Foo { a }
interface Bar { b }
interface Object {
[n: number]: Foo;
}
interface Function {
[n: number]: Bar;
}
var o = {};
var f = () => { };
var v1: {
[n: number]: Foo
} = o; // Should be allowed
var v2: {
[n: number]: Bar
} = f; // Should be allowed | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/augmentedTypeBracketAccessIndexSignature.ts | TypeScript | interface Foo { a }
interface Bar { b }
interface Object {
[n: number]: Foo;
}
interface Function {
[n: number]: Bar;
}
var a = {}[0]; // Should be Foo
var b = (() => { })[0]; // Should be Bar | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/autoAccessor1.ts | TypeScript | // @target: esnext, es2022, es2015, es5
// @noEmitOnError: true
class C1 {
accessor a: any;
accessor b = 1;
static accessor c: any;
static accessor d = 2;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/autoAccessor10.ts | TypeScript | // @target: es2022
class C1 {
accessor a0 = 1;
}
class C2 {
#a1_accessor_storage = 1;
accessor a1 = 2;
}
class C3 {
static #a2_accessor_storage = 1;
static {
class C3_Inner {
accessor a2 = 2;
static {
#a2_accessor_storage in C3;
}
}
}
}
class C4_1 {
static accessor a3 = 1;
}
class C4_2 {
static accessor a3 = 1;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/autoAccessor11.ts | TypeScript | // @target: es2022
class C {
accessor
a
static accessor
b
static
accessor
c
accessor accessor
d;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/autoAccessor2.ts | TypeScript | // @target: esnext, es2022, es2015
class C1 {
accessor #a: any;
accessor #b = 1;
static accessor #c: any;
static accessor #d = 2;
constructor() {
this.#a = 3;
this.#b = 4;
}
static {
this.#c = 5;
this.#d = 6;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/autoAccessor3.ts | TypeScript | // @target: esnext, es2022, es2015, es5
// @noEmitOnError: true
class C1 {
accessor "w": any;
accessor "x" = 1;
static accessor "y": any;
static accessor "z" = 2;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/autoAccessor4.ts | TypeScript | // @target: esnext, es2022, es2015, es5
// @noEmitOnError: true
class C1 {
accessor 0: any;
accessor 1 = 1;
static accessor 2: any;
static accessor 3 = 2;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/autoAccessor6.ts | TypeScript | // @target: esnext, es2022, es2015
// @useDefineForClassFields: *
class C1 {
accessor a: any;
}
class C2 extends C1 {
a = 1;
}
class C3 extends C1 {
get a() { return super.a; }
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/autoAccessor7.ts | TypeScript | // @target: esnext, es2022, es2015
// @useDefineForClassFields: *
abstract class C1 {
abstract accessor a: any;
}
class C2 extends C1 {
accessor a = 1;
}
class C3 extends C1 {
get a() { return 1; }
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/autoAccessor8.ts | TypeScript | // @target: esnext
// @declaration: true
class C1 {
accessor a: any;
static accessor b: any;
}
declare class C2 {
accessor a: any;
static accessor b: any;
}
function f() {
class C3 {
accessor a: any;
static accessor b: any;
}
return C3;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/autoAccessor9.ts | TypeScript | // @target: esnext
// @useDefineForClassFields: false
// Auto-accessors do not use Set semantics themselves, so do not need to be transformed if there are no other
// initializers that need to be transformed:
class C1 {
accessor x = 1;
}
// If there are other field initializers to transform, we must transform auto-accessors so that we can preserve
// initialization order:
class C2 {
x = 1;
accessor y = 2;
z = 3;
}
// Private field initializers also do not use Set semantics, so they do not force an auto-accessor transformation:
class C3 {
#x = 1;
accessor y = 2;
}
// However, we still need to hoist private field initializers to the constructor if we need to preserve initialization
// order:
class C4 {
x = 1;
#y = 2;
z = 3;
}
class C5 {
#x = 1;
accessor y = 2;
z = 3;
}
// Static accessors aren't affected:
class C6 {
static accessor x = 1;
}
// Static accessors aren't affected:
class C7 {
static x = 1;
static accessor y = 2;
static z = 3;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/autoAccessorAllowedModifiers.ts | TypeScript | // @target: esnext
// @noTypesAndSymbols: true
abstract class C1 {
accessor a: any;
public accessor b: any;
private accessor c: any;
protected accessor d: any;
abstract accessor e: any;
static accessor f: any;
public static accessor g: any;
private static accessor h: any;
protected static accessor i: any;
accessor #j: any;
accessor "k": any;
accessor 108: any;
accessor ["m"]: any;
accessor n!: number;
}
class C2 extends C1 {
override accessor e: any;
static override accessor i: any;
}
declare class C3 {
accessor a: any;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/autoAccessorNoUseDefineForClassFields.ts | TypeScript | // @target: esnext
// @useDefineForClassFields: false
// @filename: file1.ts
// https://github.com/microsoft/TypeScript/issues/51528
class C1 {
static accessor x = 0;
}
// @filename: file2.ts
class C2 {
static accessor #x = 0;
}
// @filename: file3.ts
class C3 {
static accessor #x = 0;
accessor #y = 0;
}
// @filename: file3.ts
class C3 {
accessor x = 0;
}
// @filename: file4.ts
class C4 {
accessor #x = 0;
}
// @filename: file5.ts
class C5 {
x = 0;
accessor #x = 1;
}
// @filename: file6.ts
class C6 {
accessor #x = 0;
x = 1;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression1_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = await p || a;
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression1_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = await p || a;
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression1_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = await p || a;
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression2_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = await p && a;
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression2_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = await p && a;
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression2_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = await p && a;
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression3_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: number;
declare var p: Promise<number>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = await p + a;
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression3_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: number;
declare var p: Promise<number>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = await p + a;
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression3_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: number;
declare var p: Promise<number>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = await p + a;
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression4_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = (await p, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression4_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = (await p, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression4_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = (await p, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression5_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var o: { a: boolean; };
o.a = await p;
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression5_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var o: { a: boolean; };
o.a = await p;
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitBinaryExpression5_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var o: { a: boolean; };
o.a = await p;
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression1_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = fn(a, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression1_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = fn(a, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression1_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = fn(a, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression2_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = fn(await p, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression2_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = fn(await p, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression2_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = fn(await p, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression3_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = fn(a, await p, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression3_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = fn(a, await p, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression3_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = fn(a, await p, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression4_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = (await pfn)(a, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression4_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = (await pfn)(a, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression4_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = (await pfn)(a, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression5_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = o.fn(a, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression5_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = o.fn(a, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression5_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = o.fn(a, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression6_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = o.fn(await p, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression6_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = o.fn(await p, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression6_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = o.fn(await p, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression7_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = o.fn(a, await p, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression7_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = o.fn(a, await p, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression7_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = o.fn(a, await p, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression8_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = (await po).fn(a, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression8_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = (await po).fn(a, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitCallExpression8_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare var a: boolean;
declare var p: Promise<boolean>;
declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void;
declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; };
declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
var b = (await po).fn(a, a, a);
after();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitClassExpression_es2017.ts | TypeScript | // @target: es2017
// @noEmitHelpers: true
declare class C { }
declare var p: Promise<typeof C>;
async function func(): Promise<void> {
class D extends (await p) {
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitClassExpression_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare class C { }
declare var p: Promise<typeof C>;
async function func(): Promise<void> {
class D extends (await p) {
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitClassExpression_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare class C { }
declare var p: Promise<typeof C>;
async function func(): Promise<void> {
class D extends (await p) {
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitInheritedPromise_es2017.ts | TypeScript | // @target: es2017
// @strictNullChecks: true
interface A extends Promise<string> {}
declare var a: A;
async function f() {
await a;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitUnion_es5.ts | TypeScript | // @target: ES5
// @lib: es5,es2015.promise
// @noEmitHelpers: true
declare let a: number | string;
declare let b: PromiseLike<number> | PromiseLike<string>;
declare let c: PromiseLike<number | string>;
declare let d: number | PromiseLike<string>;
declare let e: number | PromiseLike<number | string>;
async function f() {
let await_a = await a;
let await_b = await b;
let await_c = await c;
let await_d = await d;
let await_e = await e;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitUnion_es6.ts | TypeScript | // @target: ES6
// @noEmitHelpers: true
declare let a: number | string;
declare let b: PromiseLike<number> | PromiseLike<string>;
declare let c: PromiseLike<number | string>;
declare let d: number | PromiseLike<string>;
declare let e: number | PromiseLike<number | string>;
async function f() {
let await_a = await a;
let await_b = await b;
let await_c = await c;
let await_d = await d;
let await_e = await e;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitUsingDeclarations.1.ts | TypeScript | // @target: esnext,es2022,es2017,es2015,es5
// @module: esnext
// @lib: esnext
// @noTypesAndSymbols: true
await using d1 = { async [Symbol.asyncDispose]() {} };
async function af() {
await using d3 = { async [Symbol.asyncDispose]() {} };
await null;
}
async function * ag() {
await using d5 = { async [Symbol.asyncDispose]() {} };
yield;
await null;
}
const a = async () => {
await using d6 = { async [Symbol.asyncDispose]() {} };
};
class C1 {
a = async () => {
await using d7 = { async [Symbol.asyncDispose]() {} };
};
async am() {
await using d13 = { async [Symbol.asyncDispose]() {} };
await null;
}
async * ag() {
await using d15 = { async [Symbol.asyncDispose]() {} };
yield;
await null;
}
}
{
await using d19 = { async [Symbol.asyncDispose]() {} };
}
switch (Math.random()) {
case 0:
await using d20 = { async [Symbol.asyncDispose]() {} };
break;
case 1:
await using d21 = { async [Symbol.asyncDispose]() {} };
break;
}
if (true)
switch (0) {
case 0:
await using d22 = { async [Symbol.asyncDispose]() {} };
break;
}
try {
await using d23 = { async [Symbol.asyncDispose]() {} };
}
catch {
await using d24 = { async [Symbol.asyncDispose]() {} };
}
finally {
await using d25 = { async [Symbol.asyncDispose]() {} };
}
if (true) {
await using d26 = { async [Symbol.asyncDispose]() {} };
}
else {
await using d27 = { async [Symbol.asyncDispose]() {} };
}
while (true) {
await using d28 = { async [Symbol.asyncDispose]() {} };
break;
}
do {
await using d29 = { async [Symbol.asyncDispose]() {} };
break;
}
while (true);
for (;;) {
await using d30 = { async [Symbol.asyncDispose]() {} };
break;
}
for (const x in {}) {
await using d31 = { async [Symbol.asyncDispose]() {} };
}
for (const x of []) {
await using d32 = { async [Symbol.asyncDispose]() {} };
}
export {}; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitUsingDeclarations.12.ts | TypeScript | // @target: esnext
// @module: esnext
// @lib: esnext
// @noTypesAndSymbols: true
async function f() {
await using x = {};
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitUsingDeclarations.13.ts | TypeScript | // @target: esnext
// @module: esnext
// @lib: esnext
// @noTypesAndSymbols: true
await using x = null;
function f() {
await using x = null;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitUsingDeclarations.15.ts | TypeScript | // @target: esnext
// @module: esnext
// @lib: esnext
// @noTypesAndSymbols: true
// @noUnusedLocals: true
async function f() {
await using _ = { async [Symbol.asyncDispose]() {} };
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/awaitUsingDeclarations.2.ts | TypeScript | // @target: esnext,es2022,es2017,es2015,es5
// @module: esnext
// @lib: esnext
// @noTypesAndSymbols: true
{
await using d1 = { async [Symbol.asyncDispose]() {} },
d2 = { async [Symbol.asyncDispose]() {} };
}
export {}; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.