Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7c7da7526 | ||
|
|
d7fb9f67df | ||
|
|
eef6002324 | ||
|
|
32bcf4c3a5 | ||
|
|
86060cb0ce | ||
|
|
66a836d435 | ||
|
|
ecc14c2a31 | ||
|
|
7e9b60fba5 | ||
|
|
313f1e755a | ||
|
|
8c7ef0a2c9 | ||
|
|
8f79010b16 | ||
|
|
022e6f26aa | ||
|
|
138fa6c9f8 | ||
|
|
c07704cc80 | ||
|
|
bf811ea34a | ||
|
|
8af3ea1c43 | ||
|
|
5fbe147a5e | ||
|
|
a9e214b1db |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -13,6 +13,20 @@ _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.3
|
||||
|
||||
* **Bug Fix**
|
||||
* Make relative location absolute before calling `resolveRc`.
|
||||
* **Internal**
|
||||
* Switch to global UID registry.
|
||||
* Add `breakConfig` option to prevent Babel from erroring when hitting that option.
|
||||
|
||||
## 5.0.1
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix duplicate declaration regression.
|
||||
* Fix not being able to call non-writable methods.
|
||||
|
||||
## 5.0.0
|
||||
|
||||
* **New Feature**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "babel-core",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "5.0.0",
|
||||
"version": "5.0.3",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"repository": "babel/babel",
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
{
|
||||
"name": "babel",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "5.0.0-beta4",
|
||||
"version": "5.0.2",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"repository": "babel/babel",
|
||||
"preferGlobal": true,
|
||||
"dependencies": {
|
||||
"chokidar": "^0.12.6",
|
||||
"babel-core": "5.0.0-beta4",
|
||||
"babel-core": "^5.0.2",
|
||||
"commander": "^2.6.0",
|
||||
"fs-readdir-recursive": "^0.1.0",
|
||||
"output-file-sync": "^1.1.0",
|
||||
"lodash": "^3.2.0",
|
||||
"convert-source-map": "^0.5.0",
|
||||
"source-map": "^0.4.0"
|
||||
"source-map": "^0.4.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"babel": "./bin/babel/index.js",
|
||||
"babel-node": "./bin/babel-node",
|
||||
"babel-external-helpers": "./bin/babel-external-helpers"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "babel-runtime",
|
||||
"description": "babel selfContained runtime",
|
||||
"version": "5.0.0-beta4",
|
||||
"version": "5.0.2",
|
||||
"repository": "babel/babel",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"dependencies": {
|
||||
"core-js": "^0.8.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ var pkg = require(pkgLoc);
|
||||
var mainPkg = require("../package.json");
|
||||
|
||||
pkg.version = mainPkg.version;
|
||||
pkg.dependencies["babel-core"] = mainPkg.version;
|
||||
pkg.dependencies["babel-core"] = "^" + mainPkg.version;
|
||||
|
||||
outputFile(pkgLoc, JSON.stringify(pkg, null, 2));
|
||||
|
||||
@@ -44,6 +44,7 @@ export default class File {
|
||||
this.usedHelpers = {};
|
||||
this.dynamicData = {};
|
||||
this.data = {};
|
||||
this.uids = {};
|
||||
|
||||
this.lastStatements = [];
|
||||
this.log = new Logger(this, opts.filename || "unknown");
|
||||
@@ -89,8 +90,10 @@ export default class File {
|
||||
normalizeOptions(opts: Object) {
|
||||
opts = assign({}, opts);
|
||||
|
||||
if (opts.filename && isAbsolute(opts.filename)) {
|
||||
opts = resolveRc(opts.filename, opts);
|
||||
if (opts.filename) {
|
||||
var rcFilename = opts.filename;
|
||||
if (!isAbsolute(rcFilename)) rcFilename = path.join(process.cwd(), rcFilename);
|
||||
opts = resolveRc(rcFilename, opts);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -194,5 +194,13 @@
|
||||
"moduleRoot": {
|
||||
"type": "string",
|
||||
"description": "optional prefix for the AMD module formatter that will be prepend to the filename on module definitions"
|
||||
},
|
||||
|
||||
"breakConfig": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"hidden": true,
|
||||
"description": "stop trying to load .babelrc files"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
} else {
|
||||
return get(parent, property, receiver);
|
||||
}
|
||||
} else if ("value" in desc && desc.writable) {
|
||||
} else if ("value" in desc) {
|
||||
return desc.value;
|
||||
} else {
|
||||
var getter = desc.get;
|
||||
|
||||
@@ -7,7 +7,7 @@ export default function traverse(parent, opts, scope, state, parentPath) {
|
||||
|
||||
if (!opts.noScope && !scope) {
|
||||
if (parent.type !== "Program" && parent.type !== "File") {
|
||||
throw new Error(`Must pass a scope unless traversing a Program/File got a ${parent.type} node`);
|
||||
throw new Error(`Must pass a scope and parentPath unless traversing a Program/File got a ${parent.type} node`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -216,9 +216,9 @@ export default class TraversalPath {
|
||||
this.opts = context.opts;
|
||||
}
|
||||
|
||||
this.setScope(file);
|
||||
|
||||
this.type = this.node && this.node.type;
|
||||
|
||||
this.setScope(file);
|
||||
}
|
||||
|
||||
_remove() {
|
||||
|
||||
@@ -57,7 +57,8 @@ var blockVariableVisitor = {
|
||||
enter(node, parent, scope, state) {
|
||||
if (this.isFunctionDeclaration() || this.isBlockScoped()) {
|
||||
state.registerDeclaration(this);
|
||||
} else if (this.isScope()) {
|
||||
}
|
||||
if (this.isScope()) {
|
||||
this.skip();
|
||||
}
|
||||
}
|
||||
@@ -100,7 +101,7 @@ export default class Scope {
|
||||
*/
|
||||
|
||||
traverse(node: Object, opts: Object, state?) {
|
||||
traverse(node, opts, this, state);
|
||||
traverse(node, opts, this, state, this.path);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,7 +135,7 @@ export default class Scope {
|
||||
uid = this._generateUid(name, i);
|
||||
i++;
|
||||
} while (this.hasBinding(uid) || this.hasGlobal(uid) || this.hasUid(uid));
|
||||
this.getFunctionParent().uids[uid] = true;
|
||||
this.file.uids[uid] = true;
|
||||
return uid;
|
||||
}
|
||||
|
||||
@@ -151,7 +152,7 @@ export default class Scope {
|
||||
hasUid(name): boolean {
|
||||
var scope = this;
|
||||
do {
|
||||
if (scope.uids[name]) return true;
|
||||
if (scope.file.uids[name]) return true;
|
||||
scope = scope.parent;
|
||||
} while (scope);
|
||||
return false;
|
||||
@@ -433,8 +434,7 @@ export default class Scope {
|
||||
|
||||
info = this.block._scopeInfo = {
|
||||
bindings: object(),
|
||||
globals: object(),
|
||||
uids: object()
|
||||
globals: object()
|
||||
};
|
||||
|
||||
extend(this, info);
|
||||
@@ -657,7 +657,7 @@ export default class Scope {
|
||||
if (!name) return false;
|
||||
if (this.hasOwnBinding(name)) return true;
|
||||
if (this.parentHasBinding(name)) return true;
|
||||
if (this.uids[name]) return true;
|
||||
if (this.file.uids[name]) return true;
|
||||
if (includes(Scope.globals, name)) return true;
|
||||
if (includes(Scope.contextVariables, name)) return true;
|
||||
return false;
|
||||
|
||||
@@ -11,17 +11,17 @@ function one() {
|
||||
one(1, 2);
|
||||
|
||||
function two() {
|
||||
var _arguments = arguments;
|
||||
var _arguments2 = arguments;
|
||||
|
||||
var inner = function inner() {
|
||||
return _arguments;
|
||||
return _arguments2;
|
||||
};
|
||||
|
||||
var another = function another() {
|
||||
var _arguments2 = arguments;
|
||||
var _arguments3 = arguments;
|
||||
|
||||
var inner2 = function inner2() {
|
||||
return _arguments2;
|
||||
return _arguments3;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -30,20 +30,20 @@ function two() {
|
||||
two(1, 2);
|
||||
|
||||
function three() {
|
||||
var _arguments = arguments;
|
||||
var _arguments4 = arguments;
|
||||
|
||||
var fn = function fn() {
|
||||
return _arguments[0] + "bar";
|
||||
return _arguments4[0] + "bar";
|
||||
};
|
||||
return fn();
|
||||
}
|
||||
three("foo");
|
||||
|
||||
function four() {
|
||||
var _arguments = arguments;
|
||||
var _arguments5 = arguments;
|
||||
|
||||
var fn = function fn() {
|
||||
return _arguments[0].foo + "bar";
|
||||
return _arguments5[0].foo + "bar";
|
||||
};
|
||||
return fn();
|
||||
}
|
||||
@@ -66,4 +66,4 @@ function six(obj) {
|
||||
};
|
||||
return fn();
|
||||
}
|
||||
six();
|
||||
six();
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
};
|
||||
|
||||
_loop: for (var i in nums) {
|
||||
_loop2: for (var i in nums) {
|
||||
var _ret = _loop(i);
|
||||
|
||||
switch (_ret) {
|
||||
@@ -24,7 +24,7 @@
|
||||
continue;
|
||||
|
||||
case "break":
|
||||
break _loop;
|
||||
break _loop2;
|
||||
|
||||
default:
|
||||
if (typeof _ret === "object") return _ret.v;
|
||||
|
||||
@@ -20,11 +20,11 @@ var Test = (function (_Foo) {
|
||||
babelHelpers.inherits(Test, _Foo);
|
||||
|
||||
Test.prototype.test = function test() {
|
||||
var _Foo$prototype$test, _Foo$prototype$test2;
|
||||
var _Foo$prototype$test3, _Foo$prototype$test4;
|
||||
|
||||
_Foo.prototype.test.call(this);
|
||||
(_Foo$prototype$test = _Foo.prototype.test).call.apply(_Foo$prototype$test, [this].concat(babelHelpers.slice.call(arguments)));
|
||||
(_Foo$prototype$test2 = _Foo.prototype.test).call.apply(_Foo$prototype$test2, [this, "test"].concat(babelHelpers.slice.call(arguments)));
|
||||
(_Foo$prototype$test3 = _Foo.prototype.test).call.apply(_Foo$prototype$test3, [this].concat(babelHelpers.slice.call(arguments)));
|
||||
(_Foo$prototype$test4 = _Foo.prototype.test).call.apply(_Foo$prototype$test4, [this, "test"].concat(babelHelpers.slice.call(arguments)));
|
||||
};
|
||||
|
||||
Test.foo = function foo() {
|
||||
|
||||
@@ -21,21 +21,21 @@ var Test = (function (_Foo) {
|
||||
babelHelpers.createClass(Test, [{
|
||||
key: "test",
|
||||
value: function test() {
|
||||
var _babelHelpers$get;
|
||||
var _babelHelpers$get3;
|
||||
|
||||
babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", this).call(this);
|
||||
babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", this).apply(this, arguments);
|
||||
(_babelHelpers$get = babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", this)).call.apply(_babelHelpers$get, [this, "test"].concat(babelHelpers.slice.call(arguments)));
|
||||
(_babelHelpers$get3 = babelHelpers.get(Object.getPrototypeOf(Test.prototype), "test", this)).call.apply(_babelHelpers$get3, [this, "test"].concat(babelHelpers.slice.call(arguments)));
|
||||
}
|
||||
}], [{
|
||||
key: "foo",
|
||||
value: function foo() {
|
||||
var _babelHelpers$get;
|
||||
var _babelHelpers$get4;
|
||||
|
||||
babelHelpers.get(Object.getPrototypeOf(Test), "foo", this).call(this);
|
||||
babelHelpers.get(Object.getPrototypeOf(Test), "foo", this).apply(this, arguments);
|
||||
(_babelHelpers$get = babelHelpers.get(Object.getPrototypeOf(Test), "foo", this)).call.apply(_babelHelpers$get, [this, "test"].concat(babelHelpers.slice.call(arguments)));
|
||||
(_babelHelpers$get4 = babelHelpers.get(Object.getPrototypeOf(Test), "foo", this)).call.apply(_babelHelpers$get4, [this, "test"].concat(babelHelpers.slice.call(arguments)));
|
||||
}
|
||||
}]);
|
||||
return Test;
|
||||
})(Foo);
|
||||
})(Foo);
|
||||
@@ -9,29 +9,29 @@ function somethingAdvanced(_ref) {
|
||||
var y2 = _ref$bottomRight.y;
|
||||
}
|
||||
|
||||
function unpackObject(_ref) {
|
||||
var title = _ref.title;
|
||||
var author = _ref.author;
|
||||
function unpackObject(_ref2) {
|
||||
var title = _ref2.title;
|
||||
var author = _ref2.author;
|
||||
|
||||
return title + " " + author;
|
||||
}
|
||||
|
||||
console.log(unpackObject({ title: "title", author: "author" }));
|
||||
|
||||
var unpackArray = function unpackArray(_ref, _ref3) {
|
||||
var _ref2 = babelHelpers.slicedToArray(_ref, 3);
|
||||
|
||||
var a = _ref2[0];
|
||||
var b = _ref2[1];
|
||||
var c = _ref2[2];
|
||||
|
||||
var unpackArray = function unpackArray(_ref3, _ref4) {
|
||||
var _ref32 = babelHelpers.slicedToArray(_ref3, 3);
|
||||
|
||||
var x = _ref32[0];
|
||||
var y = _ref32[1];
|
||||
var z = _ref32[2];
|
||||
var a = _ref32[0];
|
||||
var b = _ref32[1];
|
||||
var c = _ref32[2];
|
||||
|
||||
var _ref42 = babelHelpers.slicedToArray(_ref4, 3);
|
||||
|
||||
var x = _ref42[0];
|
||||
var y = _ref42[1];
|
||||
var z = _ref42[2];
|
||||
|
||||
return a + b + c;
|
||||
};
|
||||
|
||||
console.log(unpackArray(["hello", ", ", "world"], [1, 2, 3]));
|
||||
console.log(unpackArray(["hello", ", ", "world"], [1, 2, 3]));
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"externalHelpers": true
|
||||
}
|
||||
@@ -2,10 +2,8 @@
|
||||
|
||||
var _obj;
|
||||
|
||||
var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
|
||||
|
||||
var o = _obj = {
|
||||
m: function m() {
|
||||
return _get(Object.getPrototypeOf(_obj), "x", this);
|
||||
return babelHelpers.get(Object.getPrototypeOf(_obj), "x", this);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,8 +9,8 @@ var x = function x(foo) {
|
||||
};
|
||||
|
||||
var y = function y(foo) {
|
||||
for (var _len = arguments.length, bar = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
bar[_key - 1] = arguments[_key];
|
||||
for (var _len2 = arguments.length, bar = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
||||
bar[_key2 - 1] = arguments[_key2];
|
||||
}
|
||||
|
||||
var x = function z(bar) {
|
||||
@@ -19,8 +19,8 @@ var y = function y(foo) {
|
||||
};
|
||||
|
||||
var b = function b(x, y) {
|
||||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
||||
args[_key - 2] = arguments[_key];
|
||||
for (var _len3 = arguments.length, args = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
||||
args[_key3 - 2] = arguments[_key3];
|
||||
}
|
||||
|
||||
console.log(args[0]);
|
||||
@@ -29,8 +29,8 @@ var b = function b(x, y) {
|
||||
};
|
||||
|
||||
var z = function z(foo) {
|
||||
for (var _len = arguments.length, bar = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
bar[_key - 1] = arguments[_key];
|
||||
for (var _len4 = arguments.length, bar = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
||||
bar[_key4 - 1] = arguments[_key4];
|
||||
}
|
||||
|
||||
var x = function x() {
|
||||
@@ -39,18 +39,18 @@ var z = function z(foo) {
|
||||
};
|
||||
|
||||
var a = function a(foo) {
|
||||
for (var _len = arguments.length, bar = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
bar[_key - 1] = arguments[_key];
|
||||
for (var _len5 = arguments.length, bar = Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
|
||||
bar[_key5 - 1] = arguments[_key5];
|
||||
}
|
||||
|
||||
return bar.join(",");
|
||||
};
|
||||
|
||||
var b = function b(foo) {
|
||||
for (var _len = arguments.length, bar = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
bar[_key - 1] = arguments[_key];
|
||||
for (var _len6 = arguments.length, bar = Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
||||
bar[_key6 - 1] = arguments[_key6];
|
||||
}
|
||||
|
||||
var join = "join";
|
||||
return bar[join];
|
||||
};
|
||||
};
|
||||
@@ -43,21 +43,21 @@
|
||||
} finally {}
|
||||
})(1000000) === "foo";
|
||||
|
||||
(function f(_x) {
|
||||
var _again = true;
|
||||
(function f(_x2) {
|
||||
var _again2 = true;
|
||||
|
||||
_function: while (_again) {
|
||||
_again = false;
|
||||
var n = _x;
|
||||
_function2: while (_again2) {
|
||||
_again2 = false;
|
||||
var n = _x2;
|
||||
|
||||
if (n <= 0) {
|
||||
return "foo";
|
||||
}
|
||||
|
||||
try {} finally {
|
||||
_x = n - 1;
|
||||
_again = true;
|
||||
continue _function;
|
||||
_x2 = n - 1;
|
||||
_again2 = true;
|
||||
continue _function2;
|
||||
}
|
||||
}
|
||||
})(1000000) === "foo";
|
||||
@@ -0,0 +1,7 @@
|
||||
function A() {
|
||||
let a;
|
||||
}
|
||||
|
||||
function B() {
|
||||
let a;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
function A() {
|
||||
var a = undefined;
|
||||
}
|
||||
|
||||
function B() {
|
||||
var a = undefined;
|
||||
}
|
||||
@@ -11,9 +11,9 @@ function render(text) {
|
||||
var Foo2 = require("Foo");
|
||||
|
||||
function createComponent(text) {
|
||||
var _ref = <Foo2>{text}</Foo2>;
|
||||
var _ref2 = <Foo2>{text}</Foo2>;
|
||||
|
||||
return function render() {
|
||||
return _ref;
|
||||
return _ref2;
|
||||
};
|
||||
}
|
||||
@@ -6,8 +6,8 @@ function render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
var _ref = <div className="foo"><input type="checkbox" checked={true} /></div>;
|
||||
var _ref2 = <div className="foo"><input type="checkbox" checked={true} /></div>;
|
||||
|
||||
function render() {
|
||||
return _ref;
|
||||
return _ref2;
|
||||
}
|
||||
@@ -12,7 +12,7 @@ function render() {
|
||||
|
||||
function render() {
|
||||
var text = getText();
|
||||
var _ref = {
|
||||
var _ref2 = {
|
||||
type: "foo",
|
||||
ref: null,
|
||||
props: {
|
||||
@@ -21,6 +21,6 @@ function render() {
|
||||
key: null
|
||||
};
|
||||
return function () {
|
||||
return _ref;
|
||||
return _ref2;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,9 @@ var foo = function foo() {
|
||||
};
|
||||
|
||||
var bar = function bar() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
return function () {
|
||||
return React.createElement(_this.foo, null);
|
||||
return React.createElement(_this2.foo, null);
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -17,9 +17,9 @@ var f = (function (_f) {
|
||||
})(function (f) {});
|
||||
|
||||
var obj = {
|
||||
f: (function (_f) {
|
||||
function f(_x) {
|
||||
return _f.apply(this, arguments);
|
||||
f: (function (_f2) {
|
||||
function f(_x2) {
|
||||
return _f2.apply(this, arguments);
|
||||
}
|
||||
|
||||
f.toString = function () {
|
||||
|
||||
Reference in New Issue
Block a user