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/jsdocImportTypeReferenceToESModule.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: ex.d.ts
export var config: {}
// @Filename: test.js
/** @param {import('./ex')} a */
function demo(a) {
a.config
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocImportTypeReferenceToStringLiteral.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: b.js
export const FOO = "foo";
// @Filename: a.js
/** @type {import('./b').FOO} */
let x;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocIndexSignature.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: indices.js
/** @type {Object.<string, number>} */
var o1;
/** @type {Object.<number, boolean>} */
var o2;
/** @type {Object.<boolean, string>} */
var o3;
/** @param {Object.<string, boolean>} o */
function f(o) {
o.foo = 1; // error
o.bar = fals... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocInvalidTokens.ts | TypeScript | // @Filename: jsdocInvalidTokens.js
// @strict: true
// @allowJs: true
// @checkJs: true
// @noEmit: true
/**
*
* unicode-escape = "\u{abcdefghi}" -- should not have error for invalid unicode escape
* unicode-escape2 = "qq\u{abcdefghi}" -- no error here either
* quoted-pair = "\" -- should not have error for inval... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocLinkTag1.ts | TypeScript | // @noUnusedLocals: true
// @filename: /a.ts
export interface A {}
// @filename: /b.ts
import type { A } from "./a";
/** {@link A} */
export interface B {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocLinkTag2.ts | TypeScript | // @noUnusedLocals: true
// @checkJs: true
// @allowJs: true
// @target: esnext
// @noEmit: true
// @filename: /a.js
export class A {}
// @filename: /b.js
import { A } from "./a";
/** {@link A} */
export class B {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocLinkTag3.ts | TypeScript | // @noUnusedLocals: true
// @filename: /a.ts
export interface A {}
// @filename: /b.ts
import type { A } from "./a";
/**
* @param {number} a - see {@link A}
*/
export function foo(a: string) {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocLinkTag4.ts | TypeScript | // @noUnusedLocals: true
// @filename: /a.ts
export interface A {}
// @filename: /b.ts
import * as a from "./a";
/**
* @param {number} a - see {@link a.A}
*/
export function foo(a: string) {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocLinkTag5.ts | TypeScript | // @noUnusedLocals: true
// @filename: /a.ts
/** {@link UNRESOLVED_LINK} */
export interface A {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocLinkTag6.ts | TypeScript | // @filename: /a.ts
class A {
foo() {}
}
class B extends A {
/**
* @override {@link A.foo}
*/
foo() {}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocLinkTag7.ts | TypeScript | // @checkJs: true
// @allowJs: true
// @target: esnext
// @noEmit: true
// @filename: /a.js
class Foo {
/**
* {@linkcode this.a}
* {@linkcode this.#c}
*
* {@link this.a}
* {@link this.#c}
*
* {@linkplain this.a}
* {@linkplain this.#c}
*/
a() { }
b() { }
#c() ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocLinkTag8.ts | TypeScript | // @checkJs: true
// @allowJs: true
// @target: esnext
// @noEmit: true
// @filename: /a.js
/** {@link Map.delete} */
const remove = (map, key) => {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocLiteral.ts | TypeScript | // @allowJs: true
// @filename: in.js
// @outFile: out.js
/**
* @param {'literal'} p1
* @param {"literal"} p2
* @param {'literal' | 'other'} p3
* @param {'literal' | number} p4
* @param {12 | true | 'str'} p5
*/
function f(p1, p2, p3, p4, p5) {
return p1 + p2 + p3 + p4 + p5 + '.';
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocNeverUndefinedNull.ts | TypeScript | // @allowJs: true
// @filename: in.js
// @outFile: out.js
/**
* @param {never} p1
* @param {undefined} p2
* @param {null} p3
* @returns {void} nothing
*/
function f(p1, p2, p3) {
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocOuterTypeParameters1.ts | TypeScript | // @checkjs: true
// @filename: jsdocOuterTypeParameters1.js
/** @return {T} */
const dedupingMixin = function(mixin) {};
/** @template {T} */
const PropertyAccessors = dedupingMixin(() => {
class Bar {
static bar() { this.prototype.foo(); }
}
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocOuterTypeParameters2.ts | TypeScript | // @checkjs: true
// @filename: jsdocOuterTypeParameters1.js
/** @return {T} */
const dedupingMixin = function(mixin) {};
/** @template T */
const PropertyAccessors = dedupingMixin(() => {
class Bar {
static bar() { this.prototype.foo(); }
}
});
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocOuterTypeParameters3.ts | TypeScript | // @checkjs: true
// @filename: jsdocOuterTypeParameters3.js
/** @template {T} */
class Baz {
m() {
class Bar {
static bar() { this.prototype.foo(); }
}
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocOverrideTag1.ts | TypeScript | // @allowJS: true
// @checkJS: true
// @noEmit: true
// @noImplicitOverride: true
// @Filename: 0.js
class A {
/**
* @method
* @param {string | number} a
* @returns {boolean}
*/
foo (a) {
return typeof a === 'string'
}
bar () {
}
}
class B extends A {
/**
* @... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocParamTag2.ts | TypeScript | // @allowJS: true
// @checkJS: true
// @noEmit: true
// @Filename: 0.js
// Object literal syntax
/**
* @param {{a: string, b: string}} obj
* @param {string} x
*/
function good1({a, b}, x) {}
/**
* @param {{a: string, b: string}} obj
* @param {{c: number, d: number}} OBJECTION
*/
function good2({a, b}, {c, d}) {}... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocParamTagTypeLiteral.ts | TypeScript | // @allowJS: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @suppressOutputPathCheck: true
// @Filename: 0.js
/**
* @param {Object} notSpecial
* @param {string} unrelated - not actually related because it's not notSpecial.unrelated
*/
function normal(notSpecial) {
notSpecial; // should just be 'Obj... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocParseBackquotedParamName.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: a.js
/**
* @param {string=} `args`
* @param `bwarg` {?number?}
*/
function f(args, bwarg) {
}
// @Filename: ts.ts
/**
* @param `arg` - this is fine
*/
function g(arg: string) {
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocParseDotDotDotInJSDocFunction.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: a.js
// from bcryptjs
/** @param {function(...[*])} callback */
function g(callback) {
callback([1], [2], [3])
}
/**
* @type {!function(...number):string}
* @inner
*/
var stringFromCharCode = String.fromCharCode;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocParseHigherOrderFunction.ts | TypeScript | // @noemit: true
// @allowjs: true
// @checkjs: true
// @strict: true
// @Filename: paren.js
/** @type {function((string), function((string)): string): string} */
var x = (s, id) => id(s)
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocParseMatchingBackticks.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: jsdocParseMatchingBackticks.js
/**
* `@param` initial at-param is OK in title comment
* @param {string} x hi there `@param`
* @param {string} y hi there `@ * param
* this is the margin
* so we'l... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocParseParenthesizedJSDocParameter.ts | TypeScript | // @noemit: true
// @allowjs: true
// @checkjs: true
// @strict: true
// @Filename: paren.js
/** @type {function((string)): string} */
var x = s => s.toString()
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocParseStarEquals.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: a.js
/** @param {...*=} args
@return {*=} */
function f(...args) {
return null
}
/** @type *= */
var x;
/** @param {function():*=} f */
function cbf(f) {
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocPostfixEqualsAddsOptionality.ts | TypeScript | // @Filename: a.js
// @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
/** @param {number=} a */
function f(a) {
a = 1
a = null // should not be allowed
a = undefined
}
f()
f(null) // should not be allowed
f(undefined)
f(1)
/** @param {???!?number?=} a */
function g(a) {
a = 1
a =... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocPrefixPostfixParsing.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @strictNullChecks: true
// @noImplicitAny: true
// @Filename: prefixPostfix.js
/**
* @param {number![]} x - number[]
* @param {!number[]} y - number[]
* @param {(number[])!} z - number[]
* @param {number?[]} a - parse error without parentheses
* @param {?nu... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocPrivateName1.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @lib: dom,esnext
// @Filename: jsdocPrivateName1.js
// @target: es2015
class A {
/** @type {boolean} some number value */
#foo = 3 // Error because not assignable to boolean
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocPrivateName2.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @lib: dom,esnext
// @Filename: jsdocPrivateName1.js
// Expecting parse error for private field
/**
* @typedef A
* @type {object}
* @property {string} #id
*/
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocPrototypePropertyAccessWithType.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: /a.js
function C() { this.x = false; };
/** @type {number} */
C.prototype.x;
new C().x;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocReadonly.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @target: esnext
// @noEmit: true
// @Filename: jsdocReadonly.js
class LOL {
/**
* @readonly
* @private
* @type {number}
* Order rules do not apply to JSDoc
*/
x = 1
/** @readonly */
y = 2
/** @readonly Definitely not here */
static... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocReadonlyDeclarations.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @target: esnext
// @outFile: foo.js
// @declaration: true
// @Filename: jsdocReadonlyDeclarations.js
// @useDefineForClassFields: false
class C {
/** @readonly */
x = 6
/** @readonly */
constructor(n) {
this.x = n
/**
* @readonly
*... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocReturnTag1.ts | TypeScript | // @allowJs: true
// @filename: returns.js
// @outFile: dummy.js
/**
* @returns {string} This comment is not currently exposed
*/
function f() {
return 5;
}
/**
* @returns {string=} This comment is not currently exposed
*/
function f1() {
return 5;
}
/**
* @returns {string|number} This comment is not cur... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocSignatureOnReturnedFunction.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @target: esnext
// @noImplicitAny: true
// @declaration: true
// @outDir: out
// @Filename: jsdocSignatureOnReturnedFunction.js
function f1() {
/**
* @param {number} a
* @param {number} b
* @returns {number}
*/
return (a, b) => {
return a + b;
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateClass.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: templateTagOnClasses.js
/**
* @template T
* @typedef {(t: T) => T} Id
*/
/** @template T */
class Foo {
/** @typedef {(t: T) => T} Id2 */
/** @param {T} x */
constructor (x) {
this.a = x
}
/**
*
* @param {T} x ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateConstructorFunction.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: templateTagOnConstructorFunctions.js
/**
* @template U
* @typedef {(u: U) => U} Id
*/
/**
* @param {T} t
* @template T
*/
function Zet(t) {
/** @type {T} */
this.u
this.t = t
}
/**
* @param {T} v
* @param {Id<T>} id
*/
Zet.prototyp... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateConstructorFunction2.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: templateTagWithNestedTypeLiteral.js
/**
* @param {T} t
* @template T
*/
function Zet(t) {
/** @type {T} */
this.u
this.t = t
}
/**
* @param {T} v
* @param {object} o
* @param {T} o.nested
*/
Zet.prototype.add = function(v, o) {
t... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateTag.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @lib: dom,esnext
// @Filename: forgot.js
/**
* @param {T} a
* @template T
*/
function f(a) {
return () => a
}
let n = f(1)()
/**
* @param {T} a
* @template T
* @returns {function(): T}
*/
function g(a) {
return () => a
}
let s = g('hi')()
/**
* @... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateTag2.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @lib: dom,esnext
// @Filename: github17339.js
var obj = {
/**
* @template T
* @param {T} a
* @returns {T}
*/
x: function (a) {
return a;
},
};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateTag3.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: a.js
/**
* @template {{ a: number, b: string }} T,U A Comment
* @template {{ c: boolean }} V uh ... are comments even supported??
* @template W
* @template X That last one had no comment
* @param {T} t
* @param {U} u
* @param {V} v
* @param {W} ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateTag4.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: a.js
/**
* Should work for function declarations
* @constructor
* @template {string} K
* @template V
*/
function Multimap() {
/** @type {Object<string, V>} TODO: Remove the prototype from the fresh object */
this._map = {}... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateTag5.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: a.js
/**
* Should work for function declarations
* @constructor
* @template {string} K
* @template V
*/
function Multimap() {
/** @type {Object<string, V>} TODO: Remove the prototype from the fresh object */
this._map = {}... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateTag6.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: a.js
/**
* @template const T
* @param {T} x
* @returns {T}
*/
function f1(x) {
return x;
}
const t1 = f1("a");
const t2 = f1(["a", ["b", "c"]]);
const t3 = f1({ a: 1, b: "c", d: ["e", 2, true, { f: "g" }] });
/**
* @template ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateTag7.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: a.js
/**
* @template const T
* @typedef {[T]} X
*/
/**
* @template const T
*/
class C { }
/**
* @template private T
* @param {T} x
* @returns {T}
*/
function f(x) {
return x;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateTag8.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: a.js
/**
* @template out T
* @typedef {Object} Covariant
* @property {T} x
*/
/**
* @type {Covariant<unknown>}
*/
let super_covariant = { x: 1 };
/**
* @type {Covariant<string>}
*/
let sub_covariant = { x: '' };
super_covari... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateTagDefault.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @declaration: true
// @outDir: out
// @Filename: file.js
/**
* @template {string | number} [T=string] - ok: defaults are permitted
* @typedef {[T]} A
*/
/** @type {A} */ // ok, default for `T` in `A` is `string`
const aDefault1 = [""];
/** @type {A} */ // error: `number` is n... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTemplateTagNameResolution.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @outDir: out
// @declaration: true
// @Filename: file.js
/**
* @template T
* @template {keyof T} K
* @typedef {T[K]} Foo
*/
const x = { a: 1 };
/** @type {Foo<typeof x, "a">} */
const y = "a"; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocThisType.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @filename: /types.d.ts
export interface Foo {
foo: () => void;
}
export type M = (this: Foo) => void;
// @filename: /a.js
/** @type {import('./types').M} */
export const f1 = function() {
this.test();
}
/** @type {import('./types').M} */
export functio... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTwoLineTypedef.ts | TypeScript | // Regression from #18301
/**
* @typedef LoadCallback
* @type {function}
*/
type LoadCallback = void;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeDefAtStartOfFile.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: dtsEquivalent.js
/** @typedef {{[k: string]: any}} AnyEffect */
/** @typedef {number} Third */
// @Filename: index.js
/** @type {AnyEffect} */
let b;
/** @type {Third} */
let c;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeFromChainedAssignment.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @noImplicitAny: true
// @Filename: a.js
function A () {
this.x = 1
/** @type {1} */
this.first = this.second = 1
}
/** @param {number} n */
A.prototype.y = A.prototype.z = function f(n) {
return n + this.x
}
/** @param {number} m */
A.s = A.t = fun... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeFromChainedAssignment2.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @noImplicitAny: true
// @Filename: mod.js
/** @param {number} n */
exports.f = exports.g = function fg(n) {
return n + 1
}
/** @param {string} mom */
module.exports.h = module.exports.i = function hi(mom) {
return `hi, ${mom}!`;
}
// @Filename: use.js
va... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeFromChainedAssignment3.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: a.js
exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeReferenceExports.ts | TypeScript | // @allowJs: true
// @noEmit: true
// @checkJs: true
// @Filename: bug27342.js
module.exports = {}
/**
* @type {exports}
*/
var x
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeReferenceToImport.ts | TypeScript | // #34802
// @Filename: jsdocTypeReferenceToImport.js
// @noEmit: true
// @allowJs: true
// @checkJs: true
const C = require('./ex').C;
const D = require('./ex')?.C;
/** @type {C} c */
var c = new C()
c.start
c.end
/** @type {D} c */
var d = new D()
d.start
d.end
// @Filename: ex.d.ts
export class C {
start: num... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeReferenceToImportOfClassExpression.ts | TypeScript | // @noEmit: true
// @allowjs: true
// @checkjs: true
// @Filename: MW.js
/** @typedef {import("./MC")} MC */
class MW {
/**
* @param {MC} compiler the compiler
*/
constructor(compiler) {
this.compiler = compiler;
}
}
module.exports = MW;
// @Filename: MC.js
const MW = require("./MW");
/** @typedef ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeReferenceToImportOfFunctionExpression.ts | TypeScript | // @noEmit: true
// @allowjs: true
// @checkjs: true
// @Filename: MW.js
/** @typedef {import("./MC")} MC */
class MW {
/**
* @param {MC} compiler the compiler
*/
constructor(compiler) {
this.compiler = compiler;
}
}
module.exports = MW;
// @Filename: MC.js
const MW = require("./MW");
/** @typedef ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeReferenceToMergedClass.ts | TypeScript | // https://github.com/microsoft/TypeScript/issues/34685
// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: jsdocTypeReferenceToMergedClass.js
var Workspace = {}
/** @type {Workspace.Project} */
var p;
p.isServiceProject()
Workspace.Project = function wp() { }
Workspace.Project.prototype = {
isServic... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeReferenceToValue.ts | TypeScript | // @Filename: foo.js
// @noEmit: true
// @allowJs: true
// @checkJs: true
/** @param {Image} image */
function process(image) {
return new image(1, 1)
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeReferenceUseBeforeDef.ts | TypeScript | // @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: bug25097.js
/** @type {C | null} */
const c = null
class C {
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeTag.ts | TypeScript | // @allowJS: true
// @suppressOutputPathCheck: true
// @strictNullChecks: true
// @filename: a.js
/** @type {String} */
var S;
/** @type {string} */
var s;
/** @type {Number} */
var N;
/** @type {number} */
var n;
/** @type {Boolean} */
var B;
/** @type {boolean} */
var b;
/** @type {Void} */
var V;
/** @type {... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeTagCast.ts | TypeScript | // @allowJS: true
// @suppressOutputPathCheck: true
// @strictNullChecks: true
// @filename: a.ts
var W: string;
// @filename: b.js
// @ts-check
var W = /** @type {string} */(/** @type {*} */ (4));
var W = /** @type {string} */(4); // Error
/** @type {*} */
var a;
/** @type {string} */
var s;
var a = /** @type {*... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeTagParameterType.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @noImplicitAny: true
// @Filename: a.js
/** @type {function(string): void} */
const f = (value) => {
value = 1 // should error
};
/** @type {(s: string) => void} */
function g(s) {
s = 1 // Should error
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocTypeTagRequiredParameters.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @noImplicitAny: true
// @Filename: a.js
/** @type {function(string): void} */
const f = (value) => {
};
/** @type {(s: string) => void} */
function g(s) {
}
/** @type {{(s: string): void}} */
function h(s) {
}
f() // should error
g() // should e... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocVariableDeclarationWithTypeAnnotation.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @target: esnext
// @noImplicitAny: true
// @outDir: out
// @Filename: foo.js
/** @type {boolean} */
var /** @type {string} */ x,
/** @type {number} */ y;
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsdocVariadicType.ts | TypeScript | // @allowJS: true
// @checkJs: true
// @noEmit: true
// @filename: a.js
/**
* @type {function(boolean, string, ...*):void}
*/
const foo = function (a, b, ...r) { };
// @filename: b.ts
foo(false, '');
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxCheckJsxNoTypeArgumentsAllowed.tsx | TypeScript (TSX) | // @jsx: preserve
// @noLib: true
// @skipLibCheck: true
// @libFiles: react.d.ts,lib.d.ts
// @allowJs: true
// @outDir: ./out
// @checkJs: true
// @filename: component.d.ts
import * as React from "react";
export declare class MyComp<P> extends React.Component<P, {}> {
internalProp: P;
}
export interface Prop {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformChildren.tsx | TypeScript (TSX) | // @jsx: react-jsx,react-jsxdev
// @strict: true
// @module: commonjs
/// <reference path="/.lib/react16.d.ts" />
const a = <div>text</div>;
export {};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformCustomImport.tsx | TypeScript (TSX) | // @jsx: react-jsx,react-jsxdev
// @jsxImportSource: preact
// @strict: true
// @module: commonjs
/// <reference path="/.lib/react16.d.ts" />
const a = <>
<p></p>
text
<div className="foo"></div>
</>
export {}; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformCustomImportPragma.tsx | TypeScript (TSX) | // @jsx: react-jsx,react-jsxdev
// @strict: true
// @module: commonjs
// @filename: preact.tsx
/// <reference path="/.lib/react16.d.ts" />
/* @jsxImportSource preact */
const a = <>
<p></p>
text
<div className="foo"></div>
</>
export {};
// @filename: react.tsx
/// <reference path="/.lib/react16.d.ts" />
/* @jsx... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformKeyProp.tsx | TypeScript (TSX) | // @jsx: react-jsx,react-jsxdev
// @strict: true
// @module: commonjs
/// <reference path="/.lib/react16.d.ts" />
const props = { answer: 42 }
const a = <div key="foo" {...props}>text</div>;
const b = <div {...props} key="bar">text</div>;
export {};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformKeyPropCustomImport.tsx | TypeScript (TSX) | // @jsx: react-jsx,react-jsxdev
// @jsxImportSource: preact
// @strict: true
// @module: commonjs
/// <reference path="/.lib/react16.d.ts" />
const props = { answer: 42 }
const a = <div key="foo" {...props}>text</div>;
const b = <div {...props} key="bar">text</div>;
export {};
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformKeyPropCustomImportPragma.tsx | TypeScript (TSX) | // @jsx: react-jsx,react-jsxdev
// @strict: true
// @module: commonjs
// @filename: preact.tsx
/// <reference path="/.lib/react16.d.ts" />
/* @jsxImportSource preact */
const props = { answer: 42 }
const a = <div key="foo" {...props}>text</div>;
const b = <div {...props} key="bar">text</div>;
export {};
// @filename:... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformNestedSelfClosingChild.tsx | TypeScript (TSX) | // @jsx: react-jsx,react-jsxdev
// @strict: true
// @module: commonjs
/// <reference path="/.lib/react16.d.ts" />
import type * as React from 'react';
console.log(
<div>
<div />
</div>
)
console.log(
<div>
<div />
<div />
</div>
)
console.log(
<div>
{[1, 2].map(i => <div key={i}>{i}</div>)}... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformSubstitutesNames.tsx | TypeScript (TSX) | // @jsx: react-jsx,react-jsxdev
// @strict: true
// @module: commonjs
/// <reference path="/.lib/react16.d.ts" />
const a = <div></div>
export {}; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxJsxsCjsTransformSubstitutesNamesFragment.tsx | TypeScript (TSX) | // @jsx: react-jsx,react-jsxdev
// @strict: true
// @module: commonjs
/// <reference path="/.lib/react16.d.ts" />
const a = <>
<p></p>
text
<div></div>
</>
export {}; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxParsingError4.tsx | TypeScript (TSX) | // @strict: true, false
// @jsx: react
// @filename: a.tsx
declare const React: any
declare namespace JSX {
interface IntrinsicElements {
[k: string]: any
}
}
const a = (
<public-foo></public-foo>
);
const b = (
<public></public>
);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxReactTestSuite.tsx | TypeScript (TSX) | // @jsx: preserve
declare var React: any;
declare var Component:any;
declare var Composite:any;
declare var Composite2:any;
declare var Child:any;
declare var Namespace:any;
declare var foo: any;
declare var bar: any;
declare var y:any;
declare var x:any;
declare var z:any;
declare var hasOwnProperty:any;
<div>text</... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/jsxSpreadOverwritesAttributeStrict.tsx | TypeScript (TSX) | // @filename: file.tsx
// @jsx: preserve
// @strict: true
// @noLib: true
// @skipLibCheck: true
// @libFiles: react.d.ts,lib.d.ts
import React = require('react');
interface Props {
a: number;
b: number;
c?: number;
d?: number;
}
const props: Props = { a: 1, b: 1 };
const Foo = (props: Props) => <di... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/keyofAndForIn.ts | TypeScript | // @declaration: true
// Repro from #12513
function f1<K extends string, T>(obj: { [P in K]: T }, k: K) {
const b = k in obj;
let k1: K;
for (k1 in obj) {
let x1 = obj[k1];
}
for (let k2 in obj) {
let x2 = obj[k2];
}
}
function f2<T>(obj: { [P in keyof T]: T[P] }, k: keyof T) ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/keyofAndIndexedAccess.ts | TypeScript | // @strictNullChecks: true
// @declaration: true
class Shape {
name: string;
width: number;
height: number;
visible: boolean;
}
class TaggedShape extends Shape {
tag: string;
}
class Item {
name: string;
price: number;
}
class Options {
visible: "yes" | "no";
}
type Dictionary<T> = ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/keyofAndIndexedAccess2.ts | TypeScript | // @strict: true
// @target: esnext
function f1(obj: { a: number, b: 0 | 1, c: string }, k0: 'a', k1: 'a' | 'b', k2: 'a' | 'b' | 'c') {
obj[k0] = 1;
obj[k0] = 2;
obj[k0] = 'x'; // Error
obj[k1] = 1;
obj[k1] = 2; // Error
obj[k1] = 'x'; // Error
obj[k2] = 1; // Error
obj[k2] = 2;... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/keyofAndIndexedAccessErrors.ts | TypeScript | class Shape {
name: string;
width: number;
height: number;
visible: boolean;
}
type Dictionary<T> = { [x: string]: T };
type T00 = keyof K0; // Error
type T01 = keyof Object;
type T02 = keyof keyof Object;
type T03 = keyof keyof keyof Object;
type T04 = keyof keyof keyof keyof Object;
type T05 = key... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/keyofInferenceIntersectsResults.ts | TypeScript | interface X {
a: string;
b: string;
}
declare function foo<T = X>(x: keyof T, y: keyof T): T;
declare function bar<T>(x: keyof T, y: keyof T): T;
const a = foo<X>('a', 'b'); // compiles cleanly
const b = foo('a', 'b'); // also clean
const c = bar('a', 'b'); // still clean | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/keyofInferenceLowerPriorityThanReturn.ts | TypeScript | // #22736
declare class Write {
protected dummy: Write;
}
declare class Col<s, a> {
protected dummy: [Col<s, a>, s, a];
}
declare class Table<Req, Def> {
protected dummy: [Table<Req, Def>, Req, Def];
}
type MakeTable<T1 extends object, T2 extends object> = {
[P in keyof T1]: Col<Write, T1[P]>;
} & {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/keyofIntersection.ts | TypeScript | // @strict: true
// @declaration: true
type A = { a: string };
type B = { b: string };
type T01 = keyof (A & B); // "a" | "b"
type T02<T> = keyof (T & B); // "b" | keyof T
type T03<U> = keyof (A & U); // "a" | keyof U
type T04<T, U> = keyof (T & U); // keyof T | keyof U
type T05 = T02<A>; // "a" | "b"
type T06 =... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/lateBoundAssignmentDeclarationSupport1.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @target: es6
// @filename: lateBoundAssignmentDeclarationSupport1.js
// currently unsupported
const _sym = Symbol();
const _str = "my-fake-sym";
exports[_sym] = "ok";
exports[_str] = "ok";
exports.S = _sym;
// @filename: usage.js
const x = requir... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/lateBoundAssignmentDeclarationSupport2.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @target: es6
// @filename: lateBoundAssignmentDeclarationSupport2.js
// currently unsupported
const _sym = Symbol();
const _str = "my-fake-sym";
module.exports[_sym] = "ok";
module.exports[_str] = "ok";
module.exports.S = _sym;
// @filename: usag... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/lateBoundAssignmentDeclarationSupport3.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @target: es6
// @filename: lateBoundAssignmentDeclarationSupport3.js
// currently unsupported
const _sym = Symbol();
const _str = "my-fake-sym";
Object.defineProperty(module.exports, _sym, { value: "ok" });
Object.defineProperty(module.exports, _... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/lateBoundAssignmentDeclarationSupport4.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @target: es6
// @filename: lateBoundAssignmentDeclarationSupport4.js
// currently unsupported
const _sym = Symbol();
const _str = "my-fake-sym";
function F() {
}
F.prototype[_sym] = "ok";
F.prototype[_str] = "ok";
const inst = new F();
const _y ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/lateBoundAssignmentDeclarationSupport5.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @target: es6
// @filename: lateBoundAssignmentDeclarationSupport5.js
// currently unsupported
const _sym = Symbol();
const _str = "my-fake-sym";
function F() {
}
F.prototype = {
[_sym]: "ok",
[_str]: "ok"
}
const inst = new F();
const _y... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/lateBoundAssignmentDeclarationSupport6.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @target: es6
// @filename: lateBoundAssignmentDeclarationSupport6.js
// currently unsupported
const _sym = Symbol();
const _str = "my-fake-sym";
function F() {
}
F.prototype.defsAClass = true;
Object.defineProperty(F.prototype, _str, {value: "ok"... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/lateBoundAssignmentDeclarationSupport7.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @target: es6
// @filename: lateBoundAssignmentDeclarationSupport7.js
const _sym = Symbol();
const _str = "my-fake-sym";
function F() {
}
F[_sym] = "ok";
F[_str] = "ok";
module.exports.F = F;
module.exports.S = _sym;
// @filename: usage.js
const x... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/lateBoundClassMemberAssignmentJS.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @emitDeclarationOnly: true
// @strict: true
// @target: es6
// @declaration: true
// @filename: lateBoundClassMemberAssignmentJS.js
const _sym = Symbol("_sym");
export class MyClass {
constructor() {
this[_sym] = "ok";
}
method() {
this[_sym] = "yep";
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/lateBoundClassMemberAssignmentJS2.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @emitDeclarationOnly: true
// @strict: true
// @target: es6
// @declaration: true
// @filename: lateBoundClassMemberAssignmentJS2.js
const _sym = "my-fake-sym";
export class MyClass {
constructor() {
this[_sym] = "ok";
}
method() {
this[_sym] = "yep";
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/lateBoundClassMemberAssignmentJS3.ts | TypeScript | // @allowJs: true
// @checkJs: true
// @emitDeclarationOnly: true
// @strict: true
// @target: es6
// @declaration: true
// @filename: lateBoundClassMemberAssignmentJS.js
const _sym = Symbol("_sym");
export class MyClass {
constructor() {
var self = this
self[_sym] = "ok";
}
method() {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/leaveOptionalParameterAsWritten.ts | TypeScript | // @module: esnext
// @outDir: dist
// @declaration: true
// @emitDeclarationOnly: true
// @strictNullChecks: true
// @Filename: a.ts
export interface Foo {}
// @Filename: b.ts
import * as a from "./a";
declare global {
namespace teams {
export namespace calling {
export import Foo = a.Foo;
}
}
}
/... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/letIdentifierInElementAccess01.ts | TypeScript | var let: any = {};
(let[0] = 100); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/libReferenceDeclarationEmit.ts | TypeScript | // @target: esnext
// @module: commonjs
// @lib: esnext
// @declaration: true
// @filename: file1.ts
/// <reference lib="dom" preserve="true" />
export declare const elem: HTMLElement;
// @filename: file2.ts
/// <reference lib="dom" preserve="true" />
export {}
declare const elem: HTMLElement; | 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.