Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7ba54724c | ||
|
|
7f7ee41315 | ||
|
|
b33f05bd3d | ||
|
|
1ae6eabedd | ||
|
|
973be9ad96 | ||
|
|
979ce93499 | ||
|
|
642e36c259 | ||
|
|
efaf56c6de | ||
|
|
a0c7950d8a |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -11,6 +11,18 @@
|
||||
|
||||
_Note: Gaps between patch versions are faulty/broken releases._
|
||||
|
||||
## 3.0.13
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix modules loose mode using `modules` instead of `es6.modules`.
|
||||
|
||||
## 3.0.12
|
||||
|
||||
* **Internal**
|
||||
* Add internal debug messages.
|
||||
* **Bug Fix**
|
||||
* Add `noScope` option to `traverse.clearProperties`.
|
||||
|
||||
## 3.0.11
|
||||
|
||||
* **Bug Fix**
|
||||
|
||||
@@ -312,7 +312,7 @@ File.prototype.parse = function (code) {
|
||||
|
||||
var opts = this.opts;
|
||||
|
||||
opts.allowImportExportEverywhere = this.isLoose("modules");
|
||||
opts.allowImportExportEverywhere = this.isLoose("es6.modules");
|
||||
|
||||
return util.parse(opts, code, function (tree) {
|
||||
self.transform(tree);
|
||||
@@ -323,6 +323,8 @@ File.prototype.parse = function (code) {
|
||||
File.prototype.transform = function (ast) {
|
||||
var self = this;
|
||||
|
||||
util.debug(this.opts.filename);
|
||||
|
||||
this.ast = ast;
|
||||
this.lastStatements = t.getLastStatements(ast.program);
|
||||
this.scope = new Scope(ast.program, ast, null, this);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
module.exports = TransformerPass;
|
||||
|
||||
var traverse = require("../traverse");
|
||||
var util = require("../util");
|
||||
var _ = require("lodash");
|
||||
|
||||
/**
|
||||
@@ -60,6 +61,8 @@ var transformVisitor = {
|
||||
TransformerPass.prototype.transform = function () {
|
||||
var file = this.file;
|
||||
|
||||
util.debug(file.opts.filename + ": Running transformer " + this.transformer.key);
|
||||
|
||||
this.astRun("before");
|
||||
|
||||
var state = { file: file, handlers: this.handlers, pass: this };
|
||||
|
||||
@@ -58,7 +58,6 @@ module.exports = {
|
||||
"es6.parameters.default": require("./es6/parameters.default"),
|
||||
"es6.parameters.rest": require("./es6/parameters.rest"),
|
||||
|
||||
// needs to be before regenerator since regenerator doesn't know how to handle destructuring patterns
|
||||
"es6.destructuring": require("./es6/destructuring"),
|
||||
|
||||
// needs to be after `regenerator` due to needing `regeneratorRuntime` references
|
||||
|
||||
@@ -110,7 +110,7 @@ TraversalContext.prototype.visitNode = function (obj, key, opts, scope, parent,
|
||||
|
||||
var ourScope = scope;
|
||||
// we're entering a new scope so let's construct it!
|
||||
if (t.isScope(node)) {
|
||||
if (!opts.noScope && t.isScope(node)) {
|
||||
ourScope = new Scope(node, parent, scope);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ function traverseNode(node, opts, scope, state) {
|
||||
function traverse(parent, opts, scope, state) {
|
||||
if (!parent) return;
|
||||
|
||||
if (!scope) {
|
||||
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");
|
||||
}
|
||||
@@ -217,7 +217,10 @@ function clearNode(node) {
|
||||
}
|
||||
}
|
||||
|
||||
var clearVisitor = { enter: clearNode };
|
||||
var clearVisitor = {
|
||||
noScope: true,
|
||||
enter: clearNode
|
||||
};
|
||||
|
||||
function clearComments(comments) {
|
||||
for (var i = 0; i < comments.length; i++) {
|
||||
|
||||
@@ -5,6 +5,7 @@ require("./patch");
|
||||
var estraverse = require("estraverse");
|
||||
var codeFrame = require("./helpers/code-frame");
|
||||
var traverse = require("./traverse");
|
||||
var debug = require("debug");
|
||||
var acorn = require("acorn-6to5");
|
||||
var path = require("path");
|
||||
var util = require("util");
|
||||
@@ -14,6 +15,8 @@ var _ = require("lodash");
|
||||
|
||||
exports.inherits = util.inherits;
|
||||
|
||||
exports.debug = debug("6to5");
|
||||
|
||||
exports.canCompile = function (filename, altExts) {
|
||||
var exts = altExts || exports.canCompile.EXTENSIONS;
|
||||
var ext = path.extname(filename);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "6to5",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "3.0.11",
|
||||
"version": "3.0.13",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://6to5.org/",
|
||||
"repository": "6to5/6to5",
|
||||
@@ -38,6 +38,7 @@
|
||||
"chokidar": "0.12.6",
|
||||
"commander": "2.6.0",
|
||||
"core-js": "^0.4.9",
|
||||
"debug": "^2.1.1",
|
||||
"detect-indent": "3.0.0",
|
||||
"estraverse": "1.9.1",
|
||||
"esutils": "1.1.6",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "6to5-runtime",
|
||||
"description": "6to5 selfContained runtime",
|
||||
"version": "3.0.10",
|
||||
"version": "3.0.12",
|
||||
"repository": "6to5/6to5",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>"
|
||||
}
|
||||
Reference in New Issue
Block a user