Compare commits

..

31 Commits

Author SHA1 Message Date
Sebastian McKenzie
253ea8cd18 v5.2.6 2015-05-01 13:08:28 +01:00
Sebastian McKenzie
d37bad3149 add 5.2.6 changelog 2015-05-01 13:07:38 +01:00
Sebastian McKenzie
a2b912bc77 add BABEL mention to deprecation message 2015-05-01 13:07:31 +01:00
Sebastian McKenzie
f1bfbe44e2 expose Pipeline as TransformerPipeline 2015-05-01 13:00:34 +01:00
Sebastian McKenzie
dbdd07d0b8 fix addAliases call 2015-05-01 13:00:26 +01:00
Sebastian McKenzie
166909998e 5.2.5 2015-05-01 13:00:15 +01:00
Sebastian McKenzie
a8ec4c965c v5.2.5 2015-05-01 11:41:15 +01:00
Sebastian McKenzie
d2aff67c6c 5.2.4 2015-05-01 11:39:43 +01:00
Sebastian McKenzie
3353de225d fix parse API not adding all the correct pipeline transformers 2015-05-01 11:39:38 +01:00
Sebastian McKenzie
203ebeef20 v5.2.4 2015-05-01 11:29:06 +01:00
Sebastian McKenzie
032cf990c3 add 5.2.4 changelog 2015-05-01 11:28:24 +01:00
Sebastian McKenzie
16cdb43c67 expose transform pipeline and require node api inside of the browser one to avoid race conditions 2015-05-01 11:27:23 +01:00
Sebastian McKenzie
6f622033c5 5.2.3 2015-05-01 11:27:02 +01:00
Sebastian McKenzie
531d4f1937 v5.2.3 2015-05-01 09:42:23 +01:00
Sebastian McKenzie
f155bc249c fix Program global reference catching for real this time 2015-05-01 09:41:35 +01:00
Sebastian McKenzie
452d0ef30e fix Program global reference catching 2015-05-01 09:40:03 +01:00
Sebastian McKenzie
005754ba98 Revert "Revert "make dead code elimination smarter and eliminate non-referenced "pure" nodes""
This reverts commit c3c4cf17e3.
2015-05-01 09:39:33 +01:00
Sebastian McKenzie
c3c4cf17e3 Revert "make dead code elimination smarter and eliminate non-referenced "pure" nodes"
This reverts commit 4e87809ff9.
2015-05-01 09:39:07 +01:00
Sebastian McKenzie
0866e5a403 add 5.2.3 changelog 2015-05-01 09:36:48 +01:00
Sebastian McKenzie
15f5e658fc Merge branch 'master' of github.com:babel/babel 2015-05-01 09:32:28 +01:00
Sebastian McKenzie
574e6da132 add Statement and Declaration aliases to flow types - fixes #1401 2015-05-01 09:32:11 +01:00
Sebastian McKenzie
da6d27ed16 Merge pull request #1404 from timbur/master
hopefully fixes #1402
2015-05-01 09:31:46 +01:00
Sebastian McKenzie
4e87809ff9 make dead code elimination smarter and eliminate non-referenced "pure" nodes 2015-05-01 09:31:28 +01:00
Sebastian McKenzie
f4267aaab0 Merge pull request #1403 from wyand/master
fix spelling
2015-05-01 09:28:46 +01:00
Sebastian McKenzie
4f255d103a Merge pull request #1400 from monsanto/flow-object-commas
Support commas as object property separators in flow
2015-05-01 09:24:08 +01:00
Tim Burgess
502cc13aed hopefully fixes #1402 2015-05-01 04:05:22 -04:00
Dan Wyand
0a1154e6fd fix spelling 2015-05-01 01:01:10 -04:00
Christopher Monsanto
f5b3d72730 support commas as obj property separators in flow 2015-05-01 00:09:26 -04:00
Sebastian McKenzie
e9bcccffbd futz the bundler idea 2015-05-01 03:26:12 +01:00
Sebastian McKenzie
aaf4cbf06f start on babel module bundling and type inferrence 2015-05-01 02:59:59 +01:00
Sebastian McKenzie
5080534974 5.2.2 2015-05-01 00:44:48 +01:00
25 changed files with 302 additions and 120 deletions

