Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e456f0ec1 | ||
|
|
793090628d | ||
|
|
9ed251cb08 | ||
|
|
480fa7f4e0 | ||
|
|
3e642dfa1b | ||
|
|
d9cbce1862 | ||
|
|
4bd19da3c2 | ||
|
|
7c710a0378 | ||
|
|
56335409d3 | ||
|
|
91d78afc67 | ||
|
|
54c6339f20 |
18
CHANGELOG.md
18
CHANGELOG.md
@@ -13,6 +13,24 @@ _Note: Gaps between patch versions are faulty/broken releases._
|
||||
|
||||
See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
|
||||
|
||||
## 5.0.8
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix falsy static class properties not being writable.
|
||||
* Fix block scoping collisions not properly detecting modules and function clashes.
|
||||
* Skip `this` before `super` for derived constructors on functions.
|
||||
|
||||
## 5.0.7
|
||||
|
||||
* **New Feature**
|
||||
* Add `--ignore` and `--only` support to the CLI.
|
||||
* **Bug Fix**
|
||||
* Remove `HOMEPATH` environment variable from home resolution in `babel/register` cache.
|
||||
* **Internal**
|
||||
* Disable WIP path resolution introducing infinite recursion in some code examples.
|
||||
* **Polish**
|
||||
* Add live binding to CommonJS default imports.
|
||||
|
||||
## 5.0.6
|
||||
|
||||
* **Bug Fix**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "babel-core",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "5.0.7",
|
||||
"version": "5.0.8",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"repository": "babel/babel",
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "babel",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "5.0.6",
|
||||
"version": "5.0.7",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"repository": "babel/babel",
|
||||
"preferGlobal": true,
|
||||
"dependencies": {
|
||||
"chokidar": "^0.12.6",
|
||||
"babel-core": "^5.0.6",
|
||||
"babel-core": "^5.0.7",
|
||||
"commander": "^2.6.0",
|
||||
"fs-readdir-recursive": "^0.1.0",
|
||||
"output-file-sync": "^1.1.0",
|
||||
@@ -22,4 +22,4 @@
|
||||
"babel-node": "./bin/babel-node",
|
||||
"babel-external-helpers": "./bin/babel-external-helpers"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "babel-runtime",
|
||||
"description": "babel selfContained runtime",
|
||||
"version": "5.0.6",
|
||||
"version": "5.0.7",
|
||||
"repository": "babel/babel",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"dependencies": {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if (descriptor.value) descriptor.writable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +62,18 @@ var verifyConstructorVisitor = traverse.explode({
|
||||
}
|
||||
},
|
||||
|
||||
FunctionDeclaration: {
|
||||
enter() {
|
||||
this.skip();
|
||||
}
|
||||
},
|
||||
|
||||
FunctionExpression: {
|
||||
enter() {
|
||||
this.skip();
|
||||
}
|
||||
},
|
||||
|
||||
ThisExpression: {
|
||||
enter(node, parent, scope, state) {
|
||||
if (state.hasSuper && !state.hasBareSuper) {
|
||||
@@ -440,7 +452,7 @@ class ClassTransformer {
|
||||
file: this.file
|
||||
};
|
||||
|
||||
path.traverse(verifyConstructorVisitor, state);
|
||||
path.get("value").traverse(verifyConstructorVisitor, state);
|
||||
|
||||
this.bareSuper = state.bareSuper;
|
||||
|
||||
|
||||
@@ -237,12 +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) {
|
||||
@@ -477,6 +477,15 @@ export default class Scope {
|
||||
this.traverse(path.get("body").node, blockVariableVisitor, this);
|
||||
}
|
||||
|
||||
// Program, Function - var variables
|
||||
|
||||
if (path.isProgram() || path.isFunction()) {
|
||||
this.traverse(path.node, functionVariableVisitor, {
|
||||
blockId: path.get("id").node,
|
||||
scope: this
|
||||
});
|
||||
}
|
||||
|
||||
// Program, BlockStatement, Function - let variables
|
||||
|
||||
if (path.isBlockStatement() || path.isProgram()) {
|
||||
@@ -495,15 +504,6 @@ export default class Scope {
|
||||
this.registerBinding("let", path);
|
||||
}
|
||||
|
||||
// Program, Function - var variables
|
||||
|
||||
if (path.isProgram() || path.isFunction()) {
|
||||
this.traverse(path.node, functionVariableVisitor, {
|
||||
blockId: path.get("id").node,
|
||||
scope: this
|
||||
});
|
||||
}
|
||||
|
||||
// Program
|
||||
|
||||
if (path.isProgram()) {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class Foo {
|
||||
static num = 0;
|
||||
static str = "foo";
|
||||
}
|
||||
|
||||
assert.equal(Foo.num, 0);
|
||||
assert.equal(Foo.num = 1, 1);
|
||||
assert.equal(Foo.str, "foo");
|
||||
assert.equal(Foo.str = "bar", "bar");
|
||||
@@ -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";
|
||||
|
||||
3
test/core/fixtures/transformation/misc/options.json
Normal file
3
test/core/fixtures/transformation/misc/options.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"externalHelpers": true
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Foo extends Bar {
|
||||
constructor (options) {
|
||||
let parentOptions = {};
|
||||
parentOptions.init = function () {
|
||||
this;
|
||||
};
|
||||
super(parentOptions);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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"];
|
||||
|
||||
Reference in New Issue
Block a user