Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7736fa11f2 | ||
|
|
d203924541 | ||
|
|
cd23e500a1 | ||
|
|
bf24a0d6b5 | ||
|
|
279d1affea | ||
|
|
2a1e012240 | ||
|
|
a307a961a6 | ||
|
|
fe5b1dc542 | ||
|
|
f057347ae9 |
@@ -11,12 +11,19 @@
|
||||
|
||||
_Note: Gaps between patch versions are faulty/broken releases._
|
||||
|
||||
## 2.7.1
|
||||
|
||||
* **New Feature**
|
||||
* Expose `version` on browser and node API.
|
||||
* **Internal**
|
||||
* Upgrade `core-js` to 0.4.1
|
||||
|
||||
## 2.7.0
|
||||
|
||||
* **Spec Compliancy**
|
||||
* Disallow reassignments of imports.
|
||||
* **New Feature**
|
||||
* `reactCompat` to enable pre-v0.12 react components.
|
||||
* `reactCompat` option to enable pre-v0.12 react components.
|
||||
|
||||
## 2.6.3
|
||||
|
||||
|
||||
2
Makefile
2
Makefile
@@ -53,7 +53,7 @@ test-cov:
|
||||
node $(ISTANBUL_CMD) $(MOCHA_CMD) --
|
||||
|
||||
test-travis: bootstrap
|
||||
$(MOCHA_CMD)
|
||||
node $(ISTANBUL_CMD) $(MOCHA_CMD) --
|
||||
if test -n "$$CODECLIMATE_REPO_TOKEN"; then codeclimate < coverage/lcov.info; fi
|
||||
|
||||
test-browser:
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
var transform = module.exports = require("./transformation/transform");
|
||||
|
||||
transform.version = require("../../package").version;
|
||||
|
||||
transform.transform = transform;
|
||||
|
||||
transform.run = function (code, opts) {
|
||||
|
||||
@@ -48,6 +48,7 @@ File.normaliseOptions = function (opts) {
|
||||
|
||||
_.defaults(opts, {
|
||||
experimental: false,
|
||||
reactCompat: false,
|
||||
playground: false,
|
||||
whitespace: true,
|
||||
moduleIds: opts.amdModuleIds || false,
|
||||
|
||||
@@ -3,6 +3,8 @@ var util = require("./util");
|
||||
var fs = require("fs");
|
||||
var _ = require("lodash");
|
||||
|
||||
exports.version = require("../../package").version;
|
||||
|
||||
exports.types = require("./types");
|
||||
|
||||
exports.runtime = require("./runtime-generator");
|
||||
|
||||
@@ -13,7 +13,7 @@ function DefaultFormatter(file) {
|
||||
|
||||
this.remapAssignments();
|
||||
|
||||
this.checkCollisions();
|
||||
//this.checkCollisions();
|
||||
}
|
||||
|
||||
DefaultFormatter.prototype.getLocalExports = function () {
|
||||
|
||||
@@ -39,6 +39,8 @@ transform.moduleFormatters = {
|
||||
};
|
||||
|
||||
_.each({
|
||||
specNoForInOfAssignment: require("./transformers/spec-no-for-in-of-assignment"),
|
||||
|
||||
// playground
|
||||
methodBinding: require("./transformers/playground-method-binding"),
|
||||
memoizationOperator: require("./transformers/playground-memoization-operator"),
|
||||
|
||||
@@ -42,7 +42,7 @@ var isTag = function(tagName) {
|
||||
|
||||
exports.XJSOpeningElement = {
|
||||
exit: function (node, parent, file) {
|
||||
var reactCompat = file.opts && file.opts.reactCompat;
|
||||
var reactCompat = file.opts.reactCompat;
|
||||
var tagExpr = node.name;
|
||||
var args = [];
|
||||
|
||||
@@ -123,10 +123,10 @@ exports.XJSOpeningElement = {
|
||||
args
|
||||
);
|
||||
}
|
||||
} else {
|
||||
tagExpr = t.memberExpression(t.identifier("React"), t.identifier("createElement"));
|
||||
return t.callExpression(tagExpr, args);
|
||||
}
|
||||
|
||||
tagExpr = t.memberExpression(t.identifier("React"), t.identifier("createElement"));
|
||||
return t.callExpression(tagExpr, args);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
var t = require("../../types");
|
||||
|
||||
exports.ForInStatement =
|
||||
exports.ForOfStatement = function (node, parent, file) {
|
||||
var left = node.left;
|
||||
if (t.isVariableDeclaration(left)) {
|
||||
var declar = left.declarations[0];
|
||||
if (declar.init) throw file.errorWithNode(declar, "No assignments allowed in for-in/of head");
|
||||
}
|
||||
};
|
||||
@@ -146,10 +146,10 @@ exports.template = function (name, nodes, keepExpression) {
|
||||
var node = template.body[0];
|
||||
|
||||
if (!keepExpression && t.isExpressionStatement(node)) {
|
||||
node = node.expression;
|
||||
return node.expression;
|
||||
} else {
|
||||
return node;
|
||||
}
|
||||
|
||||
return node;
|
||||
};
|
||||
|
||||
exports.codeFrame = function (lines, lineNumber, colNumber) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "6to5",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "2.7.0",
|
||||
"version": "2.7.2",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://github.com/6to5/6to5",
|
||||
"repository": {
|
||||
@@ -43,7 +43,7 @@
|
||||
"ast-types": "~0.6.1",
|
||||
"chokidar": "0.11.1",
|
||||
"commander": "2.5.0",
|
||||
"core-js": "^0.4.0",
|
||||
"core-js": "^0.4.1",
|
||||
"estraverse": "1.8.0",
|
||||
"esutils": "1.1.6",
|
||||
"esvalid": "^1.1.0",
|
||||
|
||||
3
test/fixtures/transformation/spec/for-in-assignment/actual.js
vendored
Normal file
3
test/fixtures/transformation/spec/for-in-assignment/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
for (var i = 0 in obj) {
|
||||
|
||||
}
|
||||
3
test/fixtures/transformation/spec/for-in-assignment/options.json
vendored
Normal file
3
test/fixtures/transformation/spec/for-in-assignment/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "No assignments allowed in for-in/of head"
|
||||
}
|
||||
3
test/fixtures/transformation/spec/for-of-assignment/actual.js
vendored
Normal file
3
test/fixtures/transformation/spec/for-of-assignment/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
for (var i = 0 of obj) {
|
||||
|
||||
}
|
||||
3
test/fixtures/transformation/spec/for-of-assignment/options.json
vendored
Normal file
3
test/fixtures/transformation/spec/for-of-assignment/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "No assignments allowed in for-in/of head"
|
||||
}
|
||||
Reference in New Issue
Block a user