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-fields--to-es2015/static-public/output.js | JavaScript | var _computedKey, _init_a, _init_b, _init__computedKey;
const dec = ()=>{};
_computedKey = 'c';
class Foo {
}
({ e: [_init_a, _init_b, _init__computedKey] } = _apply_decs_2203_r(Foo, [
[
dec,
5,
"a"
],
[
dec,
5,
"b"
],
[
dec,
5,
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields/private/input.js | JavaScript | const dec = () => {};
class Foo {
@dec
#a;
@dec
#b = 123;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields/private/output.js | JavaScript | var _init_a, _init_b;
const dec = ()=>{};
class Foo {
static{
({ e: [_init_a, _init_b] } = _apply_decs_2203_r(this, [
[
dec,
0,
"a",
function() {
return this.#a;
},
function(value... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields/public/input.js | JavaScript | const dec = () => {};
class Foo {
@dec
a;
@dec
b = 123;
@dec
['c'] = 456;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields/public/output.js | JavaScript | var _computedKey, _init_a, _init_b, _init__computedKey;
const dec = ()=>{};
_computedKey = 'c';
class Foo {
static{
({ e: [_init_a, _init_b, _init__computedKey] } = _apply_decs_2203_r(this, [
[
dec,
0,
"a"
],
[
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields/static-private/input.js | JavaScript | const dec = () => {};
class Foo {
@dec
static #a;
@dec
static #b = 123;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields/static-private/output.js | JavaScript | var _init_a, _init_b;
const dec = ()=>{};
class Foo {
static{
({ e: [_init_a, _init_b] } = _apply_decs_2203_r(this, [
[
dec,
5,
"a",
function() {
return this.#a;
},
function(value... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields/static-public/input.js | JavaScript | const dec = () => {};
class Foo {
@dec
static a;
@dec
static b = 123;
@dec
static ['c'] = 456;
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-fields/static-public/output.js | JavaScript | var _computedKey, _init_a, _init_b, _init__computedKey;
const dec = ()=>{};
_computedKey = 'c';
class Foo {
static{
({ e: [_init_a, _init_b, _init__computedKey] } = _apply_decs_2203_r(this, [
[
dec,
5,
"a"
],
[
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters--to-es2015/private/exec.js | JavaScript | function dec(get, context) {
context.addInitializer(function() {
this[context.name + 'Context'] = context;
});
return function () {
return get.call(this) + 1;
}
}
class Foo {
value = 1;
@dec
get #a() {
return this.value;
}
getA() {
return this.#a;
}
}
let foo = new Foo();
const... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters--to-es2015/private/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
get #a() {
return this.value;
}
getA() {
return this.#a;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters--to-es2015/private/output.js | JavaScript | var _call_a, _initProto;
const dec = ()=>{};
var _a = /*#__PURE__*/ new WeakMap();
class Foo {
getA() {
return _class_private_field_get(this, _a);
}
constructor(){
_class_private_field_init(this, _a, {
get: get_a,
set: void 0
});
_define_property(this,... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters--to-es2015/public/exec.js | JavaScript | function dec(get, context) {
context.addInitializer(function() {
this[context.name + 'Context'] = context;
});
return function () {
return get.call(this) + 1;
}
}
class Foo {
value = 1;
@dec
get a() {
return this.value;
}
@dec
get ['b']() {
return this.value;
}
}
let foo = new... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters--to-es2015/public/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
get a() {
return this.value;
}
@dec
get ['b']() {
return this.value;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters--to-es2015/public/output.js | JavaScript | var _computedKey, _initProto;
const dec = ()=>{};
_computedKey = 'b';
let _computedKey1 = _computedKey;
class Foo {
get a() {
return this.value;
}
get [_computedKey1]() {
return this.value;
}
constructor(){
_define_property(this, "value", (_initProto(this), 1));
}
}
({ e:... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters--to-es2015/static-private/exec.js | JavaScript | function dec(get, context) {
context.addInitializer(function() {
this[context.name + 'Context'] = context;
});
return function () {
return get.call(this) + 1;
}
}
class Foo {
static value = 1;
@dec
static get #a() {
return this.value;
}
static getA() {
return this.#a;
}
}
const ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters--to-es2015/static-private/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static get #a() {
return this.value;
}
static getA() {
return this.#a;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters--to-es2015/static-private/output.js | JavaScript | var _call_a, _initStatic;
const dec = ()=>{};
class Foo {
static getA() {
return _class_static_private_field_spec_get(this, Foo, _a);
}
}
var _a = {
get: get_a,
set: void 0
};
(()=>{
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(Foo, [
[
dec,
8,
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters--to-es2015/static-public/exec.js | JavaScript | function dec(get, context) {
context.addInitializer(function() {
this[context.name + 'Context'] = context;
});
return function () {
return get.call(this) + 1;
}
}
class Foo {
static value = 1;
@dec
static get a() {
return this.value;
}
@dec
static get ['b']() {
return this.value;... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters--to-es2015/static-public/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static get a() {
return this.value;
}
@dec
static get ['b']() {
return this.value;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters--to-es2015/static-public/output.js | JavaScript | var _computedKey, _initStatic;
const dec = ()=>{};
_computedKey = 'b';
let _computedKey1 = _computedKey;
class Foo {
static get a() {
return this.value;
}
static get [_computedKey1]() {
return this.value;
}
}
(()=>{
({ 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-getters-and-setters--to-es2015/private/exec.js | JavaScript | function dec(value, context) {
context.addInitializer(function() {
this[context.name + '_' + context.kind + 'Context'] = context;
});
if (context.kind === 'getter') {
return function () {
return value.call(this) + 1;
}
} else {
return function (v) {
return value.call(this, v + 1);
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters--to-es2015/private/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
get #a() {
return this.value;
}
@dec
set #a(v) {
this.value = v;
}
getA() {
return this.#a;
}
setA(v) {
this.#a = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters--to-es2015/private/output.js | JavaScript | var _call_a, _call_a1, _initProto;
const dec = ()=>{};
var _a = /*#__PURE__*/ new WeakMap();
class Foo {
getA() {
return _class_private_field_get(this, _a);
}
setA(v) {
_class_private_field_set(this, _a, v);
}
constructor(){
_class_private_field_init(this, _a, {
g... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters--to-es2015/public/exec.js | JavaScript | function dec(value, context) {
context.addInitializer(function() {
this[context.name + '_' + context.kind + 'Context'] = context;
});
if (context.kind === 'getter') {
return function () {
return value.call(this) + 1;
}
} else {
return function (v) {
return value.call(this, v + 1);
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters--to-es2015/public/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
get a() {
return this.value;
}
@dec
set a(v) {
this.value = v;
}
@dec
get ['b']() {
return this.value;
}
@dec
set ['b'](v) {
this.value = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters--to-es2015/public/output.js | JavaScript | var _computedKey, _computedKey1, _initProto;
const dec = ()=>{};
_computedKey = 'b', _computedKey1 = 'b';
let _computedKey2 = _computedKey, _computedKey3 = _computedKey1;
class Foo {
get a() {
return this.value;
}
set a(v) {
this.value = v;
}
get [_computedKey2]() {
return th... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters--to-es2015/static-private/exec.js | JavaScript | function dec(value, context) {
context.addInitializer(function() {
this[context.name + '_' + context.kind + 'Context'] = context;
});
if (context.kind === 'getter') {
return function () {
return value.call(this) + 1;
}
} else {
return function (v) {
return value.call(this, v + 1);
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters--to-es2015/static-private/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static get #a() {
return this.value;
}
@dec
static set #a(v) {
this.value = v;
}
static getA() {
return this.#a;
}
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-getters-and-setters--to-es2015/static-private/output.js | JavaScript | var _call_a, _call_a1, _initStatic;
const dec = ()=>{};
class Foo {
static getA() {
return _class_static_private_field_spec_get(this, Foo, _a);
}
static setA(v) {
_class_static_private_field_spec_set(this, Foo, _a, v);
}
}
var _a = {
get: get_a,
set: set_a
};
(()=>{
({ e: [_c... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters--to-es2015/static-public/exec.js | JavaScript | function dec(value, context) {
context.addInitializer(function() {
this[context.name + '_' + context.kind + 'Context'] = context;
});
if (context.kind === 'getter') {
return function () {
return value.call(this) + 1;
}
} else {
return function (v) {
return value.call(this, v + 1);
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters--to-es2015/static-public/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static get a() {
return this.value;
}
@dec
static set a(v) {
this.value = v;
}
@dec
static get ['b']() {
return this.value;
}
@dec
static set ['b'](v) {
this.value = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters--to-es2015/static-public/output.js | JavaScript | var _computedKey, _computedKey1, _initStatic;
const dec = ()=>{};
_computedKey = 'b', _computedKey1 = 'b';
let _computedKey2 = _computedKey, _computedKey3 = _computedKey1;
class Foo {
static get a() {
return this.value;
}
static set a(v) {
this.value = v;
}
static get [_computedKey2]... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters/private/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
get #a() {
return this.value;
}
@dec
set #a(v) {
this.value = v;
}
getA() {
return this.#a;
}
setA(v) {
this.#a = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters/private/output.js | JavaScript | var _call_a, _call_a1, _initProto;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_a, _call_a1, _initProto] } = _apply_decs_2203_r(this, [
[
dec,
3,
"a",
function() {
return this.value;
}
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters/public/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
get a() {
return this.value;
}
@dec
set a(v) {
this.value = v;
}
@dec
get ['b']() {
return this.value;
}
@dec
set ['b'](v) {
this.value = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters/public/output.js | JavaScript | var _computedKey, _computedKey1, _initProto;
const dec = ()=>{};
_computedKey = 'b', _computedKey1 = 'b';
class Foo {
static{
({ e: [_initProto] } = _apply_decs_2203_r(this, [
[
dec,
3,
"a"
],
[
dec,
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters/static-private/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static get #a() {
return this.value;
}
@dec
static set #a(v) {
this.value = v;
}
static getA() {
return this.#a;
}
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-getters-and-setters/static-private/output.js | JavaScript | var _call_a, _call_a1, _initStatic;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_a, _call_a1, _initStatic] } = _apply_decs_2203_r(this, [
[
dec,
8,
"a",
function() {
return this.value;
}
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters/static-public/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static get a() {
return this.value;
}
@dec
static set a(v) {
this.value = v;
}
@dec
static get ['b']() {
return this.value;
}
@dec
static set ['b'](v) {
this.value = v;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters/static-public/output.js | JavaScript | var _computedKey, _computedKey1, _initStatic;
const dec = ()=>{};
_computedKey = 'b', _computedKey1 = 'b';
class Foo {
static{
({ e: [_initStatic] } = _apply_decs_2203_r(this, [
[
dec,
8,
"a"
],
[
dec,
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters/private/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
get #a() {
return this.value;
}
getA() {
return this.#a;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters/private/output.js | JavaScript | var _call_a, _initProto;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_a, _initProto] } = _apply_decs_2203_r(this, [
[
dec,
3,
"a",
function() {
return this.value;
}
]
]... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters/public/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
get a() {
return this.value;
}
@dec
get ['b']() {
return this.value;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters/public/output.js | JavaScript | var _computedKey, _initProto;
const dec = ()=>{};
_computedKey = 'b';
class Foo {
static{
({ e: [_initProto] } = _apply_decs_2203_r(this, [
[
dec,
3,
"a"
],
[
dec,
3,
_computed... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters/static-private/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static get #a() {
return this.value;
}
static getA() {
return this.#a;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters/static-private/output.js | JavaScript | var _call_a, _initStatic;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(this, [
[
dec,
8,
"a",
function() {
return this.value;
}
]
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters/static-public/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static get a() {
return this.value;
}
@dec
static get ['b']() {
return this.value;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters/static-public/output.js | JavaScript | var _computedKey, _initStatic;
const dec = ()=>{};
_computedKey = 'b';
class Foo {
static{
({ e: [_initStatic] } = _apply_decs_2203_r(this, [
[
dec,
8,
"a"
],
[
dec,
8,
_compu... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-metadata/class/exec.js | JavaScript | function dec(_, ctx) {
ctx.metadata.foo = 3;
}
Symbol.metadata = Symbol();
@dec
class A {}
expect(A[Symbol.metadata]).toEqual({ foo: 3 });
expect(Object.getPrototypeOf(A[Symbol.metadata])).toBe(null);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-metadata/element/exec.js | JavaScript | function dec(_, ctx) {
console.error(ctx);
ctx.metadata.foo = 3;
}
Symbol.metadata = Symbol();
class A {
@dec
foo;
}
expect(A[Symbol.metadata]).toEqual({ foo: 3 });
expect(Object.getPrototypeOf(A[Symbol.metadata])).toBe(null);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-metadata/no-decorators/exec.js | JavaScript | Symbol.metadata = Symbol();
class A {}
expect(A.hasOwnProperty(Symbol.metadata)).toBe(false);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-metadata/subclass-no-super-decorators/exec.js | JavaScript | function dec(v) {
return (_, ctx) => {
ctx.metadata.foo = v;
};
}
Symbol.metadata = Symbol();
class B {}
@dec(3)
class A extends B {}
expect(A[Symbol.metadata]).toEqual({ foo: 3 });
expect(Object.getPrototypeOf(A[Symbol.metadata])).toBe(null);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-metadata/subclass-super-decorators/exec.js | JavaScript | function dec(v) {
return (_, ctx) => {
ctx.metadata.foo = v;
};
}
Symbol.metadata = Symbol();
@dec(2)
class B {}
@dec(3)
class A extends B {}
expect(A[Symbol.metadata]).toEqual({ foo: 3 });
expect(Object.getPrototypeOf(A[Symbol.metadata])).toBe(B[Symbol.metadata]);
expect(B[Symbol.metadata]).toEqual({ foo: ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/private-with-initializers/exec.js | JavaScript | function dec(fn, context) {
context.addInitializer(function() {
this[context.name + 'Context'] = context;
});
return function () {
return fn.call(this) + 1;
}
}
class Foo {
value = 1;
@dec
#a() {
return this.value;
}
callA() {
return this.#a();
}
}
let foo = new Foo();
const aC... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/private/exec.js | JavaScript | function dec(fn, context) {
return function () {
return fn.call(this) + 1;
}
}
class Foo {
value = 1;
@dec
#a() {
return this.value;
}
callA() {
return this.#a();
}
}
let foo = new Foo();
expect(foo.callA()).toBe(2);
foo.value = 123;
expect(foo.callA()).toBe(124);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/private/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
#a() {
return this.value;
}
callA() {
return this.#a();
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/private/output.js | JavaScript | var _call_a, _initProto;
const dec = ()=>{};
var _a = /*#__PURE__*/ new WeakMap();
class Foo {
callA() {
return _class_private_field_get(this, _a).call(this);
}
constructor(){
_class_private_field_init(this, _a, {
get: get_a,
set: void 0
});
_define_pr... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/public-with-initializers/exec.js | JavaScript | function dec(fn, context) {
context.addInitializer(function() {
this[context.name + 'Context'] = context;
});
return function () {
return fn.call(this) + 1;
}
}
class Foo {
value = 1;
@dec
a() {
return this.value;
}
@dec
['b']() {
return this.value;
}
}
let foo = new Foo();
c... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/public/exec.js | JavaScript | function dec(fn, context) {
return function () {
return fn.call(this) + 1;
}
}
class Foo {
value = 1;
@dec
a() {
return this.value;
}
@dec
['b']() {
return this.value;
}
}
let foo = new Foo();
expect(foo.a()).toBe(2);
expect(foo.b()).toBe(2);
foo.value = 123;
expect(foo.a()).toBe(124)... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/public/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
a() {
return this.value;
}
@dec
['b']() {
return this.value;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/public/output.js | JavaScript | var _computedKey, _initProto;
const dec = ()=>{};
_computedKey = 'b';
let _computedKey1 = _computedKey;
class Foo {
a() {
return this.value;
}
[_computedKey1]() {
return this.value;
}
constructor(){
_define_property(this, "value", (_initProto(this), 1));
}
}
({ e: [_initP... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/static-private-with-initializers/exec.js | JavaScript | function dec(fn, context) {
context.addInitializer(function() {
this[context.name + 'Context'] = context;
});
return function () {
return fn.call(this) + 1;
}
}
class Foo {
static value = 1;
@dec
static #a() {
return this.value;
}
static callA() {
return this.#a();
}
}
const aCo... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/static-private/exec.js | JavaScript | function dec(fn, context) {
return function () {
return fn.call(this) + 1;
}
}
class Foo {
static value = 1;
@dec
static #a() {
return this.value;
}
static callA() {
return this.#a();
}
}
expect(Foo.callA()).toBe(2);
Foo.value = 123;
expect(Foo.callA()).toBe(124);
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/static-private/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static #a() {
return this.value;
}
static callA() {
return this.#a();
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/static-private/output.js | JavaScript | var _call_a, _initStatic;
const dec = ()=>{};
class Foo {
static callA() {
return _class_static_private_field_spec_get(this, Foo, _a).call(Foo);
}
}
var _a = {
get: get_a,
set: void 0
};
(()=>{
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(Foo, [
[
dec,
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/static-public-with-initializers/exec.js | JavaScript | function dec(fn, context) {
context.addInitializer(function() {
this[context.name + 'Context'] = context;
});
return function () {
return fn.call(this) + 1;
}
}
class Foo {
static value = 1;
@dec
static a() {
return this.value;
}
@dec
static ['b']() {
return this.value;
}
}
co... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/static-public/exec.js | JavaScript | function dec(fn, context) {
return function () {
return fn.call(this) + 1;
}
}
class Foo {
static value = 1;
@dec
static a() {
return this.value;
}
@dec
static ['b']() {
return this.value;
}
}
expect(Foo.a()).toBe(2);
expect(Foo.b()).toBe(2);
Foo.value = 123;
expect(Foo.a()).toBe(124);... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/static-public/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static a() {
return this.value;
}
@dec
static ['b']() {
return this.value;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/static-public/output.js | JavaScript | var _computedKey, _initStatic;
const dec = ()=>{};
_computedKey = 'b';
let _computedKey1 = _computedKey;
class Foo {
static a() {
return this.value;
}
static [_computedKey1]() {
return this.value;
}
}
(()=>{
({ e: [_initStatic] } = _apply_decs_2203_r(Foo, [
[
dec,... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods/private/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
#a() {
return this.value;
}
callA() {
return this.#a();
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods/private/output.js | JavaScript | var _call_a, _initProto;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_a, _initProto] } = _apply_decs_2203_r(this, [
[
dec,
2,
"a",
function() {
return this.value;
}
]
]... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods/public/input.js | JavaScript | const dec = () => {};
class Foo {
value = 1;
@dec
a() {
return this.value;
}
@dec
['b']() {
return this.value;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods/public/output.js | JavaScript | var _computedKey, _initProto;
const dec = ()=>{};
_computedKey = 'b';
class Foo {
static{
({ e: [_initProto] } = _apply_decs_2203_r(this, [
[
dec,
2,
"a"
],
[
dec,
2,
_computed... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods/static-private/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static #a() {
return this.value;
}
static callA() {
return this.#a();
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods/static-private/output.js | JavaScript | var _call_a, _initStatic;
const dec = ()=>{};
class Foo {
static{
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(this, [
[
dec,
7,
"a",
function() {
return this.value;
}
]
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods/static-public/input.js | JavaScript | const dec = () => {};
class Foo {
static value = 1;
@dec
static a() {
return this.value;
}
@dec
static ['b']() {
return this.value;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods/static-public/output.js | JavaScript | var _computedKey, _initStatic;
const dec = ()=>{};
_computedKey = 'b';
class Foo {
static{
({ e: [_initStatic] } = _apply_decs_2203_r(this, [
[
dec,
7,
"a"
],
[
dec,
7,
_compu... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc--to-es2015/class-and-method-decorators/exec.js | JavaScript | function dec() {}
var i = 0;
var log = [];
function push(x) { log.push(x); return x; }
function decWithInitializer(_, { addInitializer }) {
addInitializer(() => push(i++) );
}
new @dec class C1 {
@dec static m() {}
}
new @dec class C2 {
@dec static #m() {}
}
new @dec class C3 {
@dec m() {}
}
new @dec cla... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc--to-es2015/class-and-property-decorators/exec.js | JavaScript | function dec() {}
var i = 0;
var log = [];
function push(x) { log.push(x); return x; }
function decWithInitializer(_, { addInitializer }) {
addInitializer(() => push(i++) );
}
new @dec class C1 {
@dec static p
}
new @dec class C2 {
@dec static #p
}
new @dec class C3 {
@dec p
}
new @dec class C4 {
@dec ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc--to-es2015/decorator-evaluation-scope/exec.js | JavaScript | let receivedName;
function decFactory(name) { receivedName = name; return x => x }
class B {
static m() {
class C {
@decFactory(this.name) p;
}
}
}
B.m();
expect(receivedName).toBe("B");
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc--to-es2015/initProto-existing-derived-constructor/exec.js | JavaScript | let self, a, initCalled;
function deco(_, context) {
context.addInitializer(() => {
initCalled = true;
})
}
class B {
constructor(s) {
a = s;
}
}
class A extends B {
constructor() {
let a = 2;
self = super(a);
}
@deco
method() {}
}
let instance = new A();
expect(self).toBe(instance)... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc--to-es2015/initProto-existing-derived-constructor/input.js | JavaScript | const dec = () => {};
class A extends B {
constructor() {
let a = 2;
super(a);
foo();
}
@deco
method() {}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc--to-es2015/initProto-existing-derived-constructor/output.js | JavaScript | var _initProto;
const dec = ()=>{};
class A extends B {
method() {}
constructor(){
let a = 2;
super(a), _initProto(this);
foo();
}
}
({ e: [_initProto] } = _apply_decs_2203_r(A, [
[
deco,
2,
"method"
]
], []));
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc--to-es2015/initializer-property-ignored/exec.js | JavaScript | let init = false;
let initializer = false;
function decorator() {
return {
get init() {
init = true;
return () => {};
},
get initializer() {
initializer = true;
return () => {};
}
};
}
class A {
@decorator
accessor x;
}
new A();
expect(init).toBe(true);
expect(initial... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc--to-es2015/initializer-timing/exec.js | JavaScript | function dec1(fn, context) {
context.addInitializer((instance) => {
expect(instance.value).toBe(undefined);
});
return fn;
}
class Foo {
value = 1;
@dec1
foo() {}
}
function dec2(fn, context) {
context.addInitializer((instance) => {
expect(instance.value).toBe(1);
});
return fn;
}
class... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc--to-es2015/leaked-context-addInitializer-throw/exec.js | JavaScript | let addInitializer;
function decMethod(_, context) {
({ addInitializer } = context);
addInitializer(() => null);
}
try {
class C {
@decMethod
m() {}
}
} finally {}
expect(() => {
addInitializer(() => null);
}).toThrow('attempted to call addInitializer after decoration was finished')
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc--to-es2015/leaked-context-addInitializer/exec.js | JavaScript | let addInitializer;
function callCapturedFunc() {
addInitializer(() => null);
}
function decMethod(_, context) {
({ addInitializer } = context);
addInitializer(() => null);
}
expect(() => {
class C {
@callCapturedFunc
@decMethod
m() {}
}
}).toThrow('attempted to call addInitializer after decora... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc--to-es2015/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--to-es2015/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];
var _a = /*#__PURE__*/ new WeakMap();
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/all-decorators/input.js | JavaScript | const dec = () => {};
@dec
class Class {
@dec a;
@dec b() {}
@dec get c() {}
@dec set c(v) {}
@dec accessor d;
@dec #e;
@dec #f() {}
@dec get #g() {}
@dec set #g(v) {}
@dec accessor #h;
@dec static i;
@dec static j() {}
@dec static get k() {}
@dec static set l(v) {}
@dec static accessor... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/all-decorators/output.js | JavaScript | var _initClass, _init_d, _call_f, _call_g, _call_g1, _init_h, _get___h, _set___h, _init_m, _call_o, _call_p, _call_q, _init_r, _get___r, _set___r, _init_a, _init_e, _init_i, _init_n, _initProto, _initStatic;
const dec = ()=>{};
let _Class;
new class extends _identity {
constructor(){
super(_Class), _initCla... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/decorator-evaluation-scope/exec.js | JavaScript | let receivedName;
function decFactory(name) { receivedName = name; return x => x }
class B {
static m() {
class C {
@decFactory(this.name) p;
}
}
}
B.m();
expect(receivedName).toBe("B");
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/initProto-existing-derived-constructor-multiple-super/input.js | JavaScript | const dec = () => {};
class A extends B {
constructor() {
if (Math.random() > 0.5) {
super(true);
} else {
super(false);
}
}
@deco
method() {}
}
class C extends B {
constructor() {
try {
super(super(), null.x);
} catch {}
}
@deco
method() {}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/initProto-existing-derived-constructor-multiple-super/output.js | JavaScript | var _initProto, _initProto1;
const dec = ()=>{};
class A extends B {
static{
({ e: [_initProto] } = _apply_decs_2203_r(this, [
[
deco,
2,
"method"
]
], []));
}
constructor(){
if (Math.random() > 0.5) {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/initProto-existing-derived-constructor/input.js | JavaScript | const dec = () => {};
class A extends B {
constructor() {
let a = 2;
super(a);
foo();
}
@dec
method() {}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/initProto-existing-derived-constructor/output.js | JavaScript | var _initProto;
const dec = ()=>{};
class A extends B {
static{
({ e: [_initProto] } = _apply_decs_2203_r(this, [
[
dec,
2,
"method"
]
], []));
}
constructor(){
let a = 2;
super(a), _initProto(this);
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/initializer-property-ignored/exec.js | JavaScript | let init = false;
let initializer = false;
function decorator() {
return {
get init() {
init = true;
return () => {};
},
get initializer() {
initializer = true;
return () => {};
}
};
}
class A {
@decorator
accessor x;
}
new A();
expect(init).toBe(true);
expect(initial... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/private-keys-in-enclosing-class/input.js | JavaScript | const dec = () => {};
class A {
#A = 1;
static B = class B extends A {
accessor a = 2;
getA() {
return this.#A;
}
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/private-keys-in-enclosing-class/output.js | JavaScript | const dec = ()=>{};
class A {
#A = 1;
static B = class B extends A {
#___private_a_1 = 2;
get a() {
return this.#___private_a_1;
}
set a(_v) {
this.#___private_a_1 = _v;
}
getA() {
return this.#A;
}
};
}
| 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.