Compare commits

...

23 Commits

Author SHA1 Message Date
Sebastian McKenzie
fcbd315bc1 v1.10.12 2014-11-07 13:53:15 +11:00
Sebastian McKenzie
71646f4ade register: fix ignoreRegex compatibility check 2014-11-07 13:52:13 +11:00
Sebastian McKenzie
e5f1eb64b6 clarify default ignore in 6to5/register 2014-11-07 13:41:24 +11:00
Sebastian McKenzie
6145f0a03b v1.10.11 2014-11-07 13:17:41 +11:00
Sebastian McKenzie
54f901f131 require: add missing blacklistTests, implement opts.whitelist and opts.only - closes #125
Conflicts:
	lib/6to5/register.js
2014-11-07 13:16:26 +11:00
Sebastian McKenzie
5deeae1aa2 travis: ignore experimental branch 2014-11-03 18:26:50 +11:00
Sebastian McKenzie
c17878913b add classProps declaration to simplify/nicen up class property defining - closes #88 2014-11-03 13:36:23 +11:00
Sebastian McKenzie
c8139317ee add static property inherit warning for IE <= 9 to README - closes #116 2014-11-03 13:09:36 +11:00
Sebastian McKenzie
74f11dfddf add chai to devDependencies 2014-11-03 12:35:59 +11:00
Sebastian McKenzie
6332e725fe update bin tests to match updated use strict behaviour 2014-11-03 12:34:00 +11:00
Sebastian McKenzie
89ecd46b77 move _moduleFormatter transformer before useStrict transformer and remove duplicate use strict removing - fixes #114 2014-11-03 12:20:47 +11:00
Sebastian McKenzie
7e8c5cd20f Merge pull request #118 from amsul/patch-1
Added ability to register 6to5 with a blacklist
2014-11-02 10:39:13 +11:00
amsul
ddbb522392 Updated blacklist option to replace reference 2014-11-01 19:36:10 -04:00
amsul
288cfd1f00 Added ability to register 6to5 with a blacklist
Currently, to achieve this, I have to use this workaround:

```js
var to5 = require('6to5')
delete to5.transform.transformers.generators
require('6to5/register')
```

After this simple change, I can make it much nicer:

```js
require('6to5/register')({
    blacklist: ['generators']
})
```

Cheers!
2014-11-01 14:15:52 -04:00
Sebastian McKenzie
1841f5c8a0 v1.10.10 2014-11-01 16:08:11 +11:00
Sebastian McKenzie
33f8988313 support for numeric literals with recast - fixes #117 2014-11-01 16:06:46 +11:00
Sebastian McKenzie
af997b9945 Merge pull request #115 from djindjic/patch-1
Just a little info added
2014-11-01 08:39:33 +11:00
Aleksandar Djindjic
a2332f08bc Just a little info added
I needed this and it maybe help to someone else
2014-10-31 14:58:46 +01:00
Sebastian McKenzie
115dca56b6 v1.10.9 2014-10-31 21:39:17 +11:00
Sebastian McKenzie
251e4d01c8 join together declarations in destructuring to return a single node if possible - fixes #113 2014-10-31 21:38:22 +11:00
Sebastian McKenzie
530ad78428 fix & html entity in travis badge branch url - thanks @davidchambers 2014-10-31 11:51:49 +11:00
Sebastian McKenzie
51f72ace57 Merge pull request #112 from thejameskyle/travis-badge
Add ?branch=master to Travis CI badge
2014-10-31 11:47:50 +11:00
James Kyle
2fa36b30d5 Add ?branch=master to Travis CI badge 2014-10-30 17:46:08 -07:00
49 changed files with 271 additions and 118 deletions

View File

@@ -3,6 +3,10 @@ node_js:
- "0.10"
- "0.11"
branches:
except:
- experimental
before_script: "npm install -g codeclimate-test-reporter"
script: "make test-travis"

View File

