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/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts | TypeScript | module A {
export class Point {
x: number;
y: number;
}
export var Origin: Point = { x: 0, y: 0 };
export class Point3d extends Point {
z: number;
}
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
export class Line<TPoint extends Point>{
constructor(... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.ts | TypeScript | module A {
class Point {
x: number;
y: number;
}
export class points {
[idx: number]: Point;
[idx: string]: Point;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportClassWithInaccessibleTypeInTypeParameterConstraint.ts | TypeScript | module A {
class Point {
x: number;
y: number;
}
export var Origin: Point = { x: 0, y: 0 };
export class Point3d extends Point {
z: number;
}
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
export class Line<TPoint extends Point>{
constructor(public ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts | TypeScript | module A {
export class Point {
x: number;
y: number;
}
export class Line {
constructor(public start: Point, public end: Point) { }
}
export function fromOrigin(p: Point): Line {
return new Line({ x: 0, y: 0 }, p);
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts | TypeScript | module A {
class Point {
x: number;
y: number;
}
export class Line {
constructor(public start: Point, public end: Point) { }
}
export function fromOrigin(p: Point): Line {
return new Line({ x: 0, y: 0 }, p);
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts | TypeScript | module A {
export class Point {
x: number;
y: number;
}
class Line {
constructor(public start: Point, public end: Point) { }
}
export function fromOrigin(p: Point): Line {
return new Line({ x: 0, y: 0 }, p);
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.ts | TypeScript | module A {
export interface Point {
x: number;
y: number;
}
export var Origin: Point = { x: 0, y: 0 };
export interface Point3d extends Point {
z: number;
}
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
export interface Line<TPoint extends Point>{
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts | TypeScript | module A {
interface Point {
x: number;
y: number;
}
export interface points {
[idx: number]: Point;
[idx: string]: Point;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.ts | TypeScript | module A {
interface Point {
x: number;
y: number;
}
export var Origin: Point = { x: 0, y: 0 };
export interface Point3d extends Point {
z: number;
}
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
export interface Line<TPoint extends Point>{
new (st... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportModuleWithAccessibleTypesOnItsExportedMembers.ts | TypeScript | module A {
export class Point {
constructor(public x: number, public y: number) { }
}
export module B {
export var Origin: Point = new Point(0, 0);
export class Line {
constructor(start: Point, end: Point) {
}
static fromOrigin(p: Point) {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.ts | TypeScript | module A {
class Point {
constructor(public x: number, public y: number) { }
}
export var Origin: Point = { x: 0, y: 0 };
export var Unity = { start: new Point(0, 0), end: new Point(1, 0) };
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts | TypeScript | module A {
class Point {
constructor(public x: number, public y: number) { }
}
export var UnitSquare : {
top: { left: Point, right: Point },
bottom: { left: Point, right: Point }
} = null;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.ts | TypeScript | module A {
class B {
id: number;
}
export var beez: Array<B>;
export var beez2 = new Array<B>();
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportVariableWithAccessibleTypeInTypeAnnotation.ts | TypeScript | module A {
export interface Point {
x: number;
y: number;
}
// valid since Point is exported
export var Origin: Point = { x: 0, y: 0 };
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ExportVariableWithInaccessibleTypeInTypeAnnotation.ts | TypeScript | module A {
export interface Point {
x: number;
y: number;
}
// valid since Point is exported
export var Origin: Point = { x: 0, y: 0 };
interface Point3d extends Point {
z: number;
}
// invalid Point3d is not exported
export var Origin3d: Point3d = { x: 0, y: ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionAndModuleWithSameNameAndCommonRoot.ts | TypeScript | // @filename: function.ts
module A {
export function Point() {
return { x: 0, y: 0 };
}
}
// @filename: module.ts
module A {
export module Point {
export var Origin = { x: 0, y: 0 };
}
}
// @filename: test.ts
var fn: () => { x: number; y: number };
var fn = A.Point;
var cl: { x: numbe... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionAndModuleWithSameNameAndDifferentCommonRoot.ts | TypeScript | // @filename: function.ts
module A {
export function Point() {
return { x: 0, y: 0 };
}
}
// @filename: module.ts
module B {
export module Point {
export var Origin = { x: 0, y: 0 };
}
}
// @filename: test.ts
var fn: () => { x: number; y: number };
var fn = A.Point;
var cl: { x: numbe... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionDeclaration11_es6.ts | TypeScript | // @target: es6
function * yield() {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionDeclaration13_es6.ts | TypeScript | // @target: es6
function * foo() {
// Legal to use 'yield' in a type context.
var v: yield;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionDeclaration1_es6.ts | TypeScript | // @target: es6
function * foo() {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionDeclaration2_es6.ts | TypeScript | // @target: es6
function f(yield) {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionDeclaration3_es6.ts | TypeScript | // @target: es6
function f(yield = yield) {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionDeclaration4_es6.ts | TypeScript | // @target: es6
function yield() {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionDeclaration6_es6.ts | TypeScript | // @target: es6
function*foo(a = yield) {
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionDeclaration7_es6.ts | TypeScript | // @target: es6
function*bar() {
// 'yield' here is an identifier, and not a yield expression.
function*foo(a = yield) {
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionDeclaration8_es6.ts | TypeScript | var v = { [yield]: foo } | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionDeclaration9_es6.ts | TypeScript | // @target: es6
function * foo() {
var v = { [yield]: foo }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionExpression1_es6.ts | TypeScript | // @target: es6
var v = function * () { } | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionExpression2_es6.ts | TypeScript | // @target: es6
var v = function * foo() { } | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionPropertyAssignments1_es6.ts | TypeScript | // @target: es6
var v = { *foo() { } } | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/FunctionPropertyAssignments5_es6.ts | TypeScript | // @target: es6
var v = { *[foo()]() { } } | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/InvalidNonInstantiatedModule.ts | TypeScript | module M {
export interface Point { x: number; y: number }
}
var m = M; // Error, not instantiated can not be used as var
var x: typeof M; // Error only a namespace
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/MemberFunctionDeclaration1_es6.ts | TypeScript | // @target: es6
class C {
*foo() { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/MemberFunctionDeclaration2_es6.ts | TypeScript | // @target: es6
class C {
public * foo() { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/MemberFunctionDeclaration3_es6.ts | TypeScript | // @target: es6
class C {
*[foo]() { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/MemberFunctionDeclaration7_es6.ts | TypeScript | // @target: es6
class C {
*foo<T>() { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ModuleAndClassWithSameNameAndCommonRoot.ts | TypeScript | // @Filename: module.ts
module X.Y {
export module Point {
export var Origin = new Point(0, 0);
}
}
// @Filename: classPoint.ts
module X.Y {
// duplicate identifier
export class Point {
constructor(x: number, y: number) {
this.x = x;
this.y = y;
}
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ModuleAndEnumWithSameNameAndCommonRoot.ts | TypeScript | module enumdule {
export class Point {
constructor(public x: number, public y: number) { }
}
}
enum enumdule {
Red, Blue
}
var x: enumdule;
var x = enumdule.Red;
var y: { x: number; y: number };
var y = new enumdule.Point(0, 0); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ModuleAndFunctionWithSameNameAndCommonRoot.ts | TypeScript | // @filename: module.ts
module A {
export module Point {
export var Origin = { x: 0, y: 0 };
}
}
// @filename: function.ts
module A {
// duplicate identifier error
export function Point() {
return { x: 0, y: 0 };
}
}
// @filename: simple.ts
module B {
export module Point {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ModuleWithExportedAndNonExportedClasses.ts | TypeScript | module A {
export class A {
id: number;
name: string;
}
export class AG<T, U>{
id: T;
name: U;
}
class A2 {
id: number;
name: string;
}
class AG2<T, U>{
id: T;
name: U;
}
}
// no errors expected, these are all exported
v... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ModuleWithExportedAndNonExportedEnums.ts | TypeScript | module A {
export enum Color { Red, Blue }
enum Day { Monday, Tuesday }
}
// not an error since exported
var a: A.Color = A.Color.Red;
// error not exported
var b = A.Day.Monday;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ModuleWithExportedAndNonExportedFunctions.ts | TypeScript | module A {
export function fn(s: string) {
return true;
}
export function fng<T, U>(s: T): U {
return null;
}
function fn2(s: string) {
return false;
}
function fng2<T, U>(s: T): U {
return null;
}
}
// these should not be errors since the functions a... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ModuleWithExportedAndNonExportedImportAlias.ts | TypeScript | module A {
export interface Point {
x: number;
y: number;
}
interface Point3d extends Point {
z: number;
}
}
module B {
export class Line {
constructor(public start: A.Point, public end: A.Point) { }
}
}
module Geometry {
export import Points = A;
impor... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/ModuleWithExportedAndNonExportedVariables.ts | TypeScript | module A {
export var x = 'hello world'
var y = 12;
}
var x: string;
var x = A.x;
// Error, since y is not exported
var y = A.y;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/Protected3.ts | TypeScript | class C {
protected constructor() { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/Protected5.ts | TypeScript | class C {
protected static m() { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/Protected8.ts | TypeScript | interface I {
protected
p
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/Protected9.ts | TypeScript | class C {
constructor(protected p) { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TupleType1.ts | TypeScript | var v: [number] | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TupleType2.ts | TypeScript | var v: [number, string] | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TupleType3.ts | TypeScript | var v: [] | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TupleType5.ts | TypeScript | var v: [number,] | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.ts | TypeScript | module A {
export class Point {
x: number;
y: number;
}
}
module A {
class Point {
fromCarthesian(p: A.Point) {
return { x: p.x, y: p.y };
}
}
}
// ensure merges as expected
var p: { x: number; y: number; };
var p: A.Point;
module X.Y.Z {
export class L... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts | TypeScript | module A {
export interface Point {
x: number;
y: number;
toCarth(): Point;
}
}
module A {
interface Point {
fromCarth(): Point;
}
}
// ensure merges as expected
var p: { x: number; y: number; toCarth(): A.Point; };
var p: A.Point;
module X.Y.Z {
export interface L... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.ts | TypeScript | //@filename: part1.ts
module A {
export interface Point {
x: number;
y: number;
}
export module Utils {
export function mirror<T extends Point>(p: T) {
return { x: p.y, y: p.x };
}
}
export var Origin: Point = { x: 0, y: 0 };
}
//@filename: part2.ts
modu... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts | TypeScript | module A {
export class Point {
x: number;
y: number;
}
}
module A{
// expected error
export class Point {
origin: number;
angle: number;
}
}
module X.Y.Z {
export class Line {
length: number;
}
}
module X {
export module Y {
export modu... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts | TypeScript | module A {
export interface Point {
x: number;
y: number;
toCarth(): Point;
}
}
module A {
export interface Point {
fromCarth(): Point;
}
}
// ensure merges as expected
var p: { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; };
var p: A.Point;
module X... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.ts | TypeScript | //@filename: part1.ts
export module A {
export interface Point {
x: number;
y: number;
}
export module Utils {
export function mirror<T extends Point>(p: T) {
return { x: p.y, y: p.x };
}
}
export var Origin: Point = { x: 0, y: 0 };
}
//@filename: part2... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.ts | TypeScript | module A.B {
export var x: number;
}
module A{
module B {
export var x: string;
}
}
// ensure the right var decl is exported
var x: number;
var x = A.B.x;
module X.Y.Z {
export class Line {
length: number;
}
}
module X {
export module Y {
module Z {
expor... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.ts | TypeScript | //@filename: part1.ts
module Root {
export module A {
export interface Point {
x: number;
y: number;
}
export module Utils {
export function mirror<T extends Point>(p: T) {
return { x: p.y, y: p.x };
}
}
}
}
//@fil... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TwoInternalModulesWithTheSameNameAndSameCommonRoot.ts | TypeScript | //@filename: part1.ts
module A {
export interface Point {
x: number;
y: number;
}
export module Utils {
export function mirror<T extends Point>(p: T) {
return { x: p.y, y: p.x };
}
}
}
//@filename: part2.ts
module A {
export var Origin: Point = { x: 0, y... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TypeGuardWithArrayUnion.ts | TypeScript | class Message {
value: string;
}
function saySize(message: Message | Message[]) {
if (message instanceof Array) {
return message.length; // Should have type Message[] here
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/TypeGuardWithEnumUnion.ts | TypeScript | enum Color { R, G, B }
function f1(x: Color | string) {
if (typeof x === "number") {
var y = x;
var y: Color;
}
else {
var z = x;
var z: string;
}
}
function f2(x: Color | string | string[]) {
if (typeof x === "object") {
var y = x;
var y: string[];
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/VariableDeclaration10_es6.ts | TypeScript | // @target:es6
let a: number = 1 | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/VariableDeclaration12_es6.ts | TypeScript | // @target:es6
let
x | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/VariableDeclaration3_es6.ts | TypeScript | // @target:es6
const a = 1 | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/VariableDeclaration5_es6.ts | TypeScript | // @target:es6
const a: number = 1 | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/VariableDeclaration6_es6.ts | TypeScript | // @target:es6
let | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/VariableDeclaration7_es6.ts | TypeScript | // @target:es6
let a | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/VariableDeclaration8_es6.ts | TypeScript | // @target:es6
let a = 1 | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/VariableDeclaration9_es6.ts | TypeScript | // @target:es6
let a: number | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldExpression10_es6.ts | TypeScript | // @target: es6
var v = { * foo() {
yield(foo);
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldExpression11_es6.ts | TypeScript | // @target: es6
class C {
*foo() {
yield(foo);
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldExpression13_es6.ts | TypeScript | // @target: es6
function* foo() { yield } | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldExpression19_es6.ts | TypeScript | // @target: es6
function*foo() {
function bar() {
function* quux() {
yield(foo);
}
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldExpression1_es6.ts | TypeScript | // @target: es6
yield; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldExpression3_es6.ts | TypeScript | // @target: es6
function* foo() {
yield
yield
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldExpression4_es6.ts | TypeScript | // @target: es6
function* foo() {
yield;
yield;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldExpression6_es6.ts | TypeScript | // @target: es6
function* foo() {
yield*foo
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldExpression7_es6.ts | TypeScript | // @target: es6
function* foo() {
yield foo
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldExpression8_es6.ts | TypeScript | // @target: es6
yield(foo);
function* foo() {
yield(foo);
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldExpression9_es6.ts | TypeScript | // @target: es6
var v = function*() {
yield(foo);
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldStarExpression1_es6.ts | TypeScript | // @target: es6
yield * []; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/YieldStarExpression4_es6.ts | TypeScript | // @target: es6
function *g() {
yield * [];
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/abstractProperty.ts | TypeScript | // @target: es2015,esnext
// @useDefineForClassFields: true
abstract class A {
protected abstract x: string;
public foo() {
console.log(this.x);
}
}
class B extends A {
protected x = 'B.x';
}
class C extends A {
protected get x() { return 'C.x' };
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/accessorWithES5.ts | TypeScript | // @target: ES5
class C {
get x() {
return 1;
}
}
class D {
set x(v) {
}
}
var x = {
get a() { return 1 }
}
var y = {
set b(v) { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/accessorWithMismatchedAccessibilityModifiers.ts | TypeScript | // @target: ES5
class C {
get x() {
return 1;
}
private set x(v) {
}
}
class D {
protected get x() {
return 1;
}
private set x(v) {
}
}
class E {
protected set x(v) {
}
get x() {
return 1;
}
}
class F {
protected static set x(v) {
}
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/accessorsAreNotContextuallyTyped.ts | TypeScript | // accessors are not contextually typed
class C {
set x(v: (a: string) => string) {
}
get x() {
return (x: string) => "";
}
}
var c: C;
var r = c.x(''); // string | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/accessorsOverrideMethod.ts | TypeScript | // @target: esnext
// @useDefineForClassFields: true
class A {
m() { }
}
class B extends A {
get m() { return () => 1 }
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty.ts | TypeScript | // @target: esnext
// @useDefineForClassFields: true
class A {
p = 'yep'
}
class B extends A {
get p() { return 'oh no' } // error
}
class C {
p = 101
}
class D extends C {
_secret = 11
get p() { return this._secret } // error
set p(value) { this._secret = value } // error
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty2.ts | TypeScript | // @target: esnext
// @useDefineForClassFields: true
class Base {
x = 1;
}
class Derived extends Base {
get x() { return 2; } // should be an error
set x(value) { console.log(`x was set to ${value}`); }
}
const obj = new Derived(); // nothing printed
console.log(obj.x); // number
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty3.ts | TypeScript | // @target: esnext
// @useDefineForClassFields: true
declare class Animal {
sound: string
}
class Lion extends Animal {
_sound = 'grrr'
get sound() { return this._sound } // error here
set sound(val) { this._sound = val }
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty4.ts | TypeScript | // @target: esnext
// @useDefineForClassFields: true
declare class Animal {
sound: string;
}
class Lion extends Animal {
_sound = 'roar'
get sound(): string { return this._sound }
set sound(val: string) { this._sound = val }
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty5.ts | TypeScript | // @target: esnext
// @useDefineForClassFields: true
interface I {
p: number
}
interface B extends I { }
class B { }
class C extends B {
get p() { return 1 }
set p(value) { }
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty6.ts | TypeScript | // @target: esnext
// @useDefineForClassFields: false
class A {
p = 'yep'
}
class B extends A {
get p() { return 'oh no' } // error
}
class C {
p = 101
}
class D extends C {
_secret = 11
get p() { return this._secret } // error
set p(value) { this._secret = value } // error
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty8.ts | TypeScript | // @target: es2019
type Types = 'boolean' | 'unknown' | 'string';
type Properties<T extends { [key: string]: Types }> = {
readonly [key in keyof T]: T[key] extends 'boolean' ? boolean : T[key] extends 'string' ? string : unknown
}
type AnyCtor<P extends object> = new (...a: any[]) => P
declare function classWith... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/accessorsOverrideProperty9.ts | TypeScript | // @strict: true
// @target: es2017
// #41347, based on microsoft/rushstack
// Mixin utilities
export type Constructor<T = {}> = new (...args: any[]) => T;
export type PropertiesOf<T> = { [K in keyof T]: T[K] };
interface IApiItemConstructor extends Constructor<ApiItem>, PropertiesOf<typeof ApiItem> {}
// Base class... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/additionOperatorWithAnyAndEveryType.ts | TypeScript | function foo() { }
class C {
public a: string;
static foo() { }
}
enum E { a, b, c }
module M { export var a }
var a: any;
var b: boolean;
var c: number;
var d: string;
var e: Object;
// any as left operand, result is type Any except plusing string
var r1 = a + a;
var r2 = a + b;
var r3 = a + c;
var r4 = a + ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/additionOperatorWithConstrainedTypeParameter.ts | TypeScript | // test for #17069
function sum<T extends Record<K, number>, K extends string>(n: number, v: T, k: K) {
n = n + v[k];
n += v[k]; // += should work the same way
}
function realSum<T extends Record<K, number>, K extends string>(n: number, vs: T[], k: K) {
for (const v of vs) {
n = n + v[k];
n ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/additionOperatorWithInvalidOperands.ts | TypeScript | function foo() { }
class C {
public a: string;
static foo() { }
}
enum E { a, b, c }
module M { export var a }
var a: boolean;
var b: number;
var c: Object;
var d: Number;
// boolean + every type except any and string
var r1 = a + a;
var r2 = a + b;
var r3 = a + c;
// number + every type except any and strin... | 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.