add note about member expression resolution

This commit is contained in:
Sebastian McKenzie 2015-03-14 04:50:23 +11:00
parent 080a844457
commit 9676056f08
2 changed files with 5 additions and 2 deletions

View File

@ -209,7 +209,7 @@ class ClassTransformer {
}
// we have no constructor, we have a super, and the super doesn't appear to be falsy
if (!this.hasConstructor && this.hasSuper && this.path.get("superClass").evaluateTruthy() !== false) {
if (!this.hasConstructor && this.hasSuper) {
var helperName = "class-super-constructor-call";
if (this.isLoose) helperName += "-loose";
constructor.body.body.push(util.template(helperName, {

View File

@ -277,9 +277,12 @@ export default class TraversalPath {
if (binding.path === this) {
return this;
} else {
return binding.path.resolve();;
return binding.path.resolve();
}
} else if (this.isMemberExpression()) {
// this is dangerous, as non-direct target assignments will mutate it's state
// making this resolution inaccurate
var targetKey = this.toComputedKey();
if (!t.isLiteral(targetKey)) return;
var targetName = targetKey.value;