fix exported classes with static class properties - fixes #2868
This commit is contained in:
3
packages/babel-plugin-transform-class-properties/test/fixtures/general/static/actual.js
vendored
Normal file
3
packages/babel-plugin-transform-class-properties/test/fixtures/general/static/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
class Foo {
|
||||
static bar = "foo";
|
||||
}
|
||||
9
packages/babel-plugin-transform-class-properties/test/fixtures/general/static/exec.js
vendored
Normal file
9
packages/babel-plugin-transform-class-properties/test/fixtures/general/static/exec.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
class Foo {
|
||||
static num = 0;
|
||||
static str = "foo";
|
||||
}
|
||||
|
||||
assert.equal(Foo.num, 0);
|
||||
assert.equal(Foo.num = 1, 1);
|
||||
assert.equal(Foo.str, "foo");
|
||||
assert.equal(Foo.str = "bar", "bar");
|
||||
5
packages/babel-plugin-transform-class-properties/test/fixtures/general/static/expected.js
vendored
Normal file
5
packages/babel-plugin-transform-class-properties/test/fixtures/general/static/expected.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
var Foo = function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
};
|
||||
|
||||
Foo.bar = "foo";
|
||||
Reference in New Issue
Block a user