Compare commits

...

25 Commits

Author SHA1 Message Date
Sebastian McKenzie
8f0b7683a1 v3.6.5 2015-02-14 23:05:13 +11:00
Sebastian McKenzie
f0d2cbb055 update 3.6.5 changelog 2015-02-14 22:57:57 +11:00
Sebastian McKenzie
602c5e0ca0 upgrade core-js 2015-02-14 22:56:49 +11:00
Sebastian McKenzie
2a2dff0eaf remap head variables when a closure is required in blockScoping transformer - fixes #763 2015-02-14 20:21:34 +11:00
Sebastian McKenzie
e1151e08c9 register default globals as bindings 2015-02-14 19:08:41 +11:00
Sebastian McKenzie
84f54ca3c7 rename defaultDeclarations to globals 2015-02-14 19:08:02 +11:00
Sebastian McKenzie
5fb793b75f add validation.react transformer 2015-02-14 19:07:54 +11:00
Sebastian McKenzie
1adc9bfc70 use t.buildMatchMemberExpression in selfContained transformer 2015-02-14 19:07:46 +11:00
Sebastian McKenzie
3649fad485 ensureBlock on if statements with expression return statements - fixes #764 2015-02-14 19:07:23 +11:00
Sebastian McKenzie
0e1743738e add auxilary comment option to prepend to helpers - #777 2015-02-14 16:53:41 +11:00
Sebastian McKenzie
6ad16302cd update 3.6.3 changelog 2015-02-14 13:29:57 +11:00
Sebastian McKenzie
4b6b7af332 3.6.4 2015-02-14 13:29:52 +11:00
Sebastian McKenzie
55dfb423ee v3.6.4 2015-02-14 13:26:59 +11:00
Sebastian McKenzie
9d1bc4817d fix flow module type stripping 2015-02-14 13:24:39 +11:00
Sebastian McKenzie
fc8666e7a4 3.6.3 2015-02-14 13:22:18 +11:00
Sebastian McKenzie
07b6881d67 add support for flow type casts and module types 2015-02-14 13:22:13 +11:00
Sebastian McKenzie
1f208a06db v3.6.3 2015-02-14 13:01:17 +11:00
Sebastian McKenzie
b5c9c84542 update bin/6to5 tests to reflect new source location 2015-02-14 12:59:31 +11:00
Sebastian McKenzie
492555bb4e fix linting errors 2015-02-14 12:54:44 +11:00
Sebastian McKenzie
53d88c0f63 upgrade acorn-6to5 2015-02-14 12:53:54 +11:00
Sebastian McKenzie
8a5da57162 use default property on 6to5-runtime modules - fixes #774 2015-02-14 00:59:34 +11:00
Sebastian McKenzie
1627e2f47e use sourceFileName instead of sourceMapName - fixes #775 2015-02-14 00:44:32 +11:00
Sebastian McKenzie
e195d6ca55 use relative location when generating the sourceMapName in bin/6to5 for directories - fixes #775 2015-02-13 23:08:47 +11:00
Sebastian McKenzie
71d5d4fb2c remove MemberExpression from binding identifier collection 2015-02-13 21:10:23 +11:00
Sebastian McKenzie
dfe13cda0d 3.6.2 2015-02-13 21:08:14 +11:00
48 changed files with 223 additions and 84 deletions

View File

@@ -11,6 +11,32 @@
_Note: Gaps between patch versions are faulty/broken releases._
## 3.6.5
* **Internal**
* Upgrade `core-js`.
* **Bug Fix**
* Fix block scoping leaking variables in IIFE mode.
* Fix tail call transformer exploding on return statements as the consequent of an if statement.
* **New Feature**
* Add `validation.react` transformer.
## 3.6.4
* **New Feature**
* Add support for flow type casts and module types.
## 3.6.3
* **Internal**
* Upgrade `acorn-6to5`.
* Use `default` property on `6to5-runtime`.
## 3.6.2
* **Polish**
* Use better iterator detection in `slicedToArray` helper and add support for it to the `selfContained` transformer.
## 3.6.1
* **Bug Fix**

