Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdcf64265e | ||
|
|
ffdfb491eb | ||
|
|
eedd431f2b | ||
|
|
db9ed0235f | ||
|
|
6c98d39937 | ||
|
|
20651df3ce | ||
|
|
f3155919fe | ||
|
|
0ac8330899 | ||
|
|
67201e9698 | ||
|
|
c715d96e46 | ||
|
|
b7a08100a6 | ||
|
|
5f91ee8a1a | ||
|
|
bc1abb5103 | ||
|
|
4b9207e5df | ||
|
|
e847f3685f | ||
|
|
d64c2c0c45 | ||
|
|
76d0fb4ba6 | ||
|
|
0f33b7bfbc | ||
|
|
630224e504 | ||
|
|
62980ab6b4 | ||
|
|
d34480b42b | ||
|
|
306de2edbf | ||
|
|
c33e84730d | ||
|
|
20f28aba64 | ||
|
|
9c312607d1 | ||
|
|
33659711c3 | ||
|
|
b154af48a7 | ||
|
|
bad877946f | ||
|
|
23038dcfff | ||
|
|
7c7a7ee17f |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -13,6 +13,19 @@ _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.6
|
||||
|
||||
* **Bug Fix**
|
||||
* Fix mangling of import references that collide with properties on `Object.prototype`.
|
||||
* Fix duplicate declarations incorrectly being reported for `var`.
|
||||
|
||||
## 5.0.5
|
||||
|
||||
* **Internal**
|
||||
* Upgrade `core-js`.
|
||||
* **Bug Fix**
|
||||
* Fix arrays not being supported in `util.list`.
|
||||
|
||||
## 5.0.4
|
||||
|
||||
* **Polish**
|
||||
|
||||
2
Makefile
2
Makefile
@@ -111,7 +111,7 @@ publish-cli:
|
||||
bootstrap:
|
||||
npm install
|
||||
npm link
|
||||
cd packages/babel-cli && npm install && npm link
|
||||
cd packages/babel-cli && npm install && npm link && npm link babel-core
|
||||
git submodule update --init
|
||||
cd vendor/regenerator && npm install
|
||||
cd vendor/compat-table && npm install object-assign
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
For questions and support please visit the <a href="https://gitter.im/babel/babel">gitter room</a> or <a href="stackoverflow.com">StackOverflow</a>. The Babel issue tracker is <strong>exclusively</strong> for bug reports and future requests.
|
||||
For questions and support please visit the <a href="https://gitter.im/babel/babel">gitter room</a> or <a href="http://stackoverflow.com/questions/tagged/babeljs">StackOverflow</a>. The Babel issue tracker is <strong>exclusively</strong> for bug reports and future requests.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "babel-core",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "5.0.4",
|
||||
"version": "5.0.7",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"repository": "babel/babel",
|
||||
@@ -30,7 +30,7 @@
|
||||
"ast-types": "~0.7.0",
|
||||
"chalk": "^1.0.0",
|
||||
"convert-source-map": "^0.5.0",
|
||||
"core-js": "^0.8.0",
|
||||
"core-js": "^0.8.1",
|
||||
"debug": "^2.1.1",
|
||||
"detect-indent": "^3.0.0",
|
||||
"estraverse": "^1.9.1",
|
||||
|
||||
5
packages/babel-cli/README.md
Normal file
5
packages/babel-cli/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# babel-cli
|
||||
|
||||
Babel CLI
|
||||
|
||||
For more information please look at [babel](https://github.com/babel/babel).
|
||||
@@ -28,6 +28,8 @@ module.exports = function (commander, filenames, opts) {
|
||||
};
|
||||
|
||||
var handleFile = function (src, filename) {
|
||||
if (util.shouldIgnore(src)) return;
|
||||
|
||||
if (util.canCompile(filename)) {
|
||||
write(src, filename);
|
||||
} else if (commander.copyFiles) {
|
||||
|
||||
@@ -107,6 +107,8 @@ module.exports = function (commander, filenames, opts) {
|
||||
});
|
||||
|
||||
_.each(_filenames, function (filename) {
|
||||
if (util.shouldIgnore(filename)) return;
|
||||
|
||||
results.push(util.compile(filename));
|
||||
});
|
||||
|
||||
|
||||
@@ -102,12 +102,15 @@ if (errors.length) {
|
||||
|
||||
//
|
||||
|
||||
exports.opts = {};
|
||||
var opts = exports.opts = {};
|
||||
|
||||
each(options, function (opt, key) {
|
||||
exports.opts[key] = commander[key];
|
||||
opts[key] = commander[key];
|
||||
});
|
||||
|
||||
opts.ignore = util.arrayify(opts.ignore, util.regexify);
|
||||
opts.only = util.arrayify(opts.only, util.regexify);
|
||||
|
||||
var fn;
|
||||
|
||||
if (commander.outDir) {
|
||||
|
||||
@@ -16,6 +16,10 @@ exports.readdir = readdir;
|
||||
|
||||
exports.canCompile = util.canCompile;
|
||||
|
||||
exports.shouldIgnore = function (loc) {
|
||||
return util.shouldIgnore(loc, index.opts.ignore, index.opts.only);
|
||||
};
|
||||
|
||||
exports.addSourceMappingUrl = function (code, loc) {
|
||||
return code + "\n//# sourceMappingURL=" + path.basename(loc);
|
||||
};
|
||||
@@ -23,6 +27,8 @@ exports.addSourceMappingUrl = function (code, loc) {
|
||||
exports.transform = function (filename, code, opts) {
|
||||
opts = _.defaults(opts || {}, index.opts);
|
||||
opts.filename = filename;
|
||||
opts.ignore = null;
|
||||
opts.only = null;
|
||||
|
||||
var result = babel.transform(code, opts);
|
||||
result.filename = filename;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "babel",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "5.0.3",
|
||||
"version": "5.0.6",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"repository": "babel/babel",
|
||||
"preferGlobal": true,
|
||||
"dependencies": {
|
||||
"chokidar": "^0.12.6",
|
||||
"babel-core": "^5.0.3",
|
||||
"babel-core": "^5.0.6",
|
||||
"commander": "^2.6.0",
|
||||
"fs-readdir-recursive": "^0.1.0",
|
||||
"output-file-sync": "^1.1.0",
|
||||
@@ -22,4 +22,4 @@
|
||||
"babel-node": "./bin/babel-node",
|
||||
"babel-external-helpers": "./bin/babel-external-helpers"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "babel-runtime",
|
||||
"description": "babel selfContained runtime",
|
||||
"version": "5.0.3",
|
||||
"version": "5.0.6",
|
||||
"repository": "babel/babel",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"dependencies": {
|
||||
|
||||
@@ -3,7 +3,7 @@ import os from "os";
|
||||
import fs from "fs";
|
||||
|
||||
function getUserHome() {
|
||||
return process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
|
||||
return process.env.HOME || process.env.USERPROFILE;
|
||||
}
|
||||
|
||||
const FILENAME = process.env.BABEL_CACHE_PATH || path.join(getUserHome() || os.tmpdir(), ".babel.json");
|
||||
|
||||
@@ -422,23 +422,7 @@ export default class File {
|
||||
|
||||
shouldIgnore() {
|
||||
var opts = this.opts;
|
||||
|
||||
var filename = opts.filename;
|
||||
var ignore = opts.ignore;
|
||||
var only = opts.only;
|
||||
|
||||
if (only.length) {
|
||||
for (var i = 0; i < only.length; i++) {
|
||||
if (only[i].test(filename)) return false;
|
||||
}
|
||||
return true;
|
||||
} else if (ignore.length) {
|
||||
for (var i = 0; i < ignore.length; i++) {
|
||||
if (ignore[i].test(filename)) return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return util.shouldIgnore(opts.filename, opts.ignore, opts.only);
|
||||
}
|
||||
|
||||
parse(code: string) {
|
||||
|
||||
@@ -61,7 +61,6 @@ var importsVisitor = {
|
||||
enter(node, parent, scope, formatter) {
|
||||
formatter.hasLocalImports = true;
|
||||
extend(formatter.localImports, this.getBindingIdentifiers());
|
||||
formatter.bumpImportOccurences(node);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -69,7 +68,7 @@ var importsVisitor = {
|
||||
var exportsVisitor = traverse.explode({
|
||||
ExportDeclaration: {
|
||||
enter(node, parent, scope, formatter) {
|
||||
formatter.hasLocalImports = true;
|
||||
formatter.hasLocalExports = true;
|
||||
|
||||
var declar = this.get("declaration");
|
||||
if (declar.isStatement()) {
|
||||
@@ -96,29 +95,23 @@ var exportsVisitor = traverse.explode({
|
||||
formatter.hasNonDefaultExports = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (node.source) {
|
||||
formatter.bumpImportOccurences(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export default class DefaultFormatter {
|
||||
constructor(file) {
|
||||
this.internalRemap = {};
|
||||
|
||||
this.defaultIds = object();
|
||||
this.scope = file.scope;
|
||||
this.file = file;
|
||||
this.ids = object();
|
||||
this.internalRemap = object();
|
||||
this.defaultIds = object();
|
||||
this.scope = file.scope;
|
||||
this.file = file;
|
||||
this.ids = object();
|
||||
|
||||
this.hasNonDefaultExports = false;
|
||||
|
||||
this.hasLocalExports = false;
|
||||
this.hasLocalImports = false;
|
||||
|
||||
this.localImportOccurences = object();
|
||||
this.localExports = object();
|
||||
this.localImports = object();
|
||||
|
||||
@@ -134,15 +127,6 @@ export default class DefaultFormatter {
|
||||
return (t.isExportDefaultDeclaration(node) || t.isSpecifierDefault(node)) && !this.noInteropRequireExport && !this.hasNonDefaultExports;
|
||||
}
|
||||
|
||||
bumpImportOccurences(node) {
|
||||
var source = node.source.value;
|
||||
var occurs = this.localImportOccurences;
|
||||
occurs[source] ||= 0;
|
||||
if (node.specifiers) {
|
||||
occurs[source] += node.specifiers.length;
|
||||
}
|
||||
}
|
||||
|
||||
getLocalExports() {
|
||||
this.file.path.traverse(exportsVisitor, this);
|
||||
}
|
||||
@@ -152,7 +136,7 @@ export default class DefaultFormatter {
|
||||
}
|
||||
|
||||
remapAssignments() {
|
||||
if (this.hasLocalImports) {
|
||||
if (this.hasLocalExports || this.hasLocalImports) {
|
||||
this.file.path.traverse(remapVisitor, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ import * as util from "../../util";
|
||||
import * as t from "../../types";
|
||||
|
||||
export default class AMDFormatter extends DefaultFormatter {
|
||||
init = CommonFormatter.prototype.init;
|
||||
init() {
|
||||
CommonFormatter.prototype._init.call(this, this.hasNonDefaultExports);
|
||||
}
|
||||
|
||||
buildDependencyLiterals() {
|
||||
var names = [];
|
||||
@@ -100,15 +102,34 @@ export default class AMDFormatter extends DefaultFormatter {
|
||||
this.internalRemap[specifier.local.name] = ref;
|
||||
}
|
||||
|
||||
exportSpecifier() {
|
||||
CommonFormatter.prototype.exportSpecifier.apply(this, arguments);
|
||||
exportSpecifier(specifier, node, nodes) {
|
||||
if (this.doDefaultExportInterop(specifier)) {
|
||||
nodes.push(util.template("exports-default-assign", {
|
||||
VALUE: specifier.local
|
||||
}, true));
|
||||
} else {
|
||||
CommonFormatter.prototype.exportSpecifier.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
exportDeclaration(node) {
|
||||
exportDeclaration(node, nodes) {
|
||||
if (this.doDefaultExportInterop(node)) {
|
||||
this.passModuleArg = true;
|
||||
|
||||
var declar = node.declaration;
|
||||
var assign = util.template("exports-default-assign", {
|
||||
VALUE: this._pushStatement(declar, nodes)
|
||||
}, true);
|
||||
|
||||
if (t.isFunctionDeclaration(declar)) {
|
||||
// we can hoist this assignment to the top of the file
|
||||
assign._blockHoist = 3;
|
||||
}
|
||||
|
||||
nodes.push(assign);
|
||||
return;
|
||||
}
|
||||
|
||||
CommonFormatter.prototype.exportDeclaration.apply(this, arguments);
|
||||
DefaultFormatter.prototype.exportDeclaration.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,17 @@ import * as t from "../../types";
|
||||
|
||||
export default class CommonJSFormatter extends DefaultFormatter {
|
||||
init() {
|
||||
this._init(this.hasLocalExports);
|
||||
}
|
||||
|
||||
_init(conditional) {
|
||||
var file = this.file;
|
||||
var scope = file.scope;
|
||||
|
||||
scope.rename("module");
|
||||
scope.rename("exports");
|
||||
|
||||
if (!this.noInteropRequireImport && this.hasNonDefaultExports) {
|
||||
if (!this.noInteropRequireImport && conditional) {
|
||||
var templateName = "exports-module-declaration";
|
||||
if (this.file.isLoose("es6.modules")) templateName += "-loose";
|
||||
var declar = util.template(templateName, true);
|
||||
@@ -20,6 +24,20 @@ export default class CommonJSFormatter extends DefaultFormatter {
|
||||
}
|
||||
}
|
||||
|
||||
transform(program) {
|
||||
DefaultFormatter.prototype.transform.apply(this, arguments);
|
||||
|
||||
if (this.hasDefaultOnlyExport) {
|
||||
program.body.push(
|
||||
t.expressionStatement(t.assignmentExpression(
|
||||
"=",
|
||||
t.memberExpression(t.identifier("module"), t.identifier("exports")),
|
||||
t.memberExpression(t.identifier("exports"), t.identifier("default"))
|
||||
))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
importSpecifier(specifier, node, nodes) {
|
||||
var variableName = specifier.local;
|
||||
|
||||
@@ -31,11 +49,15 @@ export default class CommonJSFormatter extends DefaultFormatter {
|
||||
this.internalRemap[variableName.name] = ref;
|
||||
} else {
|
||||
if (this.noInteropRequireImport) {
|
||||
this.internalRemap[variableName.name] = t.memberExpression(ref, t.identifier("default"))
|
||||
this.internalRemap[variableName.name] = t.memberExpression(ref, t.identifier("default"));
|
||||
} else if (!includes(this.file.dynamicImported, node)) {
|
||||
var uid = this.scope.generateUidBasedOnNode(node, "import");
|
||||
|
||||
nodes.push(t.variableDeclaration("var", [
|
||||
t.variableDeclarator(variableName, t.callExpression(this.file.addHelper("interop-require"), [ref]))
|
||||
t.variableDeclarator(uid, t.callExpression(this.file.addHelper("interop-require-wildcard"), [ref]))
|
||||
]));
|
||||
|
||||
this.internalRemap[variableName.name] = t.memberExpression(uid, t.identifier("default"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -64,29 +86,15 @@ export default class CommonJSFormatter extends DefaultFormatter {
|
||||
|
||||
exportSpecifier(specifier, node, nodes) {
|
||||
if (this.doDefaultExportInterop(specifier)) {
|
||||
nodes.push(util.template("exports-default-assign", {
|
||||
VALUE: specifier.local
|
||||
}, true));
|
||||
return;
|
||||
} else {
|
||||
DefaultFormatter.prototype.exportSpecifier.apply(this, arguments);
|
||||
this.hasDefaultOnlyExport = true;
|
||||
}
|
||||
|
||||
DefaultFormatter.prototype.exportSpecifier.apply(this, arguments);
|
||||
}
|
||||
|
||||
exportDeclaration(node, nodes) {
|
||||
if (this.doDefaultExportInterop(node)) {
|
||||
var declar = node.declaration;
|
||||
var assign = util.template("exports-default-assign", {
|
||||
VALUE: this._pushStatement(declar, nodes)
|
||||
}, true);
|
||||
|
||||
if (t.isFunctionDeclaration(declar)) {
|
||||
// we can hoist this assignment to the top of the file
|
||||
assign._blockHoist = 3;
|
||||
}
|
||||
|
||||
nodes.push(assign);
|
||||
return;
|
||||
this.hasDefaultOnlyExport = true;
|
||||
}
|
||||
|
||||
DefaultFormatter.prototype.exportDeclaration.apply(this, arguments);
|
||||
|
||||
@@ -547,6 +547,9 @@ export default class TraversalPath {
|
||||
var binding = this.scope.getBinding(this.node.name);
|
||||
if (!binding || !binding.constant) return;
|
||||
|
||||
// todo: take into consideration infinite recursion #1149
|
||||
return;
|
||||
|
||||
if (binding.path === this) {
|
||||
return this;
|
||||
} else {
|
||||
|
||||
@@ -240,7 +240,12 @@ export default class Scope {
|
||||
if (kind === "param") return;
|
||||
if (kind === "hoisted" && local.kind === "let") return;
|
||||
|
||||
if (local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param") {
|
||||
|
||||
var duplicate = false;
|
||||
duplicate ||= local.kind === "let" || local.kind === "const" || local.kind === "module";
|
||||
duplicate ||= local.kind === "param" && (kind === "let" || kind === "const");
|
||||
|
||||
if (duplicate) {
|
||||
throw this.file.errorWithNode(id, messages.get("scopeDuplicateDeclaration", name), TypeError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,15 @@ export function resolveRelative(loc: string) {
|
||||
}
|
||||
|
||||
export function list(val: string): Array<string> {
|
||||
return val ? val.split(",") : [];
|
||||
if (!val) {
|
||||
return [];
|
||||
} else if (Array.isArray(val)) {
|
||||
return val;
|
||||
} else if (typeof val === "string") {
|
||||
return val.split(",");
|
||||
} else {
|
||||
return [val];
|
||||
}
|
||||
}
|
||||
|
||||
export function regexify(val: any): RegExp {
|
||||
@@ -85,6 +93,21 @@ export function booleanify(val: any): boolean {
|
||||
return val;
|
||||
}
|
||||
|
||||
export function shouldIgnore(filename, ignore, only) {
|
||||
if (only.length) {
|
||||
for (var i = 0; i < only.length; i++) {
|
||||
if (only[i].test(filename)) return false;
|
||||
}
|
||||
return true;
|
||||
} else if (ignore.length) {
|
||||
for (var i = 0; i < ignore.length; i++) {
|
||||
if (ignore[i].test(filename)) return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
var templateVisitor = {
|
||||
enter(node, parent, scope, nodes) {
|
||||
if (t.isExpressionStatement(node)) {
|
||||
|
||||
@@ -70,6 +70,7 @@ var buildTest = function (binName, testName, opts) {
|
||||
|
||||
return function (callback) {
|
||||
this.timeout(5000);
|
||||
clear();
|
||||
saveInFiles(opts.inFiles);
|
||||
|
||||
var args = [binLoc].concat(opts.args);
|
||||
@@ -109,11 +110,11 @@ var buildTest = function (binName, testName, opts) {
|
||||
};
|
||||
};
|
||||
|
||||
before(function () {
|
||||
var clear = function () {
|
||||
if (fs.existsSync(tmpLoc)) rimraf.sync(tmpLoc);
|
||||
fs.mkdirSync(tmpLoc);
|
||||
process.chdir(tmpLoc);
|
||||
});
|
||||
};
|
||||
|
||||
_.each(fs.readdirSync(fixtureLoc), function (binName) {
|
||||
if (binName[0] === ".") return;
|
||||
|
||||
@@ -12,10 +12,7 @@ suite("browserify", function() {
|
||||
assert.ok(bundle.length, "bundle output code");
|
||||
|
||||
// ensure that the code runs without throwing an exception
|
||||
vm.runInNewContext("var global = this;\n" + bundle, {
|
||||
setInterval: function () {},
|
||||
setTimeout: function () {}
|
||||
});
|
||||
vm.runInNewContext("var global = this;\n" + bundle, {});
|
||||
done();
|
||||
})
|
||||
})
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
bar;
|
||||
3
test/core/fixtures/bin/babel/--ignore/options.json
Normal file
3
test/core/fixtures/bin/babel/--ignore/options.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"args": ["src", "--out-dir", "lib", "--ignore", "src/foo/*"]
|
||||
}
|
||||
1
test/core/fixtures/bin/babel/--ignore/stdout.txt
Normal file
1
test/core/fixtures/bin/babel/--ignore/stdout.txt
Normal file
@@ -0,0 +1 @@
|
||||
src/bar/index.js -> lib/bar/index.js
|
||||
@@ -0,0 +1 @@
|
||||
bar;
|
||||
3
test/core/fixtures/bin/babel/--only/options.json
Normal file
3
test/core/fixtures/bin/babel/--only/options.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"args": ["src", "--out-dir", "lib", "--only", "src/bar/*"]
|
||||
}
|
||||
1
test/core/fixtures/bin/babel/--only/stdout.txt
Normal file
1
test/core/fixtures/bin/babel/--only/stdout.txt
Normal file
@@ -0,0 +1 @@
|
||||
src/bar/index.js -> lib/bar/index.js
|
||||
@@ -2,13 +2,16 @@
|
||||
|
||||
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
|
||||
|
||||
module.exports = foo;
|
||||
module.exports = 42;
|
||||
module.exports = {};
|
||||
module.exports = [];
|
||||
module.exports = foo;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = foo;
|
||||
exports["default"] = 42;
|
||||
exports["default"] = {};
|
||||
exports["default"] = [];
|
||||
exports["default"] = foo;
|
||||
|
||||
module.exports = function () {};
|
||||
exports["default"] = function () {};
|
||||
|
||||
var _default = (function () {
|
||||
var _class = function _default() {
|
||||
@@ -18,7 +21,7 @@ var _default = (function () {
|
||||
return _class;
|
||||
})();
|
||||
|
||||
module.exports = _default;
|
||||
exports["default"] = _default;
|
||||
|
||||
function foo() {}
|
||||
|
||||
@@ -26,5 +29,6 @@ var Foo = function Foo() {
|
||||
_classCallCheck(this, Foo);
|
||||
};
|
||||
|
||||
module.exports = Foo;
|
||||
module.exports = foo;
|
||||
exports["default"] = Foo;
|
||||
exports["default"] = foo;
|
||||
module.exports = exports["default"];
|
||||
@@ -1,12 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
||||
|
||||
var _foo = require("foo");
|
||||
|
||||
var foo = _interopRequire(_foo);
|
||||
var _foo2 = _interopRequireWildcard(_foo);
|
||||
|
||||
var foo2 = _interopRequire(_foo);
|
||||
var _foo22 = _interopRequireWildcard(_foo);
|
||||
|
||||
foo;
|
||||
foo2;
|
||||
_foo2["default"];
|
||||
_foo22["default"];
|
||||
@@ -1,10 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
||||
|
||||
var _foo$xyz = require("foo");
|
||||
|
||||
var foo = _interopRequire(_foo$xyz);
|
||||
var _foo$xyz2 = _interopRequireWildcard(_foo$xyz);
|
||||
|
||||
foo;
|
||||
_foo$xyz.baz;
|
||||
_foo$xyz2["default"];
|
||||
_foo$xyz.baz;
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
||||
|
||||
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
@@ -16,7 +14,7 @@ require("./directory/foo-bar");
|
||||
|
||||
var _foo = require("foo2");
|
||||
|
||||
var foo = _interopRequire(_foo);
|
||||
var _foo2 = _interopRequireWildcard(_foo);
|
||||
|
||||
var _import = require("foo3");
|
||||
|
||||
@@ -32,4 +30,4 @@ var test = 5;
|
||||
exports.test = test;
|
||||
_bar.bar;
|
||||
_bar2.foo;
|
||||
foo;
|
||||
_foo2["default"];
|
||||
@@ -39,4 +39,4 @@ System.register([], function (_export) {
|
||||
_export("f", _export("e", d = 4));
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
@@ -1,7 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _foo2 = require("bar");
|
||||
|
||||
var _foo = babelHelpers.interopRequire(_foo2);
|
||||
var _foo3 = babelHelpers.interopRequireWildcard(_foo2);
|
||||
|
||||
exports.foo = _foo;
|
||||
exports.foo = _foo3["default"];
|
||||
@@ -0,0 +1,3 @@
|
||||
function foo(bar) {
|
||||
var bar = bar[0];
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
function foo(bar) {
|
||||
var bar = bar[0];
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
import toString from "foo";
|
||||
toString;
|
||||
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
||||
|
||||
var _toString = require("foo");
|
||||
|
||||
var _toString2 = _interopRequireWildcard(_toString);
|
||||
|
||||
_toString2["default"];
|
||||
@@ -1,7 +1,11 @@
|
||||
module.exports = React.createClass({
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports["default"] = React.createClass({
|
||||
displayName: "actual",
|
||||
|
||||
render: function render() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
module.exports = exports["default"];
|
||||
@@ -4,8 +4,6 @@ var _core = require("babel-runtime/core-js")["default"];
|
||||
|
||||
var _regeneratorRuntime = require("babel-runtime/regenerator")["default"];
|
||||
|
||||
var _interopRequire = require("babel-runtime/helpers/interop-require")["default"];
|
||||
|
||||
var _interopRequireWildcard = require("babel-runtime/helpers/interop-require-wildcard")["default"];
|
||||
|
||||
_core.Object.defineProperty(exports, "__esModule", {
|
||||
@@ -30,12 +28,12 @@ exports.giveWord = giveWord;
|
||||
|
||||
var _foo = require("someModule");
|
||||
|
||||
var foo = _interopRequire(_foo);
|
||||
var _foo2 = _interopRequireWildcard(_foo);
|
||||
|
||||
var bar = _interopRequireWildcard(_foo);
|
||||
|
||||
var myWord = _core.Symbol("abc");
|
||||
exports.myWord = myWord;
|
||||
|
||||
foo;
|
||||
bar;
|
||||
_foo2["default"];
|
||||
bar;
|
||||
@@ -1,9 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequire = require("babel-runtime/helpers/interop-require")["default"];
|
||||
var _interopRequireWildcard = require("babel-runtime/helpers/interop-require-wildcard")["default"];
|
||||
|
||||
var _foo = require("foo");
|
||||
|
||||
var foo = _interopRequire(_foo);
|
||||
var _foo2 = _interopRequireWildcard(_foo);
|
||||
|
||||
foo;
|
||||
_foo2["default"];
|
||||
@@ -57,6 +57,11 @@ suite("util", function () {
|
||||
assert.deepEqual(util.list(""), []);
|
||||
assert.deepEqual(util.list("foo"), ["foo"]);
|
||||
assert.deepEqual(util.list("foo,bar"), ["foo", "bar"]);
|
||||
assert.deepEqual(util.list(["foo", "bar"]), ["foo", "bar"]);
|
||||
assert.deepEqual(util.list(/foo/), [/foo/]);
|
||||
|
||||
var date = new Date;
|
||||
assert.deepEqual(util.list(date), [date]);
|
||||
});
|
||||
|
||||
test("arrayify", function () {
|
||||
|
||||
Reference in New Issue
Block a user