Skip to content

Commit

Permalink
Update fixtures (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing authored Jul 8, 2024
1 parent 5e6c87a commit 2c5f452
Show file tree
Hide file tree
Showing 4 changed files with 11,725 additions and 40 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ Oxc is at least 20 times faster than tsc.
* simple.ts (5kb, 156 loc) - copied from https://github.com/microsoft/TypeScript/blob/main/tests/cases/transpile
* vue.ts (31kb, 1185 loc) - some files combined from the vue repository
* vue-large.ts (320kb, 11702 loc) - all vue files combined
* typescript.ts (462, 11719 lines) - copied from https://github.com/microsoft/TypeScript/blob/main/src/compiler/utilities.ts
30 changes: 0 additions & 30 deletions fixtures/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export class Bar {
protected f: string;
private g: string;
["h"]: string;
[i]: string;
}

export abstract class Baz {
Expand Down Expand Up @@ -55,55 +54,37 @@ export function fnDeclBasic7(p: { a?: string } & number[] = [], rParam: string):
export function fnDeclBasic8(p: (number[] | string[]) | number = [], rParam: string): void { };

export function fnDeclHasUndefined(p: T | undefined = [], rParam: string): void { };
export function fnDeclBad(p: T = [], rParam: string): void { };

export const fnExprOk1 = function (array: number[] = [], rParam: string): void { };
export const fnExprOk2 = function (array: T | undefined = [], rParam: string): void { };
export const fnExprBad = function (array: T = [], rParam: string): void { };

export const arrowOk1 = (array: number[] = [], rParam: string): void => { };
export const arrowOk2 = (array: T | undefined = [], rParam: string): void => { };
export const arrowBad = (array: T = [], rParam: string): void => { };

export const inObjectLiteralFnExprOk1 = { o: function (array: number[] = [], rParam: string): void { } };
export const inObjectLiteralFnExprOk2 = { o: function (array: T | undefined = [], rParam: string): void { } };
export const inObjectLiteralFnExprBad = { o: function (array: T = [], rParam: string): void { } };

export const inObjectLiteralArrowOk1 = { o: (array: number[] = [], rParam: string): void => { } };
export const inObjectLiteralArrowOk2 = { o: (array: T | undefined = [], rParam: string): void => { } };
export const inObjectLiteralArrowBad = { o: (array: T = [], rParam: string): void => { } };

export const inObjectLiteralMethodOk1 = { o(array: number[] = [], rParam: string): void { } };
export const inObjectLiteralMethodOk2 = { o(array: T | undefined = [], rParam: string): void { } };
export const inObjectLiteralMethodBad = { o(array: T = [], rParam: string): void { } };


export class InClassFnExprOk1 { o = function (array: number[] = [], rParam: string): void { } };
export class InClassFnExprOk2 { o = function (array: T | undefined = [], rParam: string): void { } };
export class InClassFnExprBad { o = function (array: T = [], rParam: string): void { } };

export class InClassArrowOk1 { o = (array: number[] = [], rParam: string): void => { } };
export class InClassArrowOk2 { o = (array: T | undefined = [], rParam: string): void => { } };
export class InClassArrowBad { o = (array: T = [], rParam: string): void => { } };

export class InClassMethodOk1 { o(array: number[] = [], rParam: string): void { } };
export class InClassMethodOk2 { o(array: T | undefined = [], rParam: string): void { } };
export class InClassMethodBad { o(array: T = [], rParam: string): void { } };

const x = "";
export function one() {
return {} as typeof x;
}

export function two() {
const y = "";
return {} as typeof y;
}

export function three() {
type Z = string;
return {} as Z;
}

// @fileName: v1.ts
export const v1 = (...a: [n: "n", a: "a"]): {
Expand All @@ -113,17 +94,6 @@ export const v1 = (...a: [n: "n", a: "a"]): {
return null!
}

// @fileName: v2.ts
const n = Symbol();
export const v2 = (...a: [n: "n", a: "a"]): {
/** r rest param */
a: typeof a,
/** module var */
n: typeof n,
} => {
return null!
}

export const object = {
foo: <T extends Set<T> | []>(): void => { },
};
Expand Down
Loading

0 comments on commit 2c5f452

Please sign in to comment.