@@ -4,7 +4,7 @@
<p align="center">
<a href="https://travis-ci.org/sebmck/6to5">
<img alt="Travis Status" src="http://img.shields.io/travis/sebmck/6to5.svg?style=flat&amp;label=travis">
<img alt="Travis Status" src="http://img.shields.io/travis/sebmck/6to5.svg?branch=master&amp;style=flat&amp;label=travis">
</a>
<a href="https://codeclimate.com/github/sebmck/6to5">
@@ -103,6 +103,10 @@ Compile the entire `src` directory and output it to the `lib` directory.
$ 6to5 src --out-dir lib
Compile the entire `src` directory and output it to the one concatenated file.
$ 6to5 src --out-file script-compiled.js
Pipe a file in via stdin and output it to `script-compiled.js`
$ 6to5 --out-file script-compiled.js < script.js
@@ -186,21 +190,34 @@ require("6to5/register");
```
**NOTE:** By default all requires to `node_modules` will be ignored. You can
override this by passing an ignore regex via:
```javascript
require("6to5/register")(/regex/);
```
You can also customise the file extensions that the require hook will use via:
override this by passing an ignore regex via options.
```javascript
require("6to5/register")({
// optional ignore regex
ignoreRegex: /regex/,
// This will override `node_modules` ignoring - you can alternatively pass
// a regex
ignore: false
});
```
// this will remove the currently hooked extensions of .es6 and .js so you'll
// have to add them back if you want them to be used again
##### Options
```javascript
require("6to5/register")({
// Optional ignore regex - if any filenames **do** match this regex then they
// aren't compiled
ignore: /regex/,
// Optional only regex - if any filenames **don't** match this regex then they
// aren't compiled
only: /my_es6_folder/,
// See options above for usage
whitelist: [],
blacklist: [],
// This will remove the currently hooked extensions of .es6 and .js so you'll
// have to add them back if you want them to be used again.
extensions: [".js", ".es6"]
});
```
@@ -279,6 +296,23 @@ If you're inheriting from a class then static properties are inherited from it
via [\_\_proto\_\_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto),
this is widely supported but you may run into problems with much older browsers.
**NOTE:** `__proto__` is not supported on IE <= 9 so static properties
**will not** be inherited. A possible workaround is to use `super();`:
```javascript
class Foo {
static foo() {
}
}
class Bar extends Foo {
static foo() {
super();
}
}
```
### Generators
The [regenerator runtime](https://github.com/facebook/regenerator/blob/master/runtime.js)

View File

@@ -100,8 +100,8 @@ module.exports = function (commander, filenames) {
}
});
_.each(_filenames, function (filename, i) {
results.push(util.compile(filename, { _noStrict: +i !== 0 }));
_.each(_filenames, function (filename) {
results.push(util.compile(filename));
});
output();

View File

@@ -20,17 +20,56 @@ sourceMapSupport.install({
//
var blacklist = [];
var blacklistTest = function (transformer, code) {
try {
if (_.isFunction(code)) {
code();
} else {
new Function(code);
}
blacklist.push(transformer);
} catch (err) {
if (err.name !== "SyntaxError") throw err;
}
};
blacklistTest("arrayComprehension", "var foo = [for (foo of bar) foo * foo];");
blacklistTest("arrowFunctions", "var foo = x => x * x;");
blacklistTest("classes", "class Foo {}");
blacklistTest("computedPropertyNames", "var foo = { [foo]: bar };");
//blacklistTest("constants", "const foo = 0;");
blacklistTest("defaultParamaters", "var foo = function (bar = 0) {};");
blacklistTest("destructuring", "var { x, y } = { x: 0, y: 0 };");
blacklistTest("forOf", "for (var foo of bar) {}");
blacklistTest("generators", "function* foo() {}");
blacklistTest("letScoping", "let foo = 0;");
blacklistTest("modules", 'import foo from "from";');
blacklistTest("propertyMethodAssignment", "{ get foo() {} }");
blacklistTest("propertyNameShorthand", "var foo = { x, y };");
blacklistTest("restParameters", "function foo(...bar) {}");
blacklistTest("spread", "foo(...bar);");
blacklistTest("templateLiterals", "`foo`");
blacklistTest("unicodeRegex", function () { new RegExp("foo", "u"); });
//
var ignoreRegex = /node_modules/;
var onlyRegex;
var whitelist = [];
var exts = {};
var maps = {};
var old = require.extensions[".js"];
var loader = function (m, filename) {
if (ignoreRegex && ignoreRegex.test(filename)) {
if ((ignoreRegex && ignoreRegex.test(filename)) || (onlyRegex && !onlyRegex.test(filename))) {
return old.apply(this, arguments);
}
var result = to5.transformFileSync(filename, {
whitelist: whitelist,
blacklist: blacklist,
sourceMap: true
});
@@ -55,12 +94,16 @@ var hookExtensions = function (_exts) {
hookExtensions([".es6", ".js"]);
module.exports = function (opts) {
// normalise options
opts = opts || {};
if (_.isRegExp(opts)) opts = { ignoreRegex: opts };
if (_.isRegExp(opts)) opts = { ignore: opts };
if (opts.ignoreRegex != null) opts.ignore = opts.ignoreRegex;
if (opts.ignoreRegex != null) {
ignoreRegex = opts.ignoreRegex;
}
if (opts.only != null) onlyRegex = opts.only;
if (opts.ignore != null) ignoreRegex = opts.ignore;
if (opts.extensions) hookExtensions(opts.extensions);
if (opts.blacklist) blacklist = opts.blacklist;
if (opts.whitelist) whitelist = opts.whitelist;
};

View File

@@ -0,0 +1,4 @@
(function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
})

View File

@@ -95,6 +95,7 @@ transform.transformers = {
forOf: require("./transformers/for-of"),
unicodeRegex: require("./transformers/unicode-regex"),
generators: require("./transformers/generators"),
numericLiterals: require("./transformers/numeric-literals"),
react: require("./transformers/react"),
jsx: require("./transformers/jsx"),
@@ -102,9 +103,10 @@ transform.transformers = {
_aliasFunctions: require("./transformers/_alias-functions"),
_blockHoist: require("./transformers/_block-hoist"),
_declarations: require("./transformers/_declarations"),
_moduleFormatter: require("./transformers/_module-formatter"),
useStrict: require("./transformers/use-strict")
useStrict: require("./transformers/use-strict"),
_moduleFormatter: require("./transformers/_module-formatter")
};
transform.moduleFormatters = {

View File

@@ -56,14 +56,14 @@ var buildClass = function (node, file) {
container.callee.params.push(superClassCallee);
}
buildClassBody(body, className, superName, node);
buildClassBody(file, body, className, superName, node);
body.push(returnStatement);
return container;
};
var buildClassBody = function (body, className, superName, node) {
var buildClassBody = function (file, body, className, superName, node) {
var instanceMutatorMap = {};
var staticMutatorMap = {};
var hasConstructor = false;
@@ -105,16 +105,28 @@ var buildClassBody = function (body, className, superName, node) {
}, true));
}
var instanceProps;
var staticProps;
if (!_.isEmpty(instanceMutatorMap)) {
var protoId = util.template("prototype-identifier", {
CLASS_NAME: className
});
body.push(util.buildDefineProperties(instanceMutatorMap, protoId));
instanceProps = util.buildDefineProperties(instanceMutatorMap, protoId);
}
if (!_.isEmpty(staticMutatorMap)) {
body.push(util.buildDefineProperties(staticMutatorMap, className));
staticProps = util.buildDefineProperties(staticMutatorMap, className);
}
if (instanceProps || staticProps) {
instanceProps = instanceProps || b.literal(null);
staticProps = staticProps || b.literal(null);
body.push(b.expressionStatement(
b.callExpression(file.addDeclaration("class-props"), [className, staticProps, instanceProps])
));
}
};

View File

@@ -148,5 +148,22 @@ exports.VariableDeclaration = function (node, parent, file) {
}
});
if (parent.type !== "Program" && parent.type !== "BlockStatement") {
var declar;
_.each(nodes, function (node) {
declar = declar || b.variableDeclaration(node.kind, []);
if (node.type !== "VariableDeclaration" && declar.kind !== node.kind) {
throw util.errorWithNode(node, "Cannot use this node within the current parent");
}
declar.declarations = declar.declarations.concat(node.declarations);
});
return declar;
}
return nodes;
};

View File

@@ -0,0 +1,6 @@
var _ = require("lodash");
exports.Literal = function (node) {
// TODO: remove this when the new code generator is released
if (_.isNumber(node.value)) delete node.raw;
};

View File

@@ -24,6 +24,9 @@ exports.ObjectExpression = function (node, parent, file) {
return util.template("object-define-properties-closure", {
KEY: objId,
OBJECT: node,
CONTENT: util.buildDefineProperties(mutatorMap, objId).expression
CONTENT: util.template("object-define-properties", {
OBJECT: objId,
PROPS: util.buildDefineProperties(mutatorMap)
})
});
};

View File

@@ -1,15 +1,12 @@
var b = require("acorn-ast-types").builders;
module.exports = function (ast, file) {
module.exports = function (ast) {
var body = ast.program.body;
var first = body[0];
var noStrict = !first || first.type !== "ExpressionStatement" || first.expression.type !== "Literal" || first.expression.value !== "use strict";
if (noStrict) {
if (file.opts._noStrict) return;
body.unshift(b.expressionStatement(b.literal("use strict")));
} else {
if (file.opts._noStrict) body.shift();
}
};

View File

@@ -147,7 +147,7 @@ exports.pushMutatorMap = function (mutatorMap, key, kind, method) {
}
};
exports.buildDefineProperties = function (mutatorMap, keyNode) {
exports.buildDefineProperties = function (mutatorMap) {
var objExpr = b.objectExpression([]);
_.each(mutatorMap, function (map, key) {
@@ -164,10 +164,7 @@ exports.buildDefineProperties = function (mutatorMap, keyNode) {
objExpr.properties.push(propNode);
});
return exports.template("object-define-properties", {
OBJECT: keyNode,
PROPS: objExpr
}, true);
return objExpr;
};
exports.template = function (name, nodes, keepExpression) {

View File

@@ -1,7 +1,7 @@
{
"name": "6to5",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "1.10.8",
"version": "1.10.12",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://github.com/sebmck/6to5",
"repository": {
@@ -59,6 +59,7 @@
"browserify": "6.1.0",
"proclaim": "2.0.0",
"rimraf": "2.2.8",
"jshint": "2.5.6"
"jshint": "2.5.6",
"chai": "^1.9.2"
}
}

View File

@@ -4,6 +4,7 @@ var rimraf = require("rimraf");
var mkdirp = require("mkdirp");
var child = require("child_process");
var path = require("path");
var chai = require("chai");
var fs = require("fs");
var _ = require("lodash");
@@ -42,7 +43,7 @@ var assertTest = function (stdout, stderr, opts) {
if (opts.stderrContains) {
assert.ok(_.contains(stderr, expectStderr), "stderr " + JSON.stringify(stderr) + " didn't contain " + JSON.stringify(expectStderr));
} else {
assert.equal(stderr, expectStderr, "stderr didn't match");
chai.expect(stderr).to.equal(expectStderr, "stderr didn't match");
}
} else if (stderr) {
throw new Error("stderr: " + JSON.stringify(stderr));
@@ -55,7 +56,7 @@ var assertTest = function (stdout, stderr, opts) {
if (opts.stdoutContains) {
assert.ok(_.contains(stdout, expectStdout), "stdout " + JSON.stringify(stdout) + " didn't contain " + JSON.stringify(expectStdout));
} else {
assert.equal(stdout, expectStdout, "stdout didn't match");
chai.expect(stdout).to.equal(expectStdout, "stdout didn't match");
}
} else if (stdout) {
throw new Error("stdout: " + JSON.stringify(stdout));
@@ -63,7 +64,7 @@ var assertTest = function (stdout, stderr, opts) {
_.each(opts.outFiles, function (expect, filename) {
var actual = readFile(filename);
assert.equal(actual, expect, "out-file " + filename);
chai.expect(actual).to.equal(expect, "out-file " + filename);
});
};

View File

@@ -4,8 +4,9 @@ var Test = function() {
var Test = function Test() {};
return Test;
}();
"use strict";
arr.map(function(x) {
return x * MULTIPLIER;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyIsInNjcmlwdDIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7SUFBTSxDQUFDLENBQUMsQ0FBQztNQUFILENBQUMsQ0FBQyxDQUFDLGFBQUgsQ0FBQyxDQUFDLENBQUM7U0FBSCxDQUFDLENBQUMsQ0FBQzs7O0FDQVQsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxVQUFDO1NBQUssRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0NBQUMsQ0FBQyIsImZpbGUiOiJzY3JpcHQzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgVGVzdCB7XG5cbn0iLCJhcnIubWFwKHggPT4geCAqIE1VTFRJUExJRVIpOyJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyIsInNjcmlwdDIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7SUFBTSxDQUFDLENBQUMsQ0FBQztNQUFILENBQUMsQ0FBQyxDQUFDLGFBQUgsQ0FBQyxDQUFDLENBQUM7U0FBSCxDQUFDLENBQUMsQ0FBQzs7OztBQ0FULENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsVUFBQztTQUFLLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztDQUFDLENBQUMiLCJmaWxlIjoic2NyaXB0My5qcyIsInNvdXJjZXNDb250ZW50IjpbImNsYXNzIFRlc3Qge1xuXG59IiwiYXJyLm1hcCh4ID0+IHggKiBNVUxUSVBMSUVSKTsiXX0=

View File

@@ -4,6 +4,7 @@ var Test = function() {
var Test = function Test() {};
return Test;
}();
"use strict";
arr.map(function(x) {
return x * MULTIPLIER;
});

View File

@@ -1 +1 @@
{"version":3,"sources":["script.js","script2.js"],"names":[],"mappings":";;IAAM,CAAC,CAAC,CAAC;MAAH,CAAC,CAAC,CAAC,aAAH,CAAC,CAAC,CAAC;SAAH,CAAC,CAAC,CAAC;;;ACAT,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAC;SAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAC,CAAC","file":"script3.js","sourcesContent":["class Test {\n\n}","arr.map(x => x * MULTIPLIER);"]}
{"version":3,"sources":["script.js","script2.js"],"names":[],"mappings":";;IAAM,CAAC,CAAC,CAAC;MAAH,CAAC,CAAC,CAAC,aAAH,CAAC,CAAC,CAAC;SAAH,CAAC,CAAC,CAAC;;;;ACAT,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAC;SAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAC,CAAC","file":"script3.js","sourcesContent":["class Test {\n\n}","arr.map(x => x * MULTIPLIER);"]}

View File

@@ -4,6 +4,7 @@ var Test = function() {
var Test = function Test() {};
return Test;
}();
"use strict";
arr.map(function(x) {
return x * MULTIPLIER;
});

View File

@@ -1,5 +1,12 @@
"use strict";
var _slice = Array.prototype.slice;
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var _extends = function (child, parent) {
child.prototype = Object.create(parent.prototype, {
constructor: {
@@ -27,7 +34,17 @@ var Test = function(Foo) {
_extends(Test, Foo);
Object.defineProperties(Test.prototype, {
_classProps(Test, {
foo: {
writable: true,
value: function() {
Foo.foo.call(this);
Foo.foo.call.apply(Foo.foo, [this].concat(_slice.call(arguments)));
Foo.foo.call.apply(Foo.foo, [this, "test"].concat(_slice.call(arguments)));
}
}
}, {
test: {
writable: true,
@@ -39,17 +56,5 @@ var Test = function(Foo) {
}
});
Object.defineProperties(Test, {
foo: {
writable: true,
value: function() {
Foo.foo.call(this);
Foo.foo.call.apply(Foo.foo, [this].concat(_slice.call(arguments)));
Foo.foo.call.apply(Foo.foo, [this, "test"].concat(_slice.call(arguments)));
}
}
});
return Test;
}(Foo);

View File

@@ -1,5 +1,10 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var _extends = function (child, parent) {
child.prototype = Object.create(parent.prototype, {
constructor: {
@@ -13,7 +18,6 @@ var _extends = function (child, parent) {
child.__proto__ = parent;
};
var Test = function(Foo) {
var Test = function Test() {
Foo.prototype.test.whatever();
@@ -22,7 +26,7 @@ var Test = function(Foo) {
_extends(Test, Foo);
Object.defineProperties(Test, {
_classProps(Test, {
test: {
writable: true,
@@ -30,7 +34,7 @@ var Test = function(Foo) {
return Foo.wow.call(this);
}
}
});
}, null);
return Test;
}(Foo);

View File

@@ -1,9 +1,14 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var Test = function() {
var Test = function Test() {};
Object.defineProperties(Test.prototype, {
_classProps(Test, null, {
test: {
get: function() {
return 5 + 5;
@@ -16,4 +21,4 @@ var Test = function() {
});
return Test;
}();
}();

View File

@@ -1,9 +1,14 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var Test = function() {
var Test = function Test() {};
Object.defineProperties(Test.prototype, {
_classProps(Test, null, {
test: {
get: function() {
return 5 + 5;
@@ -12,4 +17,4 @@ var Test = function() {
});
return Test;
}();
}();

View File

@@ -1,9 +1,14 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var Test = function() {
var Test = function Test() {};
Object.defineProperties(Test.prototype, {
_classProps(Test, null, {
test: {
writable: true,
@@ -14,4 +19,4 @@ var Test = function() {
});
return Test;
}();
}();

View File

@@ -1,9 +1,14 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var Test = function() {
var Test = function Test() {};
Object.defineProperties(Test.prototype, {
_classProps(Test, null, {
test: {
set: function(val) {
this._test = val;
@@ -12,4 +17,4 @@ var Test = function() {
});
return Test;
}();
}();

View File

@@ -1,9 +1,14 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var A = function() {
var A = function A() {};
Object.defineProperties(A, {
_classProps(A, {
a: {
writable: true,
value: function() {}
@@ -13,7 +18,7 @@ var A = function() {
get: function() {},
set: function(b) {}
}
});
}, null);
return A;
}();
}();

View File

@@ -1,6 +1,6 @@
"use strict";
define(["exports"], function (exports) {
"use strict";
exports.default = 42;
exports.default = {};
exports.default = [];

View File

@@ -1,6 +1,6 @@
"use strict";
define(["exports", "foo"], function (exports, _foo) {
"use strict";
(function(obj) {
for (var i in obj) {
exports[i] = obj[i];

View File

@@ -1,6 +1,6 @@
"use strict";
define(["exports"], function (exports) {
"use strict";
exports.foo = foo;
exports.foo = foo;
exports.bar = bar;

View File

@@ -1,6 +1,6 @@
"use strict";
define(["exports"], function (exports) {
"use strict";
exports.foo7 = foo7;
var foo = 1;
exports.foo = foo;

View File

@@ -1,6 +1,6 @@
"use strict";
define(["exports", "./evens"], function (exports, _evens) {
"use strict";
exports.nextOdd = nextOdd;
var isEven = _evens.isEven;

View File

@@ -1,6 +1,5 @@
"use strict";
define(["exports", "foo"], function (exports, _foo) {
"use strict";
var foo = _foo.default;
var foo = _foo.default;
});

View File

@@ -1,5 +1,4 @@
"use strict";
define(["exports", "foo"], function (exports, _foo) {
"use strict";
var foo = _foo;
});

View File

@@ -1,6 +1,6 @@
"use strict";
define(["exports", "foo"], function (exports, _foo) {
"use strict";
var foo = _foo.default;
var xyz = _foo.baz;
});

View File

@@ -1,6 +1,6 @@
"use strict";
define(["exports", "foo"], function (exports, _foo) {
"use strict";
var bar = _foo.bar;
var bar = _foo.bar;
var baz = _foo.baz;

View File

@@ -1,5 +1,3 @@
"use strict";
define(["exports", "foo", "foo-bar", "./directory/foo-bar"], function (exports, _foo, _fooBar, _directoryFooBar) {
"use strict";
});

View File

@@ -1,6 +1,6 @@
"use strict";
define(["exports", "foo", "foo-bar", "./directory/foo-bar"], function (exports, _foo, _fooBar, _directoryFooBar) {
"use strict";
var foo = _foo.default;
var foo = _foo;
var bar = _foo.bar;

View File

@@ -1,5 +1,3 @@
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
@@ -7,6 +5,8 @@
factory(exports);
}
})(function (exports) {
"use strict";
exports.default = 42;
exports.default = {};
exports.default = [];

View File

@@ -1,5 +1,3 @@
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo"], factory);
@@ -7,6 +5,8 @@
factory(exports, require("foo"));
}
})(function (exports, _foo) {
"use strict";
(function(obj) {
for (var i in obj) {
exports[i] = obj[i];

View File

@@ -1,5 +1,3 @@
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
@@ -7,6 +5,8 @@
factory(exports);
}
})(function (exports) {
"use strict";
exports.foo = foo;
exports.foo = foo;
exports.bar = bar;

View File

@@ -1,5 +1,3 @@
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
@@ -7,6 +5,8 @@
factory(exports);
}
})(function (exports) {
"use strict";
exports.foo7 = foo7;
var foo = 1;
exports.foo = foo;

View File

@@ -1,5 +1,3 @@
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "./evens"], factory);
@@ -7,6 +5,8 @@
factory(exports, require("./evens"));
}
})(function (exports, _evens) {
"use strict";
exports.nextOdd = nextOdd;
var isEven = _evens.isEven;

View File

@@ -1,5 +1,3 @@
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo"], factory);
@@ -7,6 +5,8 @@
factory(exports, require("foo"));
}
})(function (exports, _foo) {
"use strict";
var foo = _foo.default;
var foo = _foo.default;
});

View File

@@ -1,5 +1,3 @@
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo"], factory);
@@ -7,5 +5,6 @@
factory(exports, require("foo"));
}
})(function (exports, _foo) {
"use strict";
var foo = _foo;
});

View File

@@ -1,5 +1,3 @@
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo"], factory);
@@ -7,6 +5,7 @@
factory(exports, require("foo"));
}
})(function (exports, _foo) {
"use strict";
var foo = _foo.default;
var xyz = _foo.baz;
});

View File

@@ -1,5 +1,3 @@
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo"], factory);
@@ -7,6 +5,7 @@
factory(exports, require("foo"));
}
})(function (exports, _foo) {
"use strict";
var bar = _foo.bar;
var bar = _foo.bar;
var baz = _foo.baz;

View File

@@ -1,5 +1,3 @@
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo", "foo-bar", "./directory/foo-bar"], factory);
@@ -7,5 +5,5 @@
factory(exports, require("foo"), require("foo-bar"), require("./directory/foo-bar"));
}
})(function (exports, _foo, _fooBar, _directoryFooBar) {
"use strict";
});

View File

@@ -1,5 +1,3 @@
"use strict";
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "foo", "foo-bar", "./directory/foo-bar"], factory);
@@ -7,6 +5,7 @@
factory(exports, require("foo"), require("foo-bar"), require("./directory/foo-bar"));
}
})(function (exports, _foo, _fooBar, _directoryFooBar) {
"use strict";
var foo = _foo.default;
var foo = _foo;
var bar = _foo.bar;

View File

@@ -1,9 +1,14 @@
"use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var Test = function() {
var Test = function Test() {};
Object.defineProperties(Test.prototype, {
_classProps(Test, null, {
bar: {
get: function() {
throw new Error("wow");
@@ -15,4 +20,4 @@ var Test = function() {
}();
var test = new Test();
test.bar;
test.bar;

View File

@@ -4,7 +4,7 @@
"column": 11
},
"generated": {
"line": 9,
"line": 17,
"column": 15
}
}]