Class Props: Don't rename constructor collisions with static props (#7813)
Static props aren't evaluated inside the constructor, so there can't be a collision.
This commit is contained in:
parent
47201db61e
commit
8c46fd159f
@ -199,7 +199,10 @@ export default declare((api, options) => {
|
||||
}
|
||||
|
||||
const state = { scope: constructor.scope };
|
||||
for (const prop of props) prop.traverse(referenceVisitor, state);
|
||||
for (const prop of props) {
|
||||
if (prop.node.static) continue;
|
||||
prop.traverse(referenceVisitor, state);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
|
||||
@ -2,8 +2,10 @@ var foo = "bar";
|
||||
|
||||
class Foo {
|
||||
bar = foo;
|
||||
static bar = baz;
|
||||
|
||||
constructor() {
|
||||
var foo = "foo";
|
||||
var baz = "baz";
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,4 +6,7 @@ var Foo = function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
this.bar = foo;
|
||||
var _foo = "foo";
|
||||
var baz = "baz";
|
||||
};
|
||||
|
||||
Foo.bar = baz;
|
||||
|
||||
@ -2,8 +2,10 @@ var foo = "bar";
|
||||
|
||||
class Foo {
|
||||
bar = foo;
|
||||
static bar = baz;
|
||||
|
||||
constructor() {
|
||||
var foo = "foo";
|
||||
var baz = "baz";
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,4 +6,7 @@ var Foo = function Foo() {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
babelHelpers.defineProperty(this, "bar", foo);
|
||||
var _foo = "foo";
|
||||
var baz = "baz";
|
||||
};
|
||||
|
||||
babelHelpers.defineProperty(Foo, "bar", baz);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user