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/esDecoratorsMetadata5.ts | TypeScript | // @target: es2022
// @noTypesAndSymbols: true
// @filename: /foo.ts
declare var metadata: any;
class C {
@metadata m() {}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekind.ts | TypeScript | // @target: ES6
// @sourcemap: false
// @declaration: false
// @module: esnext
export default class A
{
constructor ()
{
}
public B()
{
return 42;
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES2015Target.ts | TypeScript | // @target: es2015
// @sourcemap: false
// @declaration: false
// @module: es6
export default class A
{
constructor ()
{
}
public B()
{
return 42;
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES5Target.ts | TypeScript | // @target: es5
// @module: esnext
// @experimentalDecorators: true
export class C {
static s = 0;
p = 1;
method() { }
}
export { C as C2 };
declare function foo(...args: any[]): any;
@foo
export class D {
static s = 0;
p = 1;
method() { }
}
export { D as D2 };
class E { }
export {E};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES5Target10.ts | TypeScript | // @target: es5
// @module: esnext
import i = require("mod"); // Error;
namespace N {
}
export = N; // Error | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES5Target11.ts | TypeScript | // @target: es5
// @module: esnext
// @experimentalDecorators: true
declare function foo(...args: any[]): any;
@foo
export default class C {
static x() { return C.y; }
static y = 1
p = 1;
method() { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES5Target12.ts | TypeScript | // @target: es5
// @module: esnext
export class C {
}
export namespace C {
export const x = 1;
}
export enum E {
w = 1
}
export enum E {
x = 2
}
export namespace E {
export const y = 1;
}
export namespace E {
export const z = 1;
}
export namespace N {
}
export namespace N {
export const ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES5Target2.ts | TypeScript | // @target: es5
// @module: esnext
export default class C {
static s = 0;
p = 1;
method() { }
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES5Target3.ts | TypeScript | // @target: es5
// @module: esnext
// @experimentalDecorators: true
declare function foo(...args: any[]): any;
@foo
export default class D {
static s = 0;
p = 1;
method() { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES5Target4.ts | TypeScript | // @target: es5
// @module: esnext
class E { }
export default E; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES5Target5.ts | TypeScript | // @target: es5
// @module: esnext
// @preserveConstEnums: true
export enum E1 {
value1
}
export const enum E2 {
value1
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES5Target6.ts | TypeScript | // @target: es5
// @module: esnext
export function f1(d = 0) {
}
export function f2(...arg) {
}
export default function f3(d = 0) {
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES5Target7.ts | TypeScript | // @target: es5
// @module: esnext
export namespace N {
var x = 0;
}
export namespace N2 {
export interface I { }
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES5Target8.ts | TypeScript | // @target: es5
// @module: esnext
export const c = 0;
export let l = 1; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/esnextmodulekindWithES5Target9.ts | TypeScript | // @target: es5
// @module: esnext
import d from "mod";
import {a} from "mod";
import * as M from "mod";
export {a};
export {M};
export {d};
export * from "mod";
export {b} from "mod"
export default d;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/everyTypeAssignableToAny.ts | TypeScript | var a: any;
class C {
foo: string;
}
var ac: C;
interface I {
foo: string;
}
var ai: I;
enum E { A }
var ae: E;
var b: number;
var c: string;
var d: boolean;
var e: Date;
var f: any;
var g: void;
var h: Object;
var i: {};
var j: () => {};
var k: Function;
var l: (x: number) => string;
var m: number[];
var n:... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/everyTypeWithAnnotationAndInitializer.ts | TypeScript | interface I {
id: number;
}
class C implements I {
id: number;
}
class D<T>{
source: T;
recurse: D<T>;
wrapped: D<D<T>>
}
function F(x: string): number { return 42; }
module M {
export class A {
name: string;
}
export function F2(x: number): string { return x.toString(); }
}... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/everyTypeWithAnnotationAndInvalidInitializer.ts | TypeScript | interface I {
id: number;
}
class C implements I {
id: number;
}
class D<T>{
source: T;
recurse: D<T>;
wrapped: D<D<T>>
}
function F(x: string): number { return 42; }
function F2(x: number): boolean { return x < 42; }
module M {
export class A {
name: string;
}
export functi... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/everyTypeWithInitializer.ts | TypeScript | interface I {
id: number;
}
class C implements I {
id: number;
}
class D<T>{
source: T;
recurse: D<T>;
wrapped: D<D<T>>
}
function F(x: string): number { return 42; }
module M {
export class A {
name: string;
}
export function F2(x: number): string { return x.toString(); }
}... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exhaustiveSwitchStatements1.ts | TypeScript | // @strict: true
// @allowUnreachableCode: false
// @declaration: true
function f1(x: 1 | 2): string {
if (!!true) {
switch (x) {
case 1: return 'a';
case 2: return 'b';
}
x; // Unreachable
}
else {
throw 0;
}
}
function f2(x: 1 | 2) {
let z... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exnextmodulekindExportClassNameWithObject.ts | TypeScript | // @target: ES5
// @module: esnext
export class Object {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/expandoOnAlias.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @declaration: true
// @emitDeclarationOnly: true
// @Filename: vue.js
export class Vue {}
export const config = { x: 0 };
// @Filename: test.js
import { Vue, config } from "./vue";
// Expando declarations aren't allowed on aliases.
Vue.config = {};
new Vue();
// This is not an... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithAnyAndNumber.ts | TypeScript | var a: any;
var b: number;
// operator **
var r1 = a ** a;
var r2 = a ** b;
var r3 = a ** 0;
var r4 = 0 ** a;
var r5 = 0 ** 0;
var r6 = b ** 0;
var r7 = 0 ** b;
var r8 = b ** b; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithEnum.ts | TypeScript | // operands of an enum type are treated as having the primitive type Number.
enum E {
a,
b
}
var a: any;
var b: number;
var c: E;
// operator **
var r1 = c ** a;
var r2 = c ** b;
var r3 = c ** c;
var r4 = a ** c;
var r5 = b ** c;
var r6 = E.a ** a;
var r7 = E.a ** b;
var r8 = E.a ** E.b;
var r9 = E.a ** 1;
v... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithEnumUnion.ts | TypeScript | // operands of an enum type are treated as having the primitive type Number.
enum E {
a,
b
}
enum F {
c,
d
}
var a: any;
var b: number;
var c: E | F;
// operator **
var r1 = c ** a;
var r2 = c ** b;
var r3 = c ** c;
var r4 = a ** c;
var r5 = b ** c;
var r6 = E.a ** a;
var r7 = E.a ** b;
var r8 = E.a ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithInvalidOperands.ts | TypeScript | // these operators require their operands to be of type Any, the Number primitive type, or
// an enum type
enum E { a, b, c }
var a: any;
var b: boolean;
var c: number;
var d: string;
var e: { a: number };
var f: Number;
// All of the below should be an error unless otherwise noted
// operator **
var r1a1 = a ** a; /... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithInvalidSimpleUnaryExpressionOperands.ts | TypeScript | var temp: any;
// Error: incorrect type on left-hand side
(! --temp) ** 3;
(!temp--) ** 3;
(!3) ** 4;
(!temp++) ** 4;
(!temp--) ** 4;
(! --temp) ** 3 ** 1;
(!temp--) ** 3 ** 1;
(!3) ** 4 ** 1;
(!temp++) ** 4 ** 1;
(!temp--) ** 4 ** 1;
(typeof --temp) ** 3;
(typeof temp--) ** 3;
(typeof 3) ** 4;
(typeof temp++) ** ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithNew.ts | TypeScript | var a: any;
var b: any;
var c: any;
new a ** b ** c;
new a ** new b ** c;
new (a ** b ** c); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithTemplateStringInvalid.ts | TypeScript | // @target: es5
var a = 1 ** `${ 3 }`;
var b = 1 ** `2${ 3 }`;
var c = 1 ** `${ 3 }4`;
var d = 1 ** `2${ 3 }4`;
var e = `${ 3 }` ** 5;
var f = `2${ 3 }` ** 5;
var g = `${ 3 }4` ** 5;
var h = `2${ 3 }4` ** 5;
var k = 10;
k **= `${ 3 }`;
k **= `2${ 3 }`;
k **= `2${ 3 }4`;
k **= `2${ 3 }4`;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithTemplateStringInvalidES6.ts | TypeScript | // @target: es6
var a = 1 ** `${ 3 }`;
var b = 1 ** `2${ 3 }`;
var c = 1 ** `${ 3 }4`;
var d = 1 ** `2${ 3 }4`;
var e = `${ 3 }` ** 5;
var f = `2${ 3 }` ** 5;
var g = `${ 3 }4` ** 5;
var h = `2${ 3 }4` ** 5;
var k = 10;
k **= `${ 3 }`;
k **= `2${ 3 }`;
k **= `2${ 3 }4`;
kj **= `2${ 3 }4`; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exponentiationOperatorWithTypeParameter.ts | TypeScript | // type parameter type is not valid for arithmetic operand
function foo<T>(t: T) {
var a: any;
var b: boolean;
var c: number;
var d: string;
var e: {};
var r1a1 = a ** t;
var r2a1 = t ** a;
var r1b1 = b ** t;
var r2b1 = t ** b;
var r1c1 = c ** t;
var r2c1 = t ** c;
var r... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAmbientClassNameWithObject.ts | TypeScript | // @target: ES5
export declare class Object {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAndImport-es5-amd.ts | TypeScript | //@module: amd
//@target: ES5
// @filename: m1.ts
export default function f1() {
}
// @filename: m2.ts
import f1 from "./m1";
export default function f2() {
f1();
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAndImport-es5.ts | TypeScript | //@module: commonjs
//@target: ES5
// @filename: m1.ts
export default function f1() {
}
// @filename: m2.ts
import f1 from "./m1";
export default function f2() {
f1();
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAsNamespace1.ts | TypeScript | // @module: esnext, es2015, commonjs, amd, system, umd
// @filename: 0.ts
// @declaration: true
export const a = 1;
export const b = 2;
// @filename: 1.ts
export * as ns from './0';
ns.a;
ns.b;
// @filename: 2.ts
import * as foo from './1'
foo.ns.a;
foo.ns.b; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAsNamespace2.ts | TypeScript | // @module: esnext, es2015, commonjs, amd, system, umd
// @filename: 0.ts
// @declaration: true
// @esModuleInterop: true
export const a = 1;
export const b = 2;
// @filename: 1.ts
export * as ns from './0';
ns.a;
ns.b;
// @filename: 2.ts
import * as foo from './1'
foo.ns.a;
foo.ns.b; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAsNamespace3.ts | TypeScript | // @module: esnext, es2015, commonjs, amd, system, umd
// @filename: 0.ts
// @declaration: true
// @esModuleInterop: true
export const a = 1;
export const b = 2;
// @filename: 1.ts
export * as ns from './0';
ns.a;
ns.b;
let ns = {a: 1, b: 2}
ns.a;
ns.b;
// @filename: 2.ts
import * as foo from './1'
foo.ns.a;
foo.ns.... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAsNamespace4.ts | TypeScript | // @module: esnext, es2015, commonjs, amd, system, umd
// @filename: 0.ts
// @declaration: true
// @esModuleInterop: true
export const a = 1;
export const b = 2;
// @filename: 1.ts
export * as default from './0';
// @filename: 11.ts
import * as ns from './0';
export default ns;
// @filename: 2.ts
import foo from './... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAsNamespace5.ts | TypeScript | // @module: esnext
// @moduleResolution: bundler
// @filename: three.d.ts
export type Named = 0;
declare const Named: 0;
// @filename: two.d.ts
export * as default from "./three";
// @filename: one.ts
import ns from "./two";
type Alias = ns.Named;
ns.Named;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAsNamespace_exportAssignment.ts | TypeScript | // @module: commonjs
// @esModuleInterop: true
// @noTypesAndSymbols: true
// @Filename: a.ts
export = {}
// @Filename: b.ts
export * as ns from './a';
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAsNamespace_missingEmitHelpers.ts | TypeScript | // @module: commonjs
// @importHelpers: true
// @esModuleInterop: true
// @noTypesAndSymbols: true
// @Filename: a.ts
export {}
// @Filename: b.ts
export * as ns from './a'; // Error
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAsNamespace_nonExistent.ts | TypeScript | // @module: esnext
// @noTypesAndSymbols: true
export * as ns from './nonexistent'; // Error
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignDottedName.ts | TypeScript | // @Filename: foo1.ts
export function x(){
return true;
}
// @Filename: foo2.ts
import foo1 = require('./foo1');
export = foo1.x; // Ok
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignImportedIdentifier.ts | TypeScript | // @Filename: foo1.ts
export function x(){
return true;
}
// @Filename: foo2.ts
import foo1 = require('./foo1');
var x = foo1.x;
export = x;
// @Filename: foo3.ts
import foo2 = require('./foo2');
var x = foo2(); // should be boolean | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignTypes.ts | TypeScript | // @Filename: expString.ts
var x = "test";
export = x;
// @Filename: expNumber.ts
var x = 42;
export = x;
// @Filename: expBoolean.ts
var x = true;
export = x;
// @Filename: expArray.ts
var x = [1,2];
export = x;
// @Filename: expObject.ts
var x = { answer: 42, when: 1776};
export = x;
// @Filename: expAny.ts
var ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignmentAndDeclaration.ts | TypeScript | // @module: amd
// @Filename: foo_0.ts
export enum E1 {
A,B,C
}
class C1 {
}
// Invalid, as there is already an exported member.
export = C1; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignmentCircularModules.ts | TypeScript | // @module: amd
// @Filename: foo_0.ts
import foo1 = require('./foo_1');
module Foo {
export var x = foo1.x;
}
export = Foo;
// @Filename: foo_1.ts
import foo2 = require("./foo_2");
module Foo {
export var x = foo2.x;
}
export = Foo;
// @Filename: foo_2.ts
import foo0 = require("./foo_0");
module Foo {
export var ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignmentConstrainedGenericType.ts | TypeScript | // @module: commonjs
// @Filename: foo_0.ts
class Foo<T extends {a: string; b:number;}>{
test: T;
constructor(x: T){}
}
export = Foo;
// @Filename: foo_1.ts
import foo = require("./foo_0");
var x = new foo(true); // Should error
var y = new foo({a: "test", b: 42}); // Should be OK
var z: number = y.test.b; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignmentGenericType.ts | TypeScript | // @module: commonjs
// @Filename: foo_0.ts
class Foo<T>{
test: T;
}
export = Foo;
// @Filename: foo_1.ts
import foo = require("./foo_0");
var x = new foo<number>();
var y:number = x.test;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignmentMergedInterface.ts | TypeScript | // @module: amd
// @Filename: foo_0.ts
interface Foo {
(a: string): void;
b: string;
}
interface Foo {
(a: number): number;
c: boolean;
d: {x: number; y: number};
}
export = Foo;
// @Filename: foo_1.ts
import foo = require("./foo_0");
var x: foo;
x("test");
x(42);
var y: string = x.b;
if(!!x.c){ }
var z = {x: 1, ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignmentMergedModule.ts | TypeScript | // @module: commonjs
// @Filename: foo_0.ts
module Foo {
export function a(){
return 5;
}
export var b = true;
}
module Foo {
export function c(a: number){
return a;
}
export module Test {
export var answer = 42;
}
}
export = Foo;
// @Filename: foo_1.ts
import foo = require("./foo_0");
var a: number = foo... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignmentOfExportNamespaceWithDefault.ts | TypeScript | // @esModuleInterop: true
// @target: esnext
// @filename: main.ts
// @module: commonjs
// https://github.com/microsoft/TypeScript/issues/39149
import a from "a";
a();
// @filename: external.d.ts
declare module "b" {
export function a(): void;
export namespace a {
var _a: typeof a;
export { _a ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignmentTopLevelClodule.ts | TypeScript | // @module: amd
// @Filename: foo_0.ts
class Foo {
test = "test";
}
module Foo {
export var answer = 42;
}
export = Foo;
// @Filename: foo_1.ts
import foo = require("./foo_0");
if(foo.answer === 42){
var x = new foo();
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignmentTopLevelEnumdule.ts | TypeScript | // @module: amd
// @Filename: foo_0.ts
enum foo {
red, green, blue
}
module foo {
export var answer = 42;
}
export = foo;
// @Filename: foo_1.ts
import foo = require("./foo_0");
var color: foo;
if(color === foo.green){
color = foo.answer;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignmentTopLevelFundule.ts | TypeScript | // @module: amd
// @Filename: foo_0.ts
function foo() {
return "test";
}
module foo {
export var answer = 42;
}
export = foo;
// @Filename: foo_1.ts
import foo = require("./foo_0");
if(foo.answer === 42){
var x = foo();
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportAssignmentTopLevelIdentifier.ts | TypeScript | // @module: amd
// @Filename: foo_0.ts
module Foo {
export var answer = 42;
}
export = Foo;
// @Filename: foo_1.ts
import foo = require("./foo_0");
if(foo.answer === 42){
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportBinding.ts | TypeScript | // @filename: exportConsts.ts
// @strict: true
export { x }
export { x as xx }
export default x;
const x = 'x'
export { Y as Z }
class Y {}
// @filename: exportVars.ts
// @strict: true
export { y }
export { y as yy }
export default y;
var y = 'y'
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportClassNameWithObjectAMD.ts | TypeScript | // @target: ES5
// @module: amd
export class Object {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportClassNameWithObjectCommonJS.ts | TypeScript | // @target: ES5
// @module: commonjs
export class Object {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportClassNameWithObjectSystem.ts | TypeScript | // @target: ES5
// @module: system
export class Object {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportClassNameWithObjectUMD.ts | TypeScript | // @target: ES5
// @module: umd
export class Object {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportCodeGen.ts | TypeScript |
// should replace all refs to 'x' in the body,
// with fully qualified
module A {
export var x = 12;
function lt12() {
return x < 12;
}
}
// should not fully qualify 'x'
module B {
var x = 12;
function lt12() {
return x < 12;
}
}
// not copied, since not exported
module C {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportDeclaration.ts | TypeScript | // @module: commonjs
// @isolatedModules: false, true
// @Filename: /a.ts
class A {}
export type { A };
// @Filename: /b.ts
import { A } from './a';
declare const a: A;
new A();
// @Filename: /c.ts
import type { A } from './a';
export = A;
// @Filename: /d.ts
import { A } from './a';
export = A; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportDeclaration_moduleSpecifier-isolatedModules.ts | TypeScript | // @isolatedModules: true
// @Filename: /a.ts
export type A = {};
// @Filename: /b.ts
export type { A } from './a'; // should not error, but would without `type`
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportDeclaration_moduleSpecifier.ts | TypeScript | // @Filename: /a.ts
export class A {}
// @Filename: /b.ts
export type { A } from './a';
// @Filename: /c.ts
import { A } from './b';
declare const a: A;
new A();
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportDeclaration_value.ts | TypeScript | // @Filename: /a.ts
const A = {};
export type { A };
export const AA = {};
// @Filename: /b.ts
export type { AA } from './a';
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportDeclaredModule.ts | TypeScript | // @Filename: foo1.ts
declare module M1 {
export var a: string;
export function b(): number;
}
export = M1;
// @Filename: foo2.ts
import foo1 = require('./foo1');
var x: number = foo1.b(); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportDefaultClassNameWithObject.ts | TypeScript | // @target: ES5
export default class Object {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportDefaultClassWithStaticPropertyAssignmentsInES6.ts | TypeScript | // @target:es6
export default class {
static z: string = "Foo";
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportDefaultExpressionComments.ts | TypeScript | // @declaration: true
/**
* JSDoc Comments
*/
export default null
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportDefaultInJsFile01.ts | TypeScript | // @allowJS: true
// @target: es5
// @module: commonjs
// @filename: myFile01.js
export default "hello"; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportDefaultInJsFile02.ts | TypeScript | // @allowJS: true
// @target: es2015
// @module: es2015
// @filename: myFile02.js
export default "hello"; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportDefaultNamespace.ts | TypeScript | // @declaration: true
export default function someFunc() {
return 'hello!';
}
someFunc.someProp = 'yo';
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportImportAlias.ts | TypeScript | // expect no errors here
module A {
export var x = 'hello world'
export class Point {
constructor(public x: number, public y: number) { }
}
export module B {
export interface Id {
name: string;
}
}
}
module C {
export import a = A;
}
var a: string = C.a.x;... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNamespace1.ts | TypeScript | // @Filename: a.ts
export class A {}
// @Filename: b.ts
export type { A } from './a';
// @Filename: c.ts
export * from './b';
// @Filename: d.ts
import { A } from './c';
new A(); // Error
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNamespace10.ts | TypeScript | // @Filename: /a.ts
export class A {}
// @Filename: /b.ts
export type * as ns from "./a";
// @Filename: /c.ts
import { ns } from "./b";
let _: ns.A = new ns.A(); // Error | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNamespace11.ts | TypeScript | // @filename: main.ts
import * as intermediate from './intermediate'
const ghost: intermediate.Ghost = new intermediate.Ghost()
// @filename: intermediate.ts
export type * from './ghost'
// @filename: ghost.ts
export class Ghost {} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNamespace12.ts | TypeScript | // @filename: main.ts
import { c } from './types'
import * as types from './types'
console.log(c) // Fails as expected, import is still allowed though.
console.log(types.c) // Expected an error here.
// @filename: types.ts
export type * from './values'
// @filename: values.ts
export const c = 10 | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNamespace3.ts | TypeScript | // @Filename: a.ts
export class A {}
// @Filename: b.ts
export type { A } from './a';
// @Filename: c.ts
export * as a from './b';
// @Filename: d.ts
import { a } from './c';
new a.A(); // Error
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNamespace4.ts | TypeScript | // @declaration: true
// @Filename: a.ts
export class A {}
// @Filename: b.ts
export type * from './a';
// @Filename: c.ts
export type * as ns from './a';
// @Filename: d.ts
import { A } from './b';
A;
// @Filename: e.ts
import { ns } from './c';
ns.A;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNamespace5.ts | TypeScript | // @declaration: true
// @Filename: /a.ts
export class A {}
export class B {}
export class X {}
// @Filename: /b.ts
export type * from "./a";
export { X } from "./a";
// @Filename: /c.ts
import { A, B as C, X } from "./b";
let _: A = new A(); // Error
let __: C = new C(); // Error
let ___: X = new X(); // Ok
// ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNamespace6.ts | TypeScript | // @Filename: /a.ts
export class A {}
export class B {}
// @Filename: /b.ts
export type * from "./a";
// @Filename: /c.ts
export * from "./b";
// @Filename: /d.ts
import { A, B } from "./c";
let _: A = new A(); // Error
let __: B = new B(); // Error | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNamespace7.ts | TypeScript | // @Filename: /a.ts
export class A {}
export class B {}
export class C {}
// @Filename: /b.ts
export type * from "./a";
export class C {}
// @Filename: /c.ts
import { A, B, C } from "./b";
let _: A = new A(); // Error
let __: B = new B(); // Error
let ___: C = new C(); // Ok
// @Filename: /d.ts
export type * from "... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNamespace8.ts | TypeScript | // @Filename: /a.ts
export class A {}
export class B {}
// @Filename: /b.ts
export class B {}
export class C {}
// @Filename: /c.ts
export type * from "./a";
export * from "./b"; // Collision error
// @Filename: /d.ts
import { A, B, C } from "./c";
let _: A = new A(); // Error
let __: B = new B(); // Ok
let ___: ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNamespace9.ts | TypeScript | // @Filename: /a.ts
export type A = number;
// @Filename: /b.ts
export type * from "./a";
// @Filename: /c.ts
import { A } from "./b";
const A = 1;
export { A };
// @Filename: /d.ts
import { A } from "./c";
A; // Ok
type _ = A;
// @Filename: /e.ts
export const A = 1;
// @Filename: /f.ts
export * from "./e";
export... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNamespace_js.ts | TypeScript | // @declaration: true
// @outDir: out
// @checkJs: true
// @allowJs: true
// @Filename: a.js
export class A {}
// @Filename: b.js
export type * from './a';
// @Filename: c.js
import { A } from './b';
A;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNestedNamespaces.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: mod.js
exports.n = {};
exports.n.K = function () {
this.x = 10;
}
exports.Classic = class {
constructor() {
this.p = 1
}
}
// @Filename: use.js
import * as s from './mod'
var k = new s.n.K()
k.x
var classic = new s.Classic()
/**... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNestedNamespaces2.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: mod.js
// Based on a pattern from adonis
exports.formatters = {}
// @Filename: first.js
exports = require('./mod')
exports.formatters.j = function (v) {
return v
}
// @Filename: second.js
exports = require('./mod')
exports.formatters.o = function (... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNonLocalDeclarations.ts | TypeScript | export { string };
export type { number };
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportNonVisibleType.ts | TypeScript | // @Filename: foo1.ts
interface I1 {
a: string;
b: number;
}
var x: I1 = {a: "test", b: 42};
export = x; // Should fail, I1 not exported.
// @Filename: foo2.ts
interface I1 {
a: string;
b: number;
}
class C1 {
m1: I1;
}
export = C1; // Should fail, type I1 of visible member C1.m1 not exported.
// @Filename: ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportPropertyAssignmentNameResolution.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: bug24492.js
module.exports.D = class { }
new D()
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportSpecifiers.ts | TypeScript | // @module: esnext
// @declaration: true
// @Filename: /imports.ts
import { type, as, something, foo, bar } from "./exports.js";
type;
as; // Error (used in emitting position)
something; // Error (used in emitting position)
foo; // Error (used in emitting position)
bar; // Error (used in emitting position)
// @Filena... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportSpecifiers_js.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: ./a.js
const foo = 0;
export { type foo };
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportSpellingSuggestion.ts | TypeScript | // @filename: a.ts
export function assertNever(x: never, msg: string) {
throw new Error("Unexpected " + msg);
}
// @filename: b.ts
import { assertNevar } from "./a";
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportStar-amd.ts | TypeScript | // @module: amd
// @target: ES5
// @filename: t1.ts
export var x = 1;
export var y = 2;
// @filename: t2.ts
export default "hello";
export function foo() { }
// @filename: t3.ts
var x = "x";
var y = "y";
var z = "z";
export { x, y, z };
// @filename: t4.ts
export * from "./t1";
export * from "./t2";
export * from "... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportStar.ts | TypeScript | // @module: commonjs
// @target: ES5
// @filename: t1.ts
export var x = 1;
export var y = 2;
// @filename: t2.ts
export default "hello";
export function foo() { }
// @filename: t3.ts
var x = "x";
var y = "y";
var z = "z";
export { x, y, z };
// @filename: t4.ts
export * from "./t1";
export * from "./t2";
export * f... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportTypeMergedWithExportStarAsNamespace.ts | TypeScript | // @Filename: usage.ts
import { Something } from "./prelude"
export const myValue: Something<string> = Something.of("abc")
export type MyType = Something.SubType<string>
// @Filename: Something.ts
export type Something<A> = { value: A }
export type SubType<A> = { value: A }
export declare function of<A>(value: A): Som... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportedAliasedEnumTag.ts | TypeScript | // @noemit: true
// @allowjs: true
// @filename: exportedAliasedEnumTag.js
var middlewarify = module.exports = {};
/** @enum */
middlewarify.Type = {
BEFORE: 'before'
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportedEnumTypeAndValue.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: def.js
/** @enum {number} */
const MyEnum = {
a: 1,
b: 2
};
export default MyEnum;
// @Filename: use.js
import MyEnum from "./def";
/** @type {MyEnum} */
const v = MyEnum.b;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/exportsAndImports1-amd.ts | TypeScript | // @module: amd
// @target: ES5
// @filename: t1.ts
var v = 1;
function f() { }
class C {
}
interface I {
}
enum E {
A, B, C
}
const enum D {
A, B, C
}
module M {
export var x;
}
module N {
export interface I {
}
}
type T = number;
import a = M.x;
export { v, f, C, I, E, D, M, N, T, a };
// @file... | 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.