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_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-array-pattern/input.js | JavaScript | const dec = () => {};
class Foo {
@dec #x() {}
bar() {
([this.#x] = this.baz);
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-array-pattern/output.js | JavaScript | var _call_x, _initProto;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
[
dec,
2,
"x",
function() {}
]
], []));
}
constructor(){
_initProto(this... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-for-of/input.js | JavaScript | const dec = () => {};
class Foo {
@dec #x() {}
bar() {
for (this.#x of this.baz);
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-for-of/output.js | JavaScript | var _call_x, _initProto;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
[
dec,
2,
"x",
function() {}
]
], []));
}
constructor(){
_initProto(this... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-object-pattern/input.js | JavaScript | const dec = () => {};
class Foo {
@dec #x() {}
bar() {
({ x: this.#x } = this.baz);
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-object-pattern/output.js | JavaScript | var _call_x, _initProto;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
[
dec,
2,
"x",
function() {}
]
], []));
}
constructor(){
_initProto(this... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-rest/input.js | JavaScript | const dec = () => {};
class Foo {
@dec #x() {}
bar() {
([...this.#x] = this.baz);
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-rest/output.js | JavaScript | var _call_x, _initProto;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
[
dec,
2,
"x",
function() {}
]
], []));
}
constructor(){
_initProto(this... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-update/input.js | JavaScript | const dec = () => {};
class Foo {
@dec #x() {}
bar() {
this.#x++;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-update/output.js | JavaScript | var _call_x, _initProto;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
[
dec,
2,
"x",
function() {}
]
], []));
}
constructor(){
_initProto(this... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method/input.js | JavaScript | const dec = () => {};
class Foo {
@dec #x() {}
bar() {
this.#x = 123;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method/output.js | JavaScript | var _call_x, _initProto;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
[
dec,
2,
"x",
function() {}
]
], []));
}
constructor(){
_initProto(this... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/super-in-nested-constructor-expression/input.js | JavaScript | const dec = () => {};
@dec
class Foo extends Bar {
constructor() {
let foo = super();
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/super-in-nested-constructor-expression/output.js | JavaScript | var _initClass, _Bar;
const dec = ()=>{};
let _Foo;
class Foo extends (_Bar = Bar) {
static{
({ c: [_Foo, _initClass] } = _apply_decs_2203_r(this, [], [
dec
], _Bar));
}
constructor(){
let foo = super();
}
static{
_initClass();
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/super-in-private-accessor/input.js | JavaScript | const dec = () => {};
class Foo extends Bar {
@dec
get #x() {
return super.foo();
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/super-in-private-accessor/output.js | JavaScript | var _call_x, _initProto;
const dec = ()=>{};
class Foo extends Bar {
static{
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
[
dec,
3,
"x",
function() {
return super.foo();
}
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/super-in-private-method/input.js | JavaScript | const dec = () => {};
class Foo extends Bar {
@dec
#x() {
return super.foo();
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/super-in-private-method/output.js | JavaScript | var _call_x, _initProto;
const dec = ()=>{};
class Foo extends Bar {
static{
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
[
dec,
2,
"x",
function() {
return super.foo();
}
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/valid-expression-formats/input.js | JavaScript | const dec = () => {};
@dec
@call()
@chain.expr()
@(arbitrary + expr)
@(array[expr])
class Foo {
#a;
@dec
@call()
@chain.expr()
@(arbitrary + expr)
@(array[expr])
method() {}
makeClass() {
return class Nested {
@(this.#a)
bar;
}
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/valid-expression-formats/output.js | JavaScript | var _dec, _dec1, _dec2, _dec3, _initClass, _dec4, _dec5, _dec6, _dec7, _initProto;
const dec = ()=>{};
let _Foo;
_dec = call(), _dec1 = chain.expr(), _dec2 = arbitrary + expr, _dec3 = array[expr], _dec4 = call(), _dec5 = chain.expr(), _dec6 = arbitrary + expr, _dec7 = array[expr];
class Foo {
static{
({ e: ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering--to-es2015/accessor-initializers-fields/exec.js | JavaScript | var log = [];
function push(x) {
log.push(x);
return x;
}
function logClassDecoratorRun(a, b, c) {
push(a);
return function (el, { addInitializer }) {
push(b);
addInitializer(function () {
push(c);
});
return el;
};
}
function logAccessorDecoratorRun(a, b, c, d) {
push(a);
return ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering--to-es2015/accessor-method-initializers/exec.js | JavaScript | var log = [];
function push(x) {
log.push(x);
return x;
}
function logClassDecoratorRun(a, b, c) {
push(a);
return function (el, { addInitializer }) {
push(b);
addInitializer(function () {
push(c);
});
return el;
};
}
function logAccessorDecoratorRun(a, b, c, d) {
push(a);
return ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering--to-es2015/accessor-static-accessor-initializers/exec.js | JavaScript | var log = [];
function push(x) { log.push(x); return x; }
function logClassDecoratorRun(a, b, c) {
push(a);
return function (el, { addInitializer }) {
push(b);
addInitializer(function () { push(c); });
return el;
};
}
function logAccessorDecoratorRun(a, b, c, d) {
push(a);
return function (el, ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering--to-es2015/accessor-static-method-initializers/exec.js | JavaScript | var log = [];
function push(x) {
log.push(x);
return x;
}
function logClassDecoratorRun(a, b, c) {
push(a);
return function (el, { addInitializer }) {
push(b);
addInitializer(function () {
push(c);
});
return el;
};
}
function logAccessorDecoratorRun(a, b, c, d) {
push(a);
return ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering--to-es2015/field-initializers-after-methods/exec.js | JavaScript | var counter = 0;
@(x => x)
class A {
foo = (() => {
counter++;
expect(typeof this.method).toBe("function");
expect(this.foo).toBeUndefined();
expect(this.bar).toBeUndefined();
return "foo";
})();
method() {}
bar = (() => {
counter++;
expect(typeof this.method).toBe("function");
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering--to-es2015/field/exec.js | JavaScript | var log = [];
function push(x) { log.push(x); return x; }
function logDecoratorRun(a, b) {
push(a);
return function (el) { push(b); return el; };
}
@logDecoratorRun(0, 21)
@logDecoratorRun(1, 20)
class A {
@logDecoratorRun(2, 17)
@logDecoratorRun(3, 16)
[push(4)];
@logDecoratorRun(5, 13)
@logDecorator... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering--to-es2015/initializers/exec.js | JavaScript | var log = [];
function push(x) { log.push(x); return x; }
function logDecoratorRun(a, b, c) {
push(a);
return function (el, { addInitializer }) {
push(b);
addInitializer(function () { push(c); });
return el;
};
}
@logDecoratorRun(0, 35, 45)
@logDecoratorRun(1, 34, 44)
class A {
@logDecoratorRun(2... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering--to-es2015/static-accessor-method-initializers/exec.js | JavaScript | var log = [];
function push(x) {
log.push(x);
return x;
}
function logClassDecoratorRun(a, b, c) {
push(a);
return function (el, { addInitializer }) {
push(b);
addInitializer(function () {
push(c);
});
return el;
};
}
function logAccessorDecoratorRun(a, b, c, d) {
push(a);
return ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering--to-es2015/static-field-initializers-after-methods/exec.js | JavaScript | var counter = 0;
@(x => x)
class A {
static foo = (() => {
counter++;
expect(typeof this.method).toBe("function");
expect(this.foo).toBeUndefined();
expect(this.bar).toBeUndefined();
return "foo";
})();
static method() {}
static bar = (() => {
counter++;
expect(typeof this.method)... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/accessor-initializers-fields/exec.js | JavaScript | var log = [];
function push(x) {
log.push(x);
return x;
}
function logClassDecoratorRun(a, b, c) {
push(a);
return function (el, { addInitializer }) {
push(b);
addInitializer(function () {
push(c);
});
return el;
};
}
function logAccessorDecoratorRun(a, b, c, d) {
push(a);
return ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/accessor-method-initializers/exec.js | JavaScript | var log = [];
function push(x) {
log.push(x);
return x;
}
function logClassDecoratorRun(a, b, c) {
push(a);
return function (el, { addInitializer }) {
push(b);
addInitializer(function () {
push(c);
});
return el;
};
}
function logAccessorDecoratorRun(a, b, c, d) {
push(a);
return ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/accessor-simple/1/input.js | JavaScript |
@dec1
class A {
@dec2
a() { }
@dec3
static accessor b;
@dec4
static accessor #c;
@dec5
#d() { }
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/accessor-simple/1/output.js | JavaScript | var _initClass, _init_b, _init_c, _get___c, _set___c, _call_d, _initProto, _initStatic;
let _A;
new class extends _identity {
constructor(){
super(_A), _initClass();
}
static{
class A {
static{
({ e: [_init_b, _init_c, _get___c, _set___c, _call_d, _initProto, _ini... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/accessor-static-accessor-initializers/exec.js | JavaScript | var log = [];
function push(x) { log.push(x); return x; }
function logClassDecoratorRun(a, b, c) {
push(a);
return function (el, { addInitializer }) {
push(b);
addInitializer(function () { push(c); });
return el;
};
}
function logAccessorDecoratorRun(a, b, c, d) {
push(a);
return function (el, ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/accessor-static-method-initializers/exec.js | JavaScript | var log = [];
function push(x) {
log.push(x);
return x;
}
function logClassDecoratorRun(a, b, c) {
push(a);
return function (el, { addInitializer }) {
push(b);
addInitializer(function () {
push(c);
});
return el;
};
}
function logAccessorDecoratorRun(a, b, c, d) {
push(a);
return ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/accessor-static-method-initializers/input.js | JavaScript | @logClassDecoratorRun(0, 19, 29)
@logClassDecoratorRun(1, 18, 28)
class A {
static {
A.b(), A.#c();
}
@logAccessorDecoratorRun(2, 15, 31, 35)
@logAccessorDecoratorRun(3, 14, 30, 34)
accessor a;
@logMethodDecoratorRun(4, 11, 21, 25)
@logMethodDecoratorRun(5, 10, 20, 24)
static b... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/accessor-static-method-initializers/output.js | JavaScript | var _dec, _dec1, _initClass, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _init_a, _call_c, _init_d, _get___d, _set___d, _initProto, _initStatic;
let _A;
_dec = logClassDecoratorRun(0, 19, 29), _dec1 = logClassDecoratorRun(1, 18, 28), _dec2 = logAccessorDecoratorRun(2, 15, 31, 35), _dec3 = logAccessorDecorat... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/field-initializers-after-methods/exec.js | JavaScript | var counter = 0;
@(x => x)
class A {
foo = (() => {
counter++;
expect(typeof this.method).toBe("function");
expect(this.foo).toBeUndefined();
expect(this.bar).toBeUndefined();
return "foo";
})();
method() {}
bar = (() => {
counter++;
expect(typeof this.method).toBe("function");
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/field/exec.js | JavaScript | var log = [];
function push(x) { log.push(x); return x; }
function logDecoratorRun(a, b) {
push(a);
return function (el) { push(b); return el; };
}
@logDecoratorRun(0, 21)
@logDecoratorRun(1, 20)
class A {
@logDecoratorRun(2, 17)
@logDecoratorRun(3, 16)
[push(4)];
@logDecoratorRun(5, 13)
@logDecorator... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/initializers/exec.js | JavaScript | var log = [];
function push(x) { log.push(x); return x; }
function logDecoratorRun(a, b, c) {
push(a);
return function (el, { addInitializer }) {
push(b);
addInitializer(function () { push(c); });
return el;
};
}
@logDecoratorRun(0, 35, 45)
@logDecoratorRun(1, 34, 44)
class A {
@logDecoratorRun(2... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/initializers/input.js | JavaScript |
@logDecoratorRun(0, 35, 45)
@logDecoratorRun(1, 34, 44)
class A {
@logDecoratorRun(2, 27, 47)
@logDecoratorRun(3, 26, 46)
a() { };
@logDecoratorRun(4, 19, 37)
@logDecoratorRun(5, 18, 36)
static b() { };
@logDecoratorRun(6, 21, 39)
@logDecoratorRun(7, 20, 38)
static #c() { };
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/initializers/output.js | JavaScript | var _dec, _dec1, _initClass, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _call_c, _call_d, _init_e, _init_f, _init_g, _get___g, _set___g, _init_h, _get___h, _set___h, _initProto, _initStatic;
let _A;
_dec = logDecoratorRun(0, 35, 45), _dec1 = l... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/static-accessor-method-initializers/exec.js | JavaScript | var log = [];
function push(x) {
log.push(x);
return x;
}
function logClassDecoratorRun(a, b, c) {
push(a);
return function (el, { addInitializer }) {
push(b);
addInitializer(function () {
push(c);
});
return el;
};
}
function logAccessorDecoratorRun(a, b, c, d) {
push(a);
return ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/static-field-initializers-after-methods/exec.js | JavaScript | var counter = 0;
@(x => x)
class A {
static foo = (() => {
counter++;
expect(typeof this.method).toBe("function");
expect(this.foo).toBeUndefined();
expect(this.bar).toBeUndefined();
return "foo";
})();
static method() {}
static bar = (() => {
counter++;
expect(typeof this.method)... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-runtime-errors--to-es2015/invalid-accessor-decorator-return/exec.js | JavaScript | const returnsUndefined = () => void 0;
const returnsNull = () => null;
const returnsFalse = () => false;
const returnsFunction = () => () => {}
const returnsGetSet = () => ({ set(v) {}, get() {} });
const returnsInit = () => ({ init() {} });
const returnsGetFalse = () => ({ get: false });
const returnsSetFalse = () => ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-runtime-errors--to-es2015/invalid-add-initializer/exec.js | JavaScript | const decWithInitializer = (init) => (_, context) => { context.addInitializer(init) }
expect(() => class { @decWithInitializer(null) static m() {} }).toThrow("An initializer must be a function")
expect(() => class { @decWithInitializer(false) static m() {} }).toThrow("An initializer must be a function")
expect(() => c... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-runtime-errors--to-es2015/invalid-class-decorator-return/exec.js | JavaScript | const returnsUndefined = () => void 0;
const returnsNull = () => null;
const returnsFalse = () => false;
const returnsFunction = () => () => {};
expect(() => @returnsNull class {}).toThrow("class decorators must return a function or void 0")
expect(() => @returnsFalse class {}).toThrow("class decorators must return a ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-runtime-errors--to-es2015/invalid-field-decorator-return/exec.js | JavaScript | const returnsUndefined = () => void 0;
const returnsNull = () => null;
const returnsFalse = () => false;
const returnsFunction = () => () => {};
expect(() => class { @returnsNull m() {} }).toThrow("method decorators must return a function or void 0")
expect(() => class { @returnsFalse m() {} }).toThrow("method decorat... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-runtime-errors--to-es2015/invalid-getter-decorator-return/exec.js | JavaScript | const returnsUndefined = () => void 0;
const returnsNull = () => null;
const returnsFalse = () => false;
const returnsFunction = () => () => {};
expect(() => class { @returnsNull get p() {} }).toThrow("method decorators must return a function or void 0")
expect(() => class { @returnsFalse get p() {} }).toThrow("method... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-runtime-errors--to-es2015/invalid-method-decorator-return/exec.js | JavaScript | const returnsUndefined = () => void 0;
const returnsNull = () => null;
const returnsFalse = () => false;
const returnsFunction = () => () => {};
expect(() => class { @returnsNull p }).toThrow("field decorators must return a function or void 0")
expect(() => class { @returnsFalse p }).toThrow("field decorators must ret... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-runtime-errors--to-es2015/invalid-setter-decorator-return/exec.js | JavaScript | const returnsUndefined = () => void 0;
const returnsNull = () => null;
const returnsFalse = () => false;
const returnsFunction = () => () => {};
expect(() => class { @returnsNull set p(v) {} }).toThrow("method decorators must return a function or void 0")
expect(() => class { @returnsFalse set p(v) {} }).toThrow("meth... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/private/exec.js | JavaScript | function dec(set, context) {
context.addInitializer(function() {
this[context.name + 'Context'] = context;
});
return function (v) {
return set.call(this, v + 1);
}
}
class Foo {
value = 1;
@dec
set #a(v) {
return this.value = v;
}
setA(v) {
this.#a = v;
}
}
let foo = new Foo();... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/private/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
set #a(v) {
return this.value = v;
}
setA(v) {
this.#a = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/private/output.js | JavaScript | var _call_a, _initProto;
const dec = ()=>{};
var _a = /*#__PURE__*/ new WeakMap();
class Foo {
setA(v) {
_class_private_field_set(this, _a, v);
}
constructor(){
_class_private_field_init(this, _a, {
get: void 0,
set: set_a
});
_define_property(this, "v... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/public/exec.js | JavaScript | function dec(set, context) {
context.addInitializer(function() {
this[context.name + 'Context'] = context;
});
return function (v) {
return set.call(this, v + 1);
}
}
class Foo {
value = 1;
@dec
set a(v) {
return this.value = v;
}
@dec
set ['b'](v) {
return this.value = v;
}
}
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/public/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
set a(v) {
return this.value = v;
}
@dec
set ['b'](v) {
return this.value = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/public/output.js | JavaScript | var _computedKey, _initProto;
const dec = ()=>{};
_computedKey = 'b';
let _computedKey1 = _computedKey;
class Foo {
set a(v) {
return this.value = v;
}
set [_computedKey1](v) {
return this.value = v;
}
constructor(){
_define_property(this, "value", (_initProto(this), 1));
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/static-private/exec.js | JavaScript | function dec(set, context) {
context.addInitializer(function() {
this[context.name + 'Context'] = context;
});
return function (v) {
return set.call(this, v + 1);
}
}
class Foo {
static value = 1;
@dec
static set #a(v) {
return this.value = v;
}
static setA(v) {
this.#a = v;
}
}
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/static-private/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static set #a(v) {
return this.value = v;
}
static setA(v) {
this.#a = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/static-private/output.js | JavaScript | var _call_a, _initStatic;
const dec = ()=>{};
class Foo {
static setA(v) {
_class_static_private_field_spec_set(this, Foo, _a, v);
}
}
var _a = {
get: void 0,
set: set_a
};
(()=>{
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(Foo, [
[
dec,
9,
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/static-public/exec.js | JavaScript | function dec(set, context) {
context.addInitializer(function() {
this[context.name + 'Context'] = context;
});
return function (v) {
return set.call(this, v + 1);
}
}
class Foo {
static value = 1;
@dec
static set a(v) {
return this.value = v;
}
@dec
static set ['b'](v) {
return t... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/static-public/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static set a(v) {
return this.value = v;
}
@dec
static set ['b'](v) {
return this.value = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/static-public/output.js | JavaScript | var _computedKey, _initStatic;
const dec = ()=>{};
_computedKey = 'b';
let _computedKey1 = _computedKey;
class Foo {
static set a(v) {
return this.value = v;
}
static set [_computedKey1](v) {
return this.value = v;
}
}
(()=>{
({ e: [_initStatic] } = _apply_decs_2203_r(Foo, [
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters/private/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
set #a(v) {
return this.value = v;
}
setA(v) {
this.#a = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters/private/output.js | JavaScript | var _call_a, _initProto;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_a, _initProto] } = _apply_decs_2203_r(this, [
[
dec,
4,
"a",
function(v) {
return this.value = v;
}
]
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters/public/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
set a(v) {
return this.value = v;
}
@dec
set ['b'](v) {
return this.value = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters/public/output.js | JavaScript | var _computedKey, _initProto;
const dec = ()=>{};
_computedKey = 'b';
class Foo {
static{
({ e: [_initProto] } = _apply_decs_2203_r(this, [
[
dec,
4,
"a"
],
[
dec,
4,
_computed... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters/static-private/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static set #a(v) {
return this.value = v;
}
static setA(v) {
this.#a = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters/static-private/output.js | JavaScript | var _call_a, _initStatic;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(this, [
[
dec,
9,
"a",
function(v) {
return this.value = v;
}
]
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters/static-public/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static set a(v) {
return this.value = v;
}
@dec
static set ['b'](v) {
return this.value = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters/static-public/output.js | JavaScript | var _computedKey, _initStatic;
const dec = ()=>{};
_computedKey = 'b';
class Foo {
static{
({ e: [_initStatic] } = _apply_decs_2203_r(this, [
[
dec,
9,
"a"
],
[
dec,
9,
_compu... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-7358/1/input.js | JavaScript | @decorate()
export class Foo {
@decorate()
get name() {
return "hello"
}
@decorate()
sayHi() {
return "hello"
}
}
function decorate() {
return function (target, { kind }) {
console.log(target, kind)
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-7358/1/output.js | JavaScript | var _dec, _initClass, _dec1, _dec2, _initProto;
let _Foo;
_dec = decorate(), _dec1 = decorate(), _dec2 = decorate();
class Foo {
static{
({ e: [_initProto] , c: [_Foo, _initClass] } = _apply_decs_2203_r(this, [
[
_dec1,
3,
"name"
],
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-7358/2/input.js | JavaScript | export function test() {
// try putting this in stmts instead of at the top level
@decorate()
class Foo {
@decorate()
get name() {
return "hello"
}
@decorate()
sayHi() {
return "hello"
}
}
function decorate() {
return... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-7358/2/output.js | JavaScript | export function test() {
var _dec, _initClass, _dec1, _dec2, _initProto;
let _Foo;
_dec = decorate(), _dec1 = decorate(), _dec2 = decorate();
// try putting this in stmts instead of at the top level
class Foo {
static{
({ e: [_initProto], c: [_Foo, _initClass] } = _apply_decs_220... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-7499/1/input.js | JavaScript | class Tests {
@test
'computed'() { }
id() { class Bar { } }
}
function test(fn) {
return fn;
}
let t = new Tests();
t.id() | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-7499/1/output.js | JavaScript | var _computedKey, _initProto;
_computedKey = 'computed';
class Tests {
static{
({ e: [_initProto] } = _apply_decs_2203_r(this, [
[
test,
2,
_computedKey
]
], []));
}
constructor(){
_initProto(this);
}
[_c... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-8098/1/input.js | JavaScript | export default class T {}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-8098/1/output.js | JavaScript | export default class T {
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-8629/input.js | JavaScript | // main.ts
export class Disposable {
[Symbol.dispose]() {
console.log('dispose')
}
}
using _disposable = new Disposable()
console.log('ok') | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-8629/output.js | JavaScript | // main.ts
var _computedKey;
_computedKey = Symbol.dispose;
export class Disposable {
[_computedKey]() {
console.log('dispose');
}
}
using _disposable = new Disposable()
console.log('ok');
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-8631/1/input.ts | TypeScript | const decorate = (target: unknown, context: DecoratorContext) => {
console.log("decorated");
};
export class Color {
constructor(hex: string);
constructor(r: number, g: number, b: number, a?: number);
constructor(r: string | number, g?: number, b?: number, a = 1) {}
@decorate get rgba() {
return [0, 0, ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-8631/1/output.js | JavaScript | export default class T {
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/issue-8631/1/output.ts | TypeScript | var _initProto;
const decorate = (target: unknown, context: DecoratorContext)=>{
console.log("decorated");
};
export class Color {
static{
({ e: [_initProto] } = _apply_decs_2203_r(this, [
[
decorate,
3,
"rgba"
]
], []));
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async-node-10/using-null-multiple-collapse.js | JavaScript | return (async function () {
// async_null
{
const log = [];
let asyncId = 0,
pending = Promise.resolve();
for (let i = 0; i < 10; i++) {
pending = pending.then(() => asyncId++);
}
{
await using async_null_1 = null,
async_null_2 = null,
async_null_3 = null,
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/async-dispose-throws-synchronously.js | JavaScript | return (async function () {
let disposed = false;
let beforeEnd;
const err1 = {};
const err2 = {};
let thrown;
try {
await using x = {
[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")]() {
throw err1;
},
};
throw err2;
} catch (e) {
thrown = e;
}
expect(... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/completion-break.js | JavaScript | return async function () {
let disposed = false;
let beforeBreak;
while (true) {
await using x = {
async [Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")]() {
disposed = true;
}
};
beforeBreak = disposed;
break;
}
expect(beforeBreak).toBe(false);
expect(dispose... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/completion-normal.js | JavaScript | return async function () {
let disposed = false;
let beforeEnd;
{
await using x = {
async [Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")]() {
disposed = true;
}
};
beforeEnd = disposed;
}
expect(beforeEnd).toBe(false);
expect(disposed).toBe(true);
}(); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/completion-return.js | JavaScript | return async function () {
let disposed = false;
let beforeReturn;
await async function () {
await using x = {
async [Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")]() {
disposed = true;
}
};
beforeReturn = disposed;
return 0;
}();
expect(beforeReturn).toBe(fals... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/completion-throw.js | JavaScript | return (async function () {
let disposed = false;
let beforeReturn;
let inCatch;
let inFinally;
try {
await using x = {
async [Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")]() {
disposed = true;
throw 1;
},
};
beforeReturn = disposed;
throw 0;
} catch ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/invalid-not-a-function.js | JavaScript | expect(
(async function () {
await using foo = {
[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")]: 3,
};
})()
).rejects.toThrow(TypeError);
expect(
(async function () {
await using foo = {
[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")]: 3,
};
})()
).rejects.toT... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/issue-9576.js | JavaScript | class Disposable {
disposed = false;
[Symbol.dispose]() {
this.disposed = true
}
}
const disposables = [new Disposable()]
for (using _ of disposables) {/* ... */ }
expect(disposables[0].disposed).toBe(true);
class AsyncDisposable {
disposed = false;
[Symbol.asyncDispose]() {
th... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/multiple.js | JavaScript | return async function () {
let log = [];
function disposable(name){
return {
async [Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")]() {
log.push(name);
}
};
}
{
await using x = disposable("x");
await using y = disposable("y"), z = disposable("z");
await using ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/sync-async-mixed.js | JavaScript | return (async function () {
let log = [];
function disposable(name, symbolName, cb){
return {
async [Symbol[symbolName] || Symbol.for("Symbol." + symbolName)]() {
log.push(name);
if (cb) cb();
}
};
}
let inBmicrotick = false;
let inBmicrotickWhileC = false;
let inBmicro... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/sync-fallback-error.js | JavaScript | return (async () => {
const log = [];
async function main() {
const promiseDispose = Promise.resolve().then(() => {
log.push("interleave");
});
try {
await using x = {
[Symbol.dispose || Symbol.for("Symbol.dispose")]() {
log.push("dispose");
throw null;
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/sync-fallback-promise.js | JavaScript | return (async () => {
const log = [];
const promiseDispose = new Promise((resolve, _) => {
setTimeout(() => {
log.push("y dispose promise body");
resolve();
}, 0);
});
{
await using x = {
[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")]() {
log.push("x asyncDisp... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/sync-fallback.js | JavaScript | return (async function () {
let disposed = false;
let awaited = false;
let beforeEnd;
{
await using x = {
[Symbol.dispose || Symbol.for("Symbol.dispose")]() {
disposed = true;
}
};
beforeEnd = disposed;
Promise.resolve().then(() => {
awaited = true;
});
}
expec... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/using-function.js | JavaScript | return async function () {
let log = [];
async function getDisposable() {
function disposable() { log.push('call') }
disposable[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")] = () => { log.push('dispose') };
return disposable;
}
{
await using x = getDisposable();
x();
}
expe... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/using-null-multiple.js | JavaScript | return (async function () {
const log = [];
function disposable(name) {
return {
async [Symbol.dispose || Symbol.for("Symbol.dispose")]() {
log.push(name);
},
};
}
async function f() {
using y = disposable("y");
await using x = null;
log.push("f body");
}
const pro... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/explicit-resource-management/exec-async/using-null.js | JavaScript | return expect(async function () {
await using x = null;
}()).resolves.toBeUndefined();
| 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.