fix tests, better block scoped collisions
This commit is contained in:
parent
7c710a0378
commit
4bd19da3c2
@ -452,7 +452,7 @@ class ClassTransformer {
|
||||
file: this.file
|
||||
};
|
||||
|
||||
path.traverse(verifyConstructorVisitor, state);
|
||||
path.get("value").traverse(verifyConstructorVisitor, state);
|
||||
|
||||
this.bareSuper = state.bareSuper;
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -89,7 +89,7 @@ var a: Promise<bool>[]
|
||||
var a:(...rest:Array<number>) => number
|
||||
var identity: <T>(x: T) => T
|
||||
var identity: <T>(x: T, ...y:T[]) => T
|
||||
import type foo from "bar";
|
||||
import type foo4 from "bar";
|
||||
import type { foo2, bar } from "baz";
|
||||
import type { foo as bar2 } from "baz";
|
||||
import type from "foo";
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class Foo {
|
||||
class Foo extends Bar {
|
||||
constructor (options) {
|
||||
let parentOptions = {};
|
||||
parentOptions.init = function () {
|
||||
|
||||
@ -1,11 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
var Foo = function Foo(options) {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
var Foo = (function (_Bar) {
|
||||
function Foo(options) {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
|
||||
var parentOptions = {};
|
||||
parentOptions.init = function () {
|
||||
this;
|
||||
};
|
||||
babelHelpers.get(Object.getPrototypeOf(Foo.prototype), "constructor", this).call(this, parentOptions);
|
||||
};
|
||||
var parentOptions = {};
|
||||
parentOptions.init = function () {
|
||||
this;
|
||||
};
|
||||
babelHelpers.get(Object.getPrototypeOf(Foo.prototype), "constructor", this).call(this, parentOptions);
|
||||
}
|
||||
|
||||
babelHelpers.inherits(Foo, _Bar);
|
||||
return Foo;
|
||||
})(Bar);
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
||||
|
||||
var _toString = require("foo");
|
||||
|
||||
var _toString2 = _interopRequireWildcard(_toString);
|
||||
var _toString2 = babelHelpers.interopRequireWildcard(_toString);
|
||||
|
||||
_toString2["default"];
|
||||
_toString2["default"];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user