Skip to content

Commit

Permalink
add input/output tests on multiple static blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Mar 12, 2021
1 parent db76c8e commit e002f53
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 0 deletions.
@@ -0,0 +1,11 @@
class Foo {
static #bar = 21;
static {
this.foo = this.#bar;
this.qux1 = this.qux;
}
static qux = 21;
static {
this.qux2 = this.qux;
}
}
@@ -0,0 +1,11 @@
class Foo {
static #bar = 21;
static #_ = (() => {
this.foo = this.#bar;
this.qux1 = this.qux;
})();
static qux = 21;
static #_2 = (() => {
this.qux2 = this.qux;
})();
}
@@ -0,0 +1,11 @@
class Foo {
static #bar = 21;
static {
this.foo = this.#bar;
this.qux1 = this.qux;
}
static qux = 21;
static {
this.qux2 = this.qux;
}
}
@@ -0,0 +1,26 @@
var _bar = babelHelpers.classPrivateFieldLooseKey("bar");

var _ = babelHelpers.classPrivateFieldLooseKey("_");

var _2 = babelHelpers.classPrivateFieldLooseKey("_2");

class Foo {}

Object.defineProperty(Foo, _bar, {
writable: true,
value: 21
});
Object.defineProperty(Foo, _, {
writable: true,
value: (() => {
Foo.foo = babelHelpers.classPrivateFieldLooseBase(Foo, _bar)[_bar];
Foo.qux1 = Foo.qux;
})()
});
Foo.qux = 21;
Object.defineProperty(Foo, _2, {
writable: true,
value: (() => {
Foo.qux2 = Foo.qux;
})()
});
@@ -0,0 +1,11 @@
class Foo {
static #bar = 21;
static {
this.foo = this.#bar;
this.qux1 = this.qux;
}
static qux = 21;
static {
this.qux2 = this.qux;
}
}
@@ -0,0 +1,20 @@
class Foo {}

var _bar = {
writable: true,
value: 21
};
var _ = {
writable: true,
value: (() => {
Foo.foo = babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _bar);
Foo.qux1 = Foo.qux;
})()
};
babelHelpers.defineProperty(Foo, "qux", 21);
var _2 = {
writable: true,
value: (() => {
Foo.qux2 = Foo.qux;
})()
};

0 comments on commit e002f53

Please sign in to comment.