Properly regenerate scope for replaced nodes - fixes #1773

This commit is contained in:
Logan Smyth 2015-07-01 22:06:05 -07:00
parent 7cb7ea4248
commit 3f38a83600
3 changed files with 20 additions and 2 deletions

View File

@ -146,7 +146,7 @@ export default class Scope {
}
var cached = path.getData("scope");
if (cached && cached.parent === parent) {
if (cached && cached.parent === parent && cached.block === path.node) {
return cached;
} else {
path.setData("scope", this);

View File

@ -10,3 +10,12 @@ class Foo extends Bar {
this.state = "test";
}
}
class ConstructorScoping {
constructor(){
let bar;
{
let bar;
}
}
}

View File

@ -17,3 +17,12 @@ var Foo = (function (_Bar) {
babelHelpers.inherits(Foo, _Bar);
return Foo;
})(Bar);
var ConstructorScoping = function ConstructorScoping() {
babelHelpers.classCallCheck(this, ConstructorScoping);
var bar = undefined;
{
var _bar = undefined;
}
};