View File

@@ -16,7 +16,9 @@ module.exports = function (commander, filenames, opts) {
var dest = path.join(commander.outDir, relative);
var data = util.compile(src, { sourceMapName: dest });
var data = util.compile(src, {
sourceFileName: path.relative(dest + "/..", src)
});
if (commander.sourceMaps) {
var mapLoc = dest + ".map";

View File

@@ -26,6 +26,7 @@ commander.option("-c, --remove-comments", "Remove comments from the compiled cod
commander.option("-M, --module-ids", "Insert module id in modules", false);
commander.option("-R, --react-compat", "Makes the react transformer produce pre-v0.12 code");
commander.option("--keep-module-id-extensions", "Keep extensions when generating module ids", false);
commander.option("-a, --auxilary-comment [comment]", "Comment text to prepend to all auxilary code");
commander.on("--help", function () {
var outKeys = function (title, obj) {
@@ -99,6 +100,7 @@ if (errors.length) {
exports.opts = {
keepModuleIdExtensions: commander.keepModuleIdExtensions,
auxilaryComment: commander.auxilaryComment,
sourceMapName: commander.outFile,
experimental: commander.experimental,
reactCompat: commander.reactCompat,

View File

@@ -21,7 +21,7 @@ exports.addSourceMappingUrl = function (code, loc) {
};
exports.transform = function (filename, code, opts) {
opts = _.extend(opts || {}, index.opts);
opts = _.defaults(opts || {}, index.opts);
opts.filename = filename;
var result;

View File

@@ -30,6 +30,7 @@ exports.ObjectTypeIndexer =
exports.ObjectTypeProperty =
exports.QualifiedTypeIdentifier =
exports.UnionTypeAnnotation =
exports.TypeCastExpression =
exports.VoidTypeAnnotation = function () {
// todo: implement these once we have a `--keep-types` option
};

View File

@@ -82,7 +82,7 @@ Whitespace.prototype.getNewlinesAfter = function (node) {
}
}
if (endToken.type.type === "eof") {
if (endToken && endToken.type.type === "eof") {
return 1;
} else {
var lines = this.getNewlinesBetween(startToken, endToken);
@@ -96,6 +96,8 @@ Whitespace.prototype.getNewlinesAfter = function (node) {
};
Whitespace.prototype.getNewlinesBetween = function (startToken, endToken) {
if (!endToken || !endToken.loc) return 0;
var start = startToken ? startToken.loc.end.line : 1;
var end = endToken.loc.start.line;
var lines = 0;

View File

@@ -15,7 +15,8 @@ exports.messages = {
invalidParentForThisNode: "We don't know how to handle this node within the current parent - please open an issue",
readOnly: "$1 is read-only",
modulesIllegalExportName: "Illegal export $1",
unknownForHead: "Unknown node type $1 in ForStatement"
unknownForHead: "Unknown node type $1 in ForStatement",
didYouMean: "Did you mean $1?"
};
exports.get = function (key) {

View File

@@ -18,9 +18,10 @@ var each = require("lodash/collection/each");
var t = require("../types");
function File(opts) {
this.dynamicImportIds = {};
this.dynamicImported = [];
this.dynamicImports = [];
this.dynamicImportedNoDefault = [];
this.dynamicImportIds = {};
this.dynamicImported = [];
this.dynamicImports = [];
this.dynamicData = {};
this.data = {};
@@ -85,6 +86,7 @@ File.validOptions = [
"experimental",
"resolveModuleSource",
"runtime",
"auxilaryComment",
// these are used by plugins
"ignore",
@@ -105,6 +107,7 @@ File.prototype.normalizeOptions = function (opts) {
defaults(opts, {
keepModuleIdExtensions: false,
resolveModuleSource: null,
auxilaryComment: "",
experimental: false,
reactCompat: false,
playground: false,
@@ -273,7 +276,7 @@ File.prototype.get = function (key) {
}
};
File.prototype.addImport = function (source, name) {
File.prototype.addImport = function (source, name, noDefault) {
name = name || source;
var id = this.dynamicImportIds[name];
@@ -283,7 +286,9 @@ File.prototype.addImport = function (source, name) {
var specifiers = [t.importSpecifier(t.identifier("default"), id)];
var declar = t.importDeclaration(specifiers, t.literal(source));
declar._blockHoist = 3;
this.dynamicImported.push(declar);
if (noDefault) this.dynamicImportedNoDefault.push(declar);
this.moduleFormatter.importSpecifier(specifiers[0], declar, this.dynamicImports);
}
@@ -295,6 +300,18 @@ File.prototype.isConsequenceExpressionStatement = function (node) {
return t.isExpressionStatement(node) && this.lastStatements.indexOf(node) >= 0;
};
File.prototype.attachAuxilaryComment = function (node) {
var comment = this.opts.auxilaryComment;
if (comment) {
node.leadingComments = node.leadingComments || [];
node.leadingComments.push({
type: "Line",
value: " " + comment
});
}
return node;
};
File.prototype.addHelper = function (name) {
if (!includes(File.helpers, name)) {
throw new ReferenceError("Unknown helper " + name);

View File

@@ -4,10 +4,10 @@ module.exports = AMDFormatter;
var DefaultFormatter = require("./_default");
var CommonFormatter = require("./common");
var util = require("../../util");
var t = require("../../types");
var includes = require("lodash/collection/includes");
var values = require("lodash/object/values");
var util = require("../../util");
var t = require("../../types");
function AMDFormatter() {
CommonFormatter.apply(this, arguments);
@@ -81,12 +81,12 @@ AMDFormatter.prototype.importSpecifier = function (specifier, node, nodes) {
var key = t.getSpecifierName(specifier);
var ref = this.getExternalReference(node);
if (includes(this.file.dynamicImported, node)) {
if (includes(this.file.dynamicImportedNoDefault, node)) {
// Prevent unnecessary renaming of dynamic imports.
this.ids[node.source.value] = ref;
} else if (t.isImportBatchSpecifier(specifier)) {
// import * as bar from "foo";
} else if (t.isSpecifierDefault(specifier) && !this.noInteropRequireImport) {
} else if (!includes(this.file.dynamicImported, node) && t.isSpecifierDefault(specifier) && !this.noInteropRequireImport) {
// import foo from "foo";
ref = t.callExpression(this.file.addHelper("interop-require"), [ref]);
} else {

View File

@@ -31,8 +31,8 @@ CommonJSFormatter.prototype.importSpecifier = function (specifier, node, nodes)
// import foo from "foo";
if (t.isSpecifierDefault(specifier)) {
if (!includes(this.file.dynamicImported, node)) {
if (this.noInteropRequireImport) {
if (!includes(this.file.dynamicImportedNoDefault, node)) {
if (this.noInteropRequireImport || includes(this.file.dynamicImported, node)) {
ref = t.memberExpression(ref, t.identifier("default"));
} else {
ref = t.callExpression(this.file.addHelper("interop-require"), [ref]);

View File

@@ -0,0 +1,2 @@
var helpers = exports.default = {};
exports.__esModule = true;

View File

@@ -55,6 +55,8 @@ Transformer.prototype.normalize = function (transformer) {
return;
}
if (type === "enter" || type === "exit") return;
if (isFunction(fns)) fns = { enter: fns };
if (!isObject(fns)) return;

View File

@@ -124,7 +124,7 @@ BlockScoping.prototype.run = function () {
if (!this.hasLetReferences) return;
if (needsClosure) {
this.needsClosure();
this.wrapClosure();
} else {
this.remap();
}
@@ -205,9 +205,28 @@ BlockScoping.prototype.remap = function () {
* Description
*/
BlockScoping.prototype.needsClosure = function () {
BlockScoping.prototype.wrapClosure = function () {
var block = this.block;
var outsideRefs = this.outsideLetReferences;
// remap loop heads with colliding variables
if (this.loopParent) {
for (var name in outsideRefs) {
var id = outsideRefs[name];
if (this.scope.hasGlobal(id.name)) {
delete outsideRefs[id.name];
delete this.letReferences[id.name];
this.scope.rename(id.name);
this.letReferences[id.name] = id;
outsideRefs[id.name] = id;
}
}
}
// if we're inside of a for loop then we search to see if there are any
// `break`s, `continue`s, `return`s etc
this.has = this.checkLoop();
@@ -216,7 +235,7 @@ BlockScoping.prototype.needsClosure = function () {
this.hoistVarDeclarations();
// turn outsideLetReferences into an array
var params = values(this.outsideLetReferences);
var params = values(outsideRefs);
// build the closure that we're going to wrap the block with
var fn = t.functionExpression(null, params, t.blockStatement(block.body));

View File

@@ -10,8 +10,6 @@ exports.check = function (node) {
var visitor = {
enter: function (node, parent, scope, state) {
if (t.isAssignmentExpression(node) || t.isUpdateExpression(node)) {
if (t.isMemberExpression(node.left || node.argument)) return;
var ids = t.getBindingIdentifiers(node);
for (var name in ids) {

View File

@@ -294,7 +294,15 @@ TailCallTransformer.prototype.subTransformCallExpression = function (node) {
// looks for and replaces tail recursion calls
var firstPass = {
enter: function (node, parent, scope, state) {
if (t.isReturnStatement(node)) {
if (t.isIfStatement(node)) {
if (t.isReturnStatement(node.alternate)) {
t.ensureBlock(node, "alternate");
}
if (t.isReturnStatement(node.consequent)) {
t.ensureBlock(node, "consequent");
}
} else if (t.isReturnStatement(node)) {
this.skip();
return state.subTransform(node.argument);
} else if (t.isTryStatement(parent)) {

View File

@@ -4,6 +4,7 @@ module.exports = {
"validation.undeclaredVariableCheck": require("./validation/undeclared-variable-check"),
"validation.noForInOfAssignment": require("./validation/no-for-in-of-assignment"),
"validation.setters": require("./validation/setters"),
"validation.react": require("./validation/react"),
"spec.blockScopedFunctions": require("./spec/block-scoped-functions"),
"playground.malletOperator": require("./playground/mallet-operator"),
@@ -12,6 +13,7 @@ module.exports = {
"playground.objectGetterMemoization": require("./playground/object-getter-memoization"),
reactCompat: require("./other/react-compat"),
flow: require("./other/flow"),
react: require("./other/react"),
_modules: require("./internal/modules"),
@@ -86,11 +88,12 @@ module.exports = {
_declarations: require("./internal/declarations"),
_aliasFunctions: require("./internal/alias-functions"),
_moduleFormatter: require("./internal/module-formatter"),
"spec.typeofSymbol": require("./spec/typeof-symbol"),
"spec.undefinedToVoid": require("./spec/undefined-to-void"),
_moduleFormatter: require("./internal/module-formatter"),
"es3.propertyLiterals": require("./es3/property-literals"),
"es3.memberExpressionLiterals": require("./es3/member-expression-literals"),

View File

@@ -6,7 +6,7 @@ var t = require("../../../types");
exports.secondPass = true;
exports.BlockStatement =
exports.Program = function (node) {
exports.Program = function (node, parent, scope, file) {
if (!node._declarations) return;
var kinds = {};
@@ -19,16 +19,16 @@ exports.Program = function (node) {
kind = declar.kind || "var";
var declarNode = t.variableDeclarator(declar.id, declar.init);
if (!declar.init) {
if (declar.init) {
node.body.unshift(file.attachAuxilaryComment(t.variableDeclaration(kind, [declarNode])));
} else {
kinds[kind] = kinds[kind] || [];
kinds[kind].push(declarNode);
} else {
node.body.unshift(t.variableDeclaration(kind, [declarNode]));
}
}
for (kind in kinds) {
node.body.unshift(t.variableDeclaration(kind, kinds[kind]));
node.body.unshift(file.attachAuxilaryComment(t.variableDeclaration(kind, kinds[kind])));
}
});

View File

@@ -2,11 +2,9 @@
var useStrict = require("../../helpers/use-strict");
exports.post = function (file) {
exports.Program = function (program, parent, scope, file) {
if (!file.transformers["es6.modules"].canRun()) return;
var program = file.ast.program;
useStrict.wrap(program, function () {
program.body = file.dynamicImports.concat(program.body);
});

View File

@@ -15,7 +15,7 @@ exports.Function = function (node, parent, scope, file) {
return remapAsyncToGenerator(
node,
t.memberExpression(file.addImport("bluebird"), t.identifier("coroutine")),
t.memberExpression(file.addImport("bluebird", null, true), t.identifier("coroutine")),
scope
);
};

View File

@@ -0,0 +1,13 @@
var t = require("../../../types");
exports.TypeCastExpression = function (node) {
return node.expression;
};
exports.ImportDeclaration = function (node) {
if (node.isType) this.remove();
};
exports.ExportDeclaration = function (node) {
if (t.isTypeAlias(node.declaration)) this.remove();
};

View File

@@ -1,10 +1,12 @@
"use strict";
var includes = require("lodash/collection/includes");
var util = require("../../../util");
var core = require("core-js/library");
var t = require("../../../types");
var has = require("lodash/object/has");
var includes = require("lodash/collection/includes");
var t = require("../../../types");
var isSymboliterator = t.buildMatchMemberExpression("Symbol.iterator");
var coreHas = function (node) {
return node.name !== "_" && has(core, node.name);
@@ -47,8 +49,7 @@ var astVisitor = {
if (!callee.computed) return false;
prop = callee.property;
if (!t.isIdentifier(prop.object, { name: "Symbol" })) return false;
if (!t.isIdentifier(prop.property, { name: "iterator" })) return false;
if (!isSymboliterator(prop)) return false;
return util.template("corejs-iterator", {
CORE_ID: file.get("coreIdentifier"),
@@ -60,9 +61,7 @@ var astVisitor = {
if (node.operator !== "in") return;
var left = node.left;
if (!t.isMemberExpression(left)) return;
if (!t.isIdentifier(left.object, { name: "Symbol" })) return;
if (!t.isIdentifier(left.property, { name: "iterator" })) return;
if (!isSymboliterator(left)) return;
return util.template("corejs-is-iterator", {
CORE_ID: file.get("coreIdentifier"),
@@ -78,8 +77,8 @@ exports.manipulateOptions = function (opts) {
if (opts.whitelist.length) opts.whitelist.push("es6.modules");
};
exports.post = function (file) {
file.scope.traverse(file.ast, astVisitor, file);
exports.Program = function (node, parent, scope, file) {
scope.traverse(node, astVisitor, file);
};
exports.pre = function (file) {

View File

@@ -3,8 +3,7 @@
var useStrict = require("../../helpers/use-strict");
var t = require("../../../types");
exports.post = function (file) {
var program = file.ast.program;
exports.Program = function (program) {
if (!useStrict.has(program)) {
program.body.unshift(t.expressionStatement(t.literal("use strict")));
}

View File

@@ -0,0 +1,25 @@
var messages = require("../../../messages");
var t = require("../../../types");
// check if the input Literal `source` is an alternate casing of "react"
var check = function (source, file) {
if (t.isLiteral(source)) {
var name = source.value;
var lower = name.toLowerCase();
if (lower === "react" && name !== lower) {
throw file.errorWithNode(source, messages.get("didYouMean", "react"));
}
}
};
exports.CallExpression = function (node, parent, scope, file) {
if (t.isIdentifier(node.callee, { name: "require" }) && node.arguments.length === 1) {
check(node.arguments[0], file);
}
};
exports.ImportDeclaration =
exports.ExportDeclaration = function (node, parent, scope, file) {
check(node.source, file);
};

View File

@@ -109,7 +109,7 @@ TraversalPath.prototype.call = function (key) {
if (!node) return;
var opts = this.opts;
var fn = opts[key];
var fn = opts[key] || opts;
if (opts[node.type]) fn = opts[node.type][key] || fn;
var replacement = fn.call(this, node, this.parent, this.scope, this.state);

View File

@@ -33,7 +33,7 @@ function Scope(block, parentBlock, parent, file) {
this.crawl();
}
Scope.defaultDeclarations = flatten([globals.builtin, globals.browser, globals.node].map(Object.keys));
Scope.globals = flatten([globals.builtin, globals.browser, globals.node].map(Object.keys));
/**
* Description
@@ -637,7 +637,7 @@ Scope.prototype.hasBinding = function (name) {
if (!name) return false;
if (this.hasOwnBinding(name)) return true;
if (this.parentHasBinding(name)) return true;
if (includes(Scope.defaultDeclarations, name)) return true;
if (includes(Scope.globals, name)) return true;
return false;
};

View File

@@ -614,7 +614,6 @@ t.getBindingIdentifiers.keys = {
VariableDeclarator: ["id"],
FunctionDeclaration: ["id"],
ClassDeclaration: ["id"],
MemberExpression: ["object"],
SpreadElement: ["argument"],
RestElement: ["argument"],
UpdateExpression: ["argument"],

View File

@@ -92,6 +92,7 @@
"TypeofTypeAnnotation": [],
"TypeAlias": [],
"TypeAnnotation": [],
"TypeCastExpression": ["expression"],
"TypeParameterDeclaration": [],
"TypeParameterInstantiation": [],
"ObjectTypeAnnotation": [],

View File

@@ -109,6 +109,8 @@ exports.template = function (name, nodes, keepExpression) {
traverse(template, templateVisitor, null, nodes);
}
if (template.body.length > 1) return template.body;
var node = template.body[0];
if (!keepExpression && t.isExpressionStatement(node)) {

View File

@@ -1,7 +1,7 @@
{
"name": "6to5",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "3.6.2",
"version": "3.6.5",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://6to5.org/",
"repository": "6to5/6to5",
@@ -33,12 +33,12 @@
"test": "make test"
},
"dependencies": {
"acorn-6to5": "0.11.1-30",
"acorn-6to5": "0.11.1-31",
"ast-types": "~0.6.1",
"chalk": "^0.5.1",
"chokidar": "0.12.6",
"commander": "2.6.0",
"core-js": "^0.5.2",
"core-js": "^0.5.3",
"debug": "^2.1.1",
"detect-indent": "3.0.0",
"estraverse": "1.9.1",

View File

@@ -1,7 +1,7 @@
{
"name": "6to5-runtime",
"description": "6to5 selfContained runtime",
"version": "3.6.1",
"version": "3.6.4",
"repository": "6to5/6to5",
"author": "Sebastian McKenzie <sebmck@gmail.com>"
}

View File

@@ -2,6 +2,7 @@
var buildHelpers = require("../lib/6to5/build-helpers");
var transform = require("../lib/6to5/transformation");
var util = require("../lib/6to5/util");
var fs = require("fs");
var t = require("../lib/6to5/types");
var _ = require("lodash");
@@ -16,8 +17,14 @@ var writeFile = function (filename, content) {
fs.writeFileSync(filename, content);
};
var readFile = function (filename) {
return fs.readFileSync(require.resolve(filename), "utf8");
var readFile = function (filename, defaultify) {
var file = fs.readFileSync(require.resolve(filename), "utf8");
if (defaultify) {
file += '\nmodule.exports = { "default": module.exports, __esModule: true };\n';
}
return file;
};
var updatePackage = function () {
@@ -37,10 +44,10 @@ var selfContainify = function (code) {
};
var buildHelpers2 = function () {
var body = [];
var body = util.template("self-contained-helpers-head");
var tree = t.program(body);
buildHelpers(body, t.identifier("exports"));
buildHelpers(body, t.identifier("helpers"));
return transform.fromAst(tree, null, {
optional: ["selfContained"]
@@ -48,7 +55,7 @@ var buildHelpers2 = function () {
};
writeFile("helpers.js", buildHelpers2());
writeFile("core-js.js", readFile("core-js/library"));
writeFile("regenerator/index.js", readFile("regenerator-6to5/runtime-module"));
writeFile("core-js.js", readFile("core-js/library", true));
writeFile("regenerator/index.js", readFile("regenerator-6to5/runtime-module", true));
writeFile("regenerator/runtime.js", selfContainify(readFile("regenerator-6to5/runtime")));
updatePackage();

View File

@@ -5,4 +5,4 @@ var _classCallCheck = function (instance, Constructor) { if (!(instance instance
var Test = function Test() {
_classCallCheck(this, Test);
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9iYXIvYmFyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7SUFBTSxJQUFJLFlBQUosSUFBSTt3QkFBSixJQUFJIiwiZmlsZSI6InNyYy9iYXIvYmFyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgVGVzdCB7XG5cbn0iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9iYXIvYmFyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7SUFBTSxJQUFJLFlBQUosSUFBSTt3QkFBSixJQUFJIiwiZmlsZSI6InNyYy9iYXIvYmFyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgVGVzdCB7XG5cbn0iXX0=

View File

@@ -3,4 +3,4 @@
arr.map(function (x) {
return x * MULTIPLIER;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9mb28uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxHQUFHLENBQUMsR0FBRyxDQUFDLFVBQUEsQ0FBQztTQUFJLENBQUMsR0FBRyxVQUFVO0NBQUEsQ0FBQyxDQUFDIiwiZmlsZSI6InNyYy9mb28uanMiLCJzb3VyY2VzQ29udGVudCI6WyJhcnIubWFwKHggPT4geCAqIE1VTFRJUExJRVIpOyJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mb28uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxHQUFHLENBQUMsR0FBRyxDQUFDLFVBQUEsQ0FBQztTQUFJLENBQUMsR0FBRyxVQUFVO0NBQUEsQ0FBQyxDQUFDIiwiZmlsZSI6InNyYy9mb28uanMiLCJzb3VyY2VzQ29udGVudCI6WyJhcnIubWFwKHggPT4geCAqIE1VTFRJUExJRVIpOyJdfQ==

View File

@@ -1 +1 @@
{"version":3,"sources":["src/bar/bar.js"],"names":[],"mappings":";;;;IAAM,IAAI,YAAJ,IAAI;wBAAJ,IAAI","file":"src/bar/bar.js","sourcesContent":["class Test {\n\n}"]}
{"version":3,"sources":["../../src/bar/bar.js"],"names":[],"mappings":";;;;IAAM,IAAI,YAAJ,IAAI;wBAAJ,IAAI","file":"src/bar/bar.js","sourcesContent":["class Test {\n\n}"]}

View File

@@ -1 +1 @@
{"version":3,"sources":["src/foo.js"],"names":[],"mappings":";;AAAA,GAAG,CAAC,GAAG,CAAC,UAAA,CAAC;SAAI,CAAC,GAAG,UAAU;CAAA,CAAC,CAAC","file":"src/foo.js","sourcesContent":["arr.map(x => x * MULTIPLIER);"]}
{"version":3,"sources":["../src/foo.js"],"names":[],"mappings":";;AAAA,GAAG,CAAC,GAAG,CAAC,UAAA,CAAC;SAAI,CAAC,GAAG,UAAU;CAAA,CAAC,CAAC","file":"src/foo.js","sourcesContent":["arr.map(x => x * MULTIPLIER);"]}

View File

@@ -0,0 +1,9 @@
for (let i = 1; i < 3; i += 1) {
(function () {
i;
})();
}
assert.throws(function () {
i;
}, ReferenceError);

View File

@@ -0,0 +1,4 @@
function f() {
if (true) {}
else return f()
}

View File

@@ -0,0 +1,9 @@
"use strict";
function f() {
_function: while (true) {
if (true) {} else {
continue _function;
}
}
}

View File

@@ -1,7 +1,6 @@
"use strict";
var _core = require("6to5-runtime/core-js");
var _core = require("6to5-runtime/core-js")["default"];
obj.constructor === Object;
obj.constructor === _core.Promise;

View File

@@ -1,7 +1,6 @@
"use strict";
var _core = require("6to5-runtime/core-js");
var _core = require("6to5-runtime/core-js")["default"];
for (var _iterator = _core.$for.getIterator(arr), _step; !(_step = _iterator.next()).done;) {
var i = _step.value;
}

View File

@@ -1,7 +1,6 @@
"use strict";
var _core = require("6to5-runtime/core-js");
var _core = require("6to5-runtime/core-js")["default"];
var arr = (function () {
var _arr = [];

View File

@@ -1,11 +1,8 @@
"use strict";
var _regeneratorRuntime = require("6to5-runtime/regenerator");
var _to5Helpers = require("6to5-runtime/helpers");
var _core = require("6to5-runtime/core-js");
var _core = require("6to5-runtime/core-js")["default"];
var _regeneratorRuntime = require("6to5-runtime/regenerator")["default"];
var _to5Helpers = require("6to5-runtime/helpers")["default"];
var giveWord = _regeneratorRuntime.mark(function giveWord() {
return _regeneratorRuntime.wrap(function giveWord$(context$1$0) {
while (1) switch (context$1$0.prev = context$1$0.next) {

View File

@@ -1,6 +1,6 @@
define(["exports", "foo", "6to5-runtime/helpers"], function (exports, _foo, _to5RuntimeHelpers) {
"use strict";
var _to5Helpers = _to5RuntimeHelpers;
var _to5Helpers = _to5RuntimeHelpers["default"];
var foo = _to5Helpers.interopRequire(_foo);
});
});

View File

@@ -1,5 +1,4 @@
"use strict";
var _to5Helpers = require("6to5-runtime/helpers");
var foo = _to5Helpers.interopRequire(require("foo"));
var _to5Helpers = require("6to5-runtime/helpers")["default"];
var foo = _to5Helpers.interopRequire(require("foo"));

View File

@@ -4,10 +4,10 @@ System.register(["6to5-runtime/helpers"], function (_export) {
var _to5Helpers;
return {
setters: [function (_to5RuntimeHelpers) {
_to5Helpers = _to5RuntimeHelpers;
_to5Helpers = _to5RuntimeHelpers["default"];
}],
execute: function () {
foo.apply(undefined, _to5Helpers.toConsumableArray(bar));
}
};
});
});

View File

@@ -7,6 +7,6 @@
})(function (exports, _foo, _to5RuntimeHelpers) {
"use strict";
var _to5Helpers = _to5RuntimeHelpers;
var _to5Helpers = _to5RuntimeHelpers["default"];
var foo = _to5Helpers.interopRequire(_foo);
});
});

View File

@@ -1,7 +1,6 @@
"use strict";
var _regeneratorRuntime = require("6to5-runtime/regenerator");
var _regeneratorRuntime = require("6to5-runtime/regenerator")["default"];
void _regeneratorRuntime.mark(function callee$0$0() {
return _regeneratorRuntime.wrap(function callee$0$0$(context$1$0) {
while (1) switch (context$1$0.prev = context$1$0.next) {

View File

@@ -1,5 +1,4 @@
"use strict";
var _core = require("6to5-runtime/core-js");
var _core = require("6to5-runtime/core-js")["default"];
_core.$for.isIterable(Object(arr));