fix tests, better block scoped collisions

This commit is contained in:
Sebastian McKenzie
2015-04-04 14:17:26 +11:00
parent 7c710a0378
commit 4bd19da3c2
6 changed files with 20 additions and 16 deletions

View File

@@ -452,7 +452,7 @@ class ClassTransformer {
file: this.file
};
path.traverse(verifyConstructorVisitor, state);
path.get("value").traverse(verifyConstructorVisitor, state);
this.bareSuper = state.bareSuper;

View File

@@ -237,11 +237,12 @@ export default class Scope {
var local = this.getOwnBindingInfo(name);
if (!local) return;
if (kind === "param") return;
if (kind === "hoisted" && local.kind === "let") return;
var duplicate = false;
duplicate ||= local.kind === "let" || local.kind === "const" || local.kind === "module";
duplicate ||= kind === "let" || kind === "const" || local.kind === "let" || local.kind === "const" || local.kind === "module";
duplicate ||= local.kind === "param" && (kind === "let" || kind === "const");
if (duplicate) {