Properly regenerate scope for replaced nodes - fixes #1773
This commit is contained in:
parent
7cb7ea4248
commit
3f38a83600
@ -146,7 +146,7 @@ export default class Scope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var cached = path.getData("scope");
|
var cached = path.getData("scope");
|
||||||
if (cached && cached.parent === parent) {
|
if (cached && cached.parent === parent && cached.block === path.node) {
|
||||||
return cached;
|
return cached;
|
||||||
} else {
|
} else {
|
||||||
path.setData("scope", this);
|
path.setData("scope", this);
|
||||||
|
|||||||
@ -10,3 +10,12 @@ class Foo extends Bar {
|
|||||||
this.state = "test";
|
this.state = "test";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ConstructorScoping {
|
||||||
|
constructor(){
|
||||||
|
let bar;
|
||||||
|
{
|
||||||
|
let bar;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -16,4 +16,13 @@ var Foo = (function (_Bar) {
|
|||||||
|
|
||||||
babelHelpers.inherits(Foo, _Bar);
|
babelHelpers.inherits(Foo, _Bar);
|
||||||
return Foo;
|
return Foo;
|
||||||
})(Bar);
|
})(Bar);
|
||||||
|
|
||||||
|
var ConstructorScoping = function ConstructorScoping() {
|
||||||
|
babelHelpers.classCallCheck(this, ConstructorScoping);
|
||||||
|
|
||||||
|
var bar = undefined;
|
||||||
|
{
|
||||||
|
var _bar = undefined;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user