View File

@@ -13,6 +13,31 @@ _Note: Gaps between patch versions are faulty/broken releases._
See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
## 5.2.6
* **Internal**
* Fix transformer aliases being accidently set as deprecated ones.
* Expose `Pipeline` as `TransformerPipeline` instead.
## 5.2.5
* **Bug Fix**
* Fix `parse` API not adding all the correct pipeline transformers.
## 5.2.4
* **Bug Fix**
* Fix race condition with the Node API being loaded awkwardly and not being able to initialise itself when used in the browser.
* **Internal**
* Expose `transform.pipeline`.
## 5.2.3
* **Bug Fix**
* Fix plugin containers being called with an undefined import. Thanks [@timbur](https://github.com/timbur)!
* Allow Flow object separators to be commas. Thanks [@monsanto](https://github.com/monsanto)!
* Add missing `Statement` and `Declaration` node aliases to flow types.
## 5.2.2
* **Internal**

View File

@@ -1,7 +1,7 @@
{
"name": "babel-core",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "5.2.2",
"version": "5.2.6",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"repository": "babel/babel",
@@ -28,6 +28,7 @@
},
"dependencies": {
"ast-types": "~0.7.0",
"bluebird": "^2.9.25",
"chalk": "^1.0.0",
"convert-source-map": "^1.1.0",
"core-js": "^0.9.0",
@@ -49,6 +50,7 @@
"regenerator": "^0.8.20",
"regexpu": "^1.1.2",
"repeating": "^1.1.2",
"resolve": "^1.1.6",
"shebang-regex": "^1.0.0",
"slash": "^1.0.0",
"source-map": "^0.4.0",

View File

@@ -1,13 +1,13 @@
{
"name": "babel",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "5.2.1",
"version": "5.2.5",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"repository": "babel/babel",
"preferGlobal": true,
"dependencies": {
"babel-core": "^5.2.1",
"babel-core": "^5.2.5",
"chokidar": "^1.0.0",
"commander": "^2.6.0",
"convert-source-map": "^1.1.0",

View File

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

View File

@@ -322,7 +322,7 @@ pp.flow_parseObjectType = function (allowStatic) {
}
pp.flow_objectTypeSemicolon = function () {
if (!this.eat(tt.semi) && this.type !== tt.braceR) {
if (!this.eat(tt.semi) && !this.eat(tt.comma) && this.type !== tt.braceR) {
this.unexpected()
}
}

View File

@@ -1,3 +1,4 @@
require("./node");
var transform = module.exports = require("../transformation");
transform.options = require("../transformation/file/options");

View File

@@ -5,10 +5,12 @@ import * as util from "../util";
import fs from "fs";
export { util, acorn, transform };
export { pipeline } from "../transformation";
export { canCompile } from "../util";
export { default as options } from "../transformation/file/options";
export { default as Transformer } from "../transformation/transformer";
export { default as TransformerPipeline } from "../transformation/transformer-pipeline";
export { default as traverse } from "../traversal";
export { default as buildExternalHelpers } from "../tools/build-external-helpers";
export { version } from "../../../package";
@@ -63,7 +65,7 @@ export function parse(code, opts = {}) {
};
opts.features = {};
for (var key in transform.transformers) {
for (var key in transform.pipeline.transformers) {
opts.features[key] = true;
}

View File

@@ -37,7 +37,7 @@ class CodeGenerator {
retainLines: opts.retainLines,
comments: opts.comments == null || opts.comments,
compact: opts.compact,
quotes: CodeGenerator.findCommonStringDelimeter(code, tokens),
quotes: CodeGenerator.findCommonStringDelimiter(code, tokens),
indent: {
adjustMultilineComment: true,
style: style,
@@ -56,7 +56,7 @@ class CodeGenerator {
return format;
}
static findCommonStringDelimeter(code, tokens) {
static findCommonStringDelimiter(code, tokens) {
var occurences = {
single: 0,
double: 0

View File

@@ -1,5 +1,6 @@
import convertSourceMap from "convert-source-map";
import * as optionParsers from "./option-parsers";
import moduleFormatters from "../modules";
import PluginManager from "./plugin-manager";
import shebangRegex from "shebang-regex";
import TraversalPath from "../../traversal/path";
@@ -38,7 +39,7 @@ function checkPath(stack, path) {
}
export default class File {
constructor(opts = {}) {
constructor(opts = {}, pipeline) {
this.dynamicImportTypes = {};
this.dynamicImportIds = {};
this.dynamicImports = [];
@@ -49,9 +50,10 @@ export default class File {
this.data = {};
this.uids = {};
this.log = new Logger(this, opts.filename || "unknown");
this.opts = this.normalizeOptions(opts);
this.ast = {};
this.pipeline = pipeline;
this.log = new Logger(this, opts.filename || "unknown");
this.opts = this.normalizeOptions(opts);
this.ast = {};
this.buildTransformers();
}
@@ -133,7 +135,7 @@ export default class File {
}
var optionParser = optionParsers[option.type];
if (optionParser) val = optionParser(key, val);
if (optionParser) val = optionParser(key, val, this.pipeline);
if (option.alias) {
opts[option.alias] = opts[option.alias] || val;
@@ -200,7 +202,7 @@ export default class File {
var stack = [];
// build internal transformers
each(transform.transformers, function (transformer, key) {
each(this.pipeline.transformers, function (transformer, key) {
var pass = transformers[key] = transformer.buildPass(file);
if (pass.canTransform()) {
@@ -235,7 +237,7 @@ export default class File {
}
getModuleFormatter(type: string) {
var ModuleFormatter = isFunction(type) ? type : transform.moduleFormatters[type];
var ModuleFormatter = isFunction(type) ? type : moduleFormatters[type];
if (!ModuleFormatter) {
var loc = util.resolveRelative(type);

View File

@@ -1,14 +1,13 @@
import transform from "./../index";
import * as util from "../../util";
export function transformerList(key, val) {
export function transformerList(key, val, pipeline) {
val = util.arrayify(val);
if (val.indexOf("all") >= 0 || val.indexOf(true) >= 0) {
val = Object.keys(transform.transformers);
val = Object.keys(pipeline.transformers);
}
return transform._ensureTransformerNames(key, val);
return pipeline._ensureTransformerNames(key, val);
}
export function number(key, val) {

View File

@@ -1,3 +1,4 @@
import * as node from "../../api/node";
import * as messages from "../../messages";
import * as util from "../../util";

View File

@@ -1,68 +1,34 @@
import normalizeAst from "../helpers/normalize-ast";
import Transformer from "./transformer";
import object from "../helpers/object";
import File from "./file";
import each from "lodash/collection/each";
import Pipeline from "./transformer-pipeline";
export default function transform(code: string, opts?: Object) {
var file = new File(opts);
return file.parse(code);
}
var pipeline = new Pipeline;
transform.fromAst = function (ast, code, opts) {
ast = normalizeAst(ast);
//
var file = new File(opts);
file.addCode(code);
file.transform(ast);
return file.generate();
};
import transformers from "./transformers";
pipeline.addTransformers(transformers);
transform._ensureTransformerNames = function (type: string, rawKeys: Array<string>) {
var keys = [];
//
for (var i = 0; i < rawKeys.length; i++) {
var key = rawKeys[i];
import deprecated from "./transformers/deprecated";
pipeline.addDeprecated(deprecated);
var deprecatedKey = transform.deprecatedTransformerMap[key];
var aliasKey = transform.aliasTransformerMap[key];
if (aliasKey) {
keys.push(aliasKey);
} else if (deprecatedKey) {
// deprecated key, remap it to the new one
console.error(`The transformer ${key} has been renamed to ${deprecatedKey}`);
rawKeys.push(deprecatedKey);
} else if (transform.transformers[key]) {
// valid key
keys.push(key);
} else if (transform.namespaces[key]) {
// namespace, append all transformers within this namespace
keys = keys.concat(transform.namespaces[key]);
} else {
// invalid key
throw new ReferenceError(`Unknown transformer ${key} specified in ${type}`);
}
}
//
return keys;
};
import aliases from "./transformers/aliases";
pipeline.addAliases(aliases);
transform.transformerNamespaces = object();
transform.transformers = object();
transform.namespaces = object();
//
transform.deprecatedTransformerMap = require("./transformers/deprecated");
transform.aliasTransformerMap = require("./transformers/aliases");
transform.moduleFormatters = require("./modules");
import * as filters from "./transformers/filters";
pipeline.addFilter(filters.internal);
pipeline.addFilter(filters.blacklist);
pipeline.addFilter(filters.whitelist);
pipeline.addFilter(filters.stage);
pipeline.addFilter(filters.optional);
import rawTransformers from "./transformers";
//
each(rawTransformers, function (transformer, key) {
var namespace = key.split(".")[0];
transform.namespaces[namespace] = transform.namespaces[namespace] || [];
transform.namespaces[namespace].push(key);
transform.transformerNamespaces[key] = namespace;
transform.transformers[key] = new Transformer(key, transformer);
});
var transform = pipeline.transform.bind(pipeline);
transform.fromAst = pipeline.transformFromAst.bind(pipeline);
transform.pipeline = pipeline;
export default transform;

View File

@@ -17,30 +17,7 @@ export default class TransformerPass {
}
canTransform(): boolean {
var transformer = this.transformer;
var opts = this.file.opts;
var key = transformer.key;
// internal
if (key[0] === "_") return true;
// blacklist
var blacklist = opts.blacklist;
if (blacklist.length && includes(blacklist, key)) return false;
// whitelist
var whitelist = opts.whitelist;
if (whitelist) return includes(whitelist, key);
// stage
var stage = transformer.metadata.stage;
if (stage != null && stage >= opts.stage) return true;
// optional
if (transformer.metadata.optional && !includes(opts.optional, key)) return false;
return true;
return this.file.pipeline.canTransform(this.transformer, this.file.opts);
}
checkPath(path: TraversalPath): boolean {

View File

@@ -0,0 +1,100 @@
import Transformer from "./transformer";
import normalizeAst from "../helpers/normalize-ast";
import assign from "lodash/object/assign";
import object from "../helpers/object";
import File from "./file";
export default class TransformerPipeline {
constructor() {
this.transformers = object();
this.namespaces = object();
this.deprecated = object();
this.aliases = object();
this.filters = [];
}
addTransformers(transformers) {
for (var key in transformers) {
this.addTransformer(key, transformers[key]);
}
return this;
}
addTransformer(key, transformer) {
if (this.transformers[key]) throw new Error(); // todo: error
var namespace = key.split(".")[0];
this.namespaces[namespace] = this.namespaces[namespace] || [];
this.namespaces[namespace].push(key);
this.namespaces[key] = namespace;
this.transformers[key] = new Transformer(key, transformer);
}
addAliases(names) {
assign(this.aliases, names);
return this;
}
addDeprecated(names) {
assign(this.deprecated, names);
return this;
}
addFilter(filter: Function) {
this.filters.push(filter);
return this;
}
canTransform(transformer, fileOpts) {
for (var filter of (this.filters: Array)) {
var result = filter(transformer, fileOpts);
if (result != null) return result;
}
return true;
}
transform(code: string, opts?: Object) {
var file = new File(opts, this);
return file.parse(code);
}
transformFromAst(ast, code, opts) {
ast = normalizeAst(ast);
var file = new File(opts, this);
file.addCode(code);
file.transform(ast);
return file.generate();
}
_ensureTransformerNames(type: string, rawKeys: Array<string>) {
var keys = [];
for (var i = 0; i < rawKeys.length; i++) {
var key = rawKeys[i];
var deprecatedKey = this.deprecated[key];
var aliasKey = this.aliases[key];
if (aliasKey) {
keys.push(aliasKey);
} else if (deprecatedKey) {
// deprecated key, remap it to the new one
console.error(`[BABEL] The transformer ${key} has been renamed to ${deprecatedKey}`);
rawKeys.push(deprecatedKey);
} else if (this.transformers[key]) {
// valid key
keys.push(key);
} else if (this.namespaces[key]) {
// namespace, append all transformers within this namespace
keys = keys.concat(this.namespaces[key]);
} else {
// invalid key
throw new ReferenceError(`Unknown transformer ${key} specified in ${type}`);
}
}
return keys;
}
}

View File

@@ -15,7 +15,7 @@ import each from "lodash/collection/each";
*/
export default class Transformer {
constructor(transformerKey: string, transformer: Object, opts: Object) {
constructor(transformerKey: string, transformer: Object) {
transformer = assign({}, transformer);
var take = function (key) {
@@ -40,7 +40,6 @@ export default class Transformer {
//
this.handlers = this.normalize(transformer);
this.opts = this.opts || {};
this.key = transformerKey;
//

View File

@@ -0,0 +1,24 @@
import includes from "lodash/collection/includes";
export function internal(transformer, opts) {
if (transformer.key[0] === "_") return true;
}
export function blacklist(transformer, opts) {
var blacklist = opts.blacklist;
if (blacklist.length && includes(blacklist, transformer.key)) return false;
}
export function whitelist(transformer, opts) {
var whitelist = opts.whitelist;
if (whitelist) return includes(whitelist, transformer.key);
}
export function stage(transformer, opts) {
var stage = transformer.metadata.stage;
if (stage != null && stage >= opts.stage) return true;
}
export function optional(transformer, opts) {
if (transformer.metadata.optional && !includes(opts.optional, transformer.key)) return false;
}

View File

@@ -21,6 +21,38 @@ export var metadata = {
optional: true
};
export function Identifier(node, parent, scope) {
if (!this.isReferenced()) return;
var binding = scope.getBinding(node.name);
if (!binding || binding.references > 1 || !binding.constant) return;
var replacement = binding.path.node;
if (t.isVariableDeclarator(replacement)) {
replacement = replacement.init;
}
t.toExpression(replacement);
scope.removeBinding(node.name);
binding.path.remove();
return replacement;
}
export function FunctionDeclaration(node, parent, scope) {
var bindingInfo = scope.getBinding(node.id.name);
if (bindingInfo && !bindingInfo.referenced) {
this.remove();
}
}
export { FunctionDeclaration as ClassDeclaration };
export function VariableDeclarator(node, parent, scope) {
if (!t.isIdentifier(node.id) || !scope.isPure(node.init)) return;
FunctionDeclaration.apply(this, arguments);
}
export function ConditionalExpression(node, parent, scope) {
var evaluateTest = this.get("test").evaluateTruthy();
if (evaluateTest === true) {

View File

@@ -3,6 +3,8 @@ import * as t from "../types";
export default class Binding {
constructor({ identifier, scope, path, kind }) {
this.identifier = identifier;
this.references = 0;
this.referenced = false;
this.constant = true;
this.scope = scope;
this.path = path;
@@ -58,6 +60,15 @@ export default class Binding {
}
}
/**
* Description
*/
reference() {
this.referenced = true;
this.references++;
}
/**
* Description
*/

View File

@@ -319,6 +319,12 @@ export default class TraversalPath {
var parent = this.parent;
if (!parentPath) return;
// we've just removed the last declarator of a variable declaration so there's no point in
// keeping it
if (parentPath.isVariableDeclaration() && parent.declarations.length === 0) {
return parentPath.remove();
}
// we're the child of an expression statement so we should remove the parent
if (parentPath.isExpressionStatement()) {
return parentPath.remove();
@@ -650,6 +656,10 @@ export default class TraversalPath {
return this.shouldStop;
}
/**
* Description
*/
getSibling(key) {
return TraversalPath.get(this.parentPath, null, this.parent, this.container, key, this.file);
}

View File

@@ -40,8 +40,13 @@ var functionVariableVisitor = {
var programReferenceVisitor = {
enter(node, parent, scope, state) {
if (t.isReferencedIdentifier(node, parent) && !scope.hasBinding(node.name)) {
state.addGlobal(node);
if (t.isReferencedIdentifier(node, parent)) {
var bindingInfo = scope.getBinding(node.name);
if (bindingInfo) {
bindingInfo.reference();
} else {
state.addGlobal(node);
}
} else if (t.isLabeledStatement(node)) {
state.addGlobal(node);
} else if (t.isAssignmentExpression(node)) {
@@ -482,6 +487,19 @@ export default class Scope {
this.crawl();
}
/**
* Description
*/
isPure(node) {
if (t.isIdentifier(node)) {
var bindingInfo = this.getBinding(node.name);
return bindingInfo.constant;
} else {
return t.isPure(node);
}
}
/**
* Description
*/

View File

@@ -26,9 +26,9 @@
"ExportNamedDeclaration": ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
"ImportDeclaration": ["Statement", "Declaration", "ModuleDeclaration"],
"ArrowFunctionExpression": ["Scopable", "Function", "Expression"],
"FunctionDeclaration": ["Scopable", "Function", "Statement", "Declaration"],
"FunctionExpression": ["Scopable", "Function", "Expression"],
"ArrowFunctionExpression": ["Scopable", "Function", "Expression", "Pure"],
"FunctionDeclaration": ["Scopable", "Function", "Statement", "Pure", "Declaration"],
"FunctionExpression": ["Scopable", "Function", "Expression", "Pure"],
"BlockStatement": ["Scopable", "Statement"],
"Program": ["Scopable"],
@@ -41,8 +41,8 @@
"SpreadProperty": ["UnaryLike"],
"SpreadElement": ["UnaryLike"],
"ClassDeclaration": ["Scopable", "Class", "Statement", "Declaration"],
"ClassExpression": ["Scopable", "Class", "Expression"],
"ClassDeclaration": ["Scopable", "Class", "Pure", "Statement", "Declaration"],
"ClassExpression": ["Scopable", "Class", "Pure", "Expression"],
"ForOfStatement": ["Scopable", "Statement", "For", "Loop"],
"ForInStatement": ["Scopable", "Statement", "For", "Loop"],
@@ -62,7 +62,7 @@
"ConditionalExpression": ["Expression"],
"DoExpression": ["Expression"],
"Identifier": ["Expression"],
"Literal": ["Expression"],
"Literal": ["Expression", "Pure"],
"MemberExpression": ["Expression"],
"MetaProperty": ["Expression"],
"NewExpression": ["Expression"],
@@ -80,15 +80,15 @@
"ArrayTypeAnnotation": ["Flow"],
"BooleanTypeAnnotation": ["Flow"],
"ClassImplements": ["Flow"],
"DeclareClass": ["Flow"],
"DeclareFunction": ["Flow"],
"DeclareModule": ["Flow"],
"DeclareVariable": ["Flow"],
"DeclareClass": ["Flow", "Statement"],
"DeclareFunction": ["Flow", "Statement"],
"DeclareModule": ["Flow", "Statement"],
"DeclareVariable": ["Flow", "Statement"],
"FunctionTypeAnnotation": ["Flow"],
"FunctionTypeParam": ["Flow"],
"GenericTypeAnnotation": ["Flow"],
"InterfaceExtends": ["Flow"],
"InterfaceDeclaration": ["Flow"],
"InterfaceDeclaration": ["Flow", "Statement", "Declaration"],
"IntersectionTypeAnnotation": ["Flow"],
"NullableTypeAnnotation": ["Flow"],
"NumberTypeAnnotation": ["Flow"],
@@ -96,7 +96,7 @@
"StringTypeAnnotation": ["Flow"],
"TupleTypeAnnotation": ["Flow"],
"TypeofTypeAnnotation": ["Flow"],
"TypeAlias": ["Flow"],
"TypeAlias": ["Flow", "Statement"],
"TypeAnnotation": ["Flow"],
"TypeCastExpression": ["Flow"],
"TypeParameterDeclaration": ["Flow"],

View File

@@ -19,7 +19,7 @@ suite("api", function () {
});
test("addHelper unknown", function () {
var file = new File;
var file = new File({}, transform.pipeline);
assert.throws(function () {
file.addHelper("foob");
}, /Unknown helper foob/);
@@ -40,11 +40,11 @@ suite("api", function () {
});
test("extra options", function () {
var file1 = new File({ extra: { foo: "bar" } });
var file1 = new File({ extra: { foo: "bar" } }, transform.pipeline);
assert.equal(file1.opts.extra.foo, "bar");
var file2 = new File;
var file3 = new File;
var file2 = new File({}, transform.pipeline);
var file3 = new File({}, transform.pipeline);
assert.ok(file2.opts.extra !== file3.opts.extra);
});

View File

@@ -0,0 +1,3 @@
import foo from "./fixtures/foo";
foo();

View File

@@ -0,0 +1,7 @@
"use strict";
function fixtures$foo() {
return "foobar";
}
fixtures$foo();

View File

@@ -0,0 +1,3 @@
export default function () {
return "foobar";
}