Compare commits

...

16 Commits

Author SHA1 Message Date
Sebastian McKenzie
06a31c419a v5.0.12 2015-04-08 08:55:02 -07:00
Sebastian McKenzie
da566110c0 add 5.0.12 changelog 2015-04-08 08:53:40 -07:00
Sebastian McKenzie
c12c4a5c39 don't touch function name containers when remapping modules - fixes #1160 2015-04-08 08:52:53 -07:00
Sebastian McKenzie
d114349890 5.0.11 2015-04-08 08:15:15 -07:00
Sebastian McKenzie
8d6ae0e1eb v5.0.11 2015-04-08 08:14:28 -07:00
Sebastian McKenzie
cb8b47ee2f add missing curly brace to regression test 2015-04-08 08:13:33 -07:00
Sebastian McKenzie
daf24c5c59 add 5.0.10 changelog 2015-04-08 08:12:33 -07:00
Sebastian McKenzie
cdb2784e75 add #1199 regression test 2015-04-08 08:11:01 -07:00
Sebastian McKenzie
93feabb82e fix forOf loop inheritance - fixes #1169 2015-04-08 08:10:53 -07:00
Sebastian McKenzie
982c142bf6 Merge branch 'master' of github.com:babel/babel 2015-04-08 07:47:52 -07:00
Sebastian McKenzie
de5520a94f disable scope caching 2015-04-08 07:42:04 -07:00
Sebastian McKenzie
c239d06f10 fix MetaProperty generation 2015-04-08 07:41:56 -07:00
Sebastian McKenzie
a5fed376d8 Merge pull request #1191 from zertosh/babelrc-comments
Strip out comments before parsing babelrc
2015-04-07 18:09:07 -07:00
Sebastian McKenzie
e99fd77d89 downgrade and fix mocha version - fixes #1196 2015-04-07 18:07:23 -07:00
Sebastian McKenzie
1374863b9c 5.0.10 2015-04-07 18:06:52 -07:00
Andres Suarez
e88c28f88b Strip out comments before parsing babelrc 2015-04-07 18:50:01 -04:00
21 changed files with 231 additions and 11 deletions

View File

@@ -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.12
* **Bug Fix**
* Fix incorrect remapping of module references inside of a function id redirection container.
## 5.0.11
* **Bug Fix**
* Fix new `for...of` loops not properly inheriting their original loop.
* **Internal**
* Disable scope instance cache.
* **Polish**
* Allow comments in `.babelrc` JSON.
## 5.0.9
* **Polish**

View File

@@ -1,7 +1,7 @@
{
"name": "babel-core",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "5.0.10",
"version": "5.0.12",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"repository": "babel/babel",
@@ -53,6 +53,7 @@
"slash": "^1.0.0",
"source-map": "^0.4.0",
"source-map-support": "^0.2.9",
"strip-json-comments": "^1.0.2",
"to-fast-properties": "^1.0.0",
"trim-right": "^1.0.0"
},
@@ -65,7 +66,7 @@
"esvalid": "^1.1.0",
"istanbul": "^0.3.5",
"matcha": "^0.6.0",
"mocha": "^2.1.0",
"mocha": "2.1.0",
"rimraf": "^2.2.8",
"uglify-js": "^2.4.16"
}

View File

@@ -1,14 +1,14 @@
{
"name": "babel",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "5.0.9",
"version": "5.0.11",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"repository": "babel/babel",
"preferGlobal": true,
"dependencies": {
"chokidar": "^0.12.6",
"babel-core": "^5.0.9",
"babel-core": "^5.0.11",
"commander": "^2.6.0",
"fs-readdir-recursive": "^0.1.0",
"output-file-sync": "^1.1.0",

View File

@@ -1,7 +1,7 @@
{
"name": "babel-runtime",
"description": "babel selfContained runtime",
"version": "5.0.9",
"version": "5.0.11",
"repository": "babel/babel",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"dependencies": {

View File

@@ -169,4 +169,8 @@ export function MemberExpression(node, print) {
}
}
export { MemberExpression as MetaProperty };
export function MetaProperty(node, print) {
print(node.meta);
this.push(".");
print(node.property);
}

View File

@@ -1,3 +1,4 @@
import stripJsonComments from "strip-json-comments";
import merge from "lodash/object/merge";
import path from "path";
import fs from "fs";
@@ -24,7 +25,7 @@ export default function (loc, opts = {}) {
var json;
try {
json = jsons[content] ||= JSON.parse(content);
json = jsons[content] ||= JSON.parse(stripJsonComments(content));
} catch (err) {
err.message = `${file}: ${err.message}`;
throw err;

View File

@@ -27,6 +27,7 @@ var wrap = function (state, method, id, scope) {
FUNCTION_ID: id,
FUNCTION_KEY: scope.generateUidIdentifier(id.name)
});
template.callee._skipModulesRemap = true;
// shim in dummy params to retain function arity, if you try to read the
// source then you'll get the original since it's proxied so it's all good

View File

@@ -46,6 +46,10 @@ var remapVisitor = {
}
}
if (node._skipModulesRemap) {
return this.skip();
}
if (t.isAssignmentExpression(node) && !node._ignoreModulesRemap) {
var exported = formatter.getExport(node.left, scope);
if (exported) {

View File

@@ -17,9 +17,6 @@ export function ForOfStatement(node, parent, scope, file) {
var loop = build.loop;
var block = loop.body;
// inherit comments from the original loop
t.inheritsComments(loop, node);
// ensure that it's a block so we can take all its statements
t.ensureBlock(node);
@@ -32,6 +29,7 @@ export function ForOfStatement(node, parent, scope, file) {
block.body = block.body.concat(node.body.body);
t.inherits(loop, node);
t.inherits(loop.body, node.body);
if (build.replaceParent) {
this.parentPath.replaceWithMultiple(build.node);

View File

@@ -80,7 +80,7 @@ export default class Scope {
if (cached && cached.parent === parent) {
return cached;
} else {
path.setData("scope", this);
//path.setData("scope", this);
}
this.parent = parent;

View File

@@ -0,0 +1,11 @@
function foo() {
let input = ['a', 'b', 'c']
let output = {}
for (let c of input) {
let name = c
output[name] = name
}
return output
}

View File

@@ -0,0 +1,34 @@
'use strict';
function foo() {
var input = ['a', 'b', 'c'];
var output = {};
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var c = _step.value;
var _name = c;
output[_name] = _name;
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator['return']) {
_iterator['return']();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
return output;
}

View File

@@ -0,0 +1,8 @@
const bug = 1;
function foo() {}
function bar() {
var bug;
bug = 2;
}

View File

@@ -0,0 +1,10 @@
"use strict";
var bug = 1;
function foo() {}
function bar() {
var bug;
bug = 2;
}

View File

@@ -0,0 +1,8 @@
import last from "lodash/array/last"
export default class Container {
last(key) {
if (!this.has(key)) return
return last(this.tokens.get(key))
}
}

View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _last2 = require("lodash/array/last");
var _last3 = babelHelpers.interopRequireWildcard(_last2);
var Container = (function () {
function Container() {
babelHelpers.classCallCheck(this, Container);
}
babelHelpers.createClass(Container, [{
key: "last",
value: (function (_last) {
function last(_x) {
return _last.apply(this, arguments);
}
last.toString = function () {
return _last.toString();
};
return last;
})(function (key) {
if (!this.has(key)) return;
return _last3["default"](this.tokens.get(key));
})
}]);
return Container;
})();
exports["default"] = Container;
module.exports = exports["default"];

View File

@@ -0,0 +1,7 @@
import {getForm} from "./store"
export default class Login extends React.Component {
getForm() {
return getForm().toJS()
}
}

View File

@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _getForm2 = require("./store");
var Login = (function (_React$Component) {
function Login() {
babelHelpers.classCallCheck(this, Login);
if (_React$Component != null) {
_React$Component.apply(this, arguments);
}
}
babelHelpers.inherits(Login, _React$Component);
babelHelpers.createClass(Login, [{
key: "getForm",
value: (function (_getForm) {
function getForm() {
return _getForm.apply(this, arguments);
}
getForm.toString = function () {
return _getForm.toString();
};
return getForm;
})(function () {
return _getForm2.getForm().toJS();
})
}]);
return Login;
})(React.Component);
exports["default"] = Login;
module.exports = exports["default"];

View File

@@ -0,0 +1,9 @@
import events from "events";
class Template {
events() {
return events;
}
}
console.log(new Template().events());

View File

@@ -0,0 +1,31 @@
"use strict";
var _events2 = require("events");
var _events3 = babelHelpers.interopRequireWildcard(_events2);
var Template = (function () {
function Template() {
babelHelpers.classCallCheck(this, Template);
}
babelHelpers.createClass(Template, [{
key: "events",
value: (function (_events) {
function events() {
return _events.apply(this, arguments);
}
events.toString = function () {
return _events.toString();
};
return events;
})(function () {
return _events3["default"];
})
}]);
return Template;
})();
console.log(new Template().events());

View File

@@ -0,0 +1,3 @@
{
"externalHelpers": true
}