finish code generator revamp, output is now much nicer and liberal with it's use of newlines

This commit is contained in:
Sebastian McKenzie
2015-02-20 23:24:11 +11:00
parent f2c5accab3
commit 62556f6102
108 changed files with 302 additions and 129 deletions

View File

@@ -1,10 +1,7 @@
function test() {
/*
* this is comment
*/
var i = 20;
}

View File

@@ -20,11 +20,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
function test() {}
// Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>
//
// Redistribution and use in source and binary forms, with or without

View File

@@ -2,6 +2,7 @@
function one() {
var _arguments = arguments;
var inner = function () {
return _arguments;
};
@@ -11,12 +12,14 @@ one(1, 2);
function two() {
var _arguments = arguments;
var inner = function () {
return _arguments;
};
var another = function another() {
var _arguments2 = arguments;
var inner2 = function () {
return _arguments2;
};
@@ -28,6 +31,7 @@ two(1, 2);
function three() {
var _arguments = arguments;
var fn = function () {
return _arguments[0] + "bar";
};
@@ -37,6 +41,7 @@ three("foo");
function four() {
var _arguments = arguments;
var fn = function () {
return _arguments[0].foo + "bar";
};

View File

@@ -2,6 +2,7 @@
var some = function () {
var count = arguments[0] === undefined ? "30" : arguments[0];
console.log("count", count);
};

View File

@@ -3,6 +3,7 @@
module.exports = {
init: function init() {
var _this = this;
return new Promise(function (resolve, reject) {
MongoClient.connect(config.mongodb, function (err, db) {
if (err) {

View File

@@ -2,6 +2,7 @@
function b() {
var _this = this;
var t = function (x) {
return _this.x + x;
};

View File

@@ -2,9 +2,11 @@
for (var _iterator = [1, 2, 3][Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
var x;
(function () {
var i = _step.value;
x = 5;
fns.push(function () {
return i * x;
});

View File

@@ -1,6 +1,7 @@
"use strict";
var _slice = Array.prototype.slice;
var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
@@ -8,6 +9,7 @@ var _classCallCheck = function (instance, Constructor) { if (!(instance instance
var Test = (function (Foo) {
function Test() {
var _Foo$prototype$test, _Foo$prototype$test2;
_classCallCheck(this, Test);
woops["super"].test();
@@ -25,6 +27,7 @@ var Test = (function (Foo) {
Test.prototype.test = function test() {
var _Foo$prototype$test, _Foo$prototype$test2;
Foo.prototype.test.call(this);
(_Foo$prototype$test = Foo.prototype.test).call.apply(_Foo$prototype$test, [this].concat(_slice.call(arguments)));
(_Foo$prototype$test2 = Foo.prototype.test).call.apply(_Foo$prototype$test2, [this, "test"].concat(_slice.call(arguments)));
@@ -32,10 +35,11 @@ var Test = (function (Foo) {
Test.foo = function foo() {
var _Foo$foo, _Foo$foo2;
Foo.foo.call(this);
(_Foo$foo = Foo.foo).call.apply(_Foo$foo, [this].concat(_slice.call(arguments)));
(_Foo$foo2 = Foo.foo).call.apply(_Foo$foo2, [this, "test"].concat(_slice.call(arguments)));
};
return Test;
})(Foo);
})(Foo);

View File

@@ -1,6 +1,7 @@
"use strict";
var _slice = Array.prototype.slice;
var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };
var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
@@ -12,6 +13,7 @@ var _classCallCheck = function (instance, Constructor) { if (!(instance instance
var Test = (function (Foo) {
function Test() {
var _get2, _get3;
_classCallCheck(this, Test);
woops["super"].test();
@@ -31,6 +33,7 @@ var Test = (function (Foo) {
foo: {
value: function foo() {
var _get2;
_get(Object.getPrototypeOf(Test), "foo", this).call(this);
_get(Object.getPrototypeOf(Test), "foo", this).apply(this, arguments);
(_get2 = _get(Object.getPrototypeOf(Test), "foo", this)).call.apply(_get2, [this, "test"].concat(_slice.call(arguments)));
@@ -42,6 +45,7 @@ var Test = (function (Foo) {
test: {
value: function test() {
var _get2;
_get(Object.getPrototypeOf(Test.prototype), "test", this).call(this);
_get(Object.getPrototypeOf(Test.prototype), "test", this).apply(this, arguments);
(_get2 = _get(Object.getPrototypeOf(Test.prototype), "test", this)).call.apply(_get2, [this, "test"].concat(_slice.call(arguments)));
@@ -52,4 +56,4 @@ var Test = (function (Foo) {
});
return Test;
})(Foo);
})(Foo);

View File

@@ -1,18 +1,12 @@
"use strict";
var _ref = [1, 2];
var a = _ref[0];
var b = _ref[1];
var _ref2 = [3, 4];
var c = _ref2[0];
var d = _ref2[1];
var _ref3 = { e: 5, f: 6 };
var e = _ref3.e;
var f = _ref3.f;
var _ref4 = { a: 7, b: 8 };
var g = _ref4.a;
var h = _ref4.b;
var a = 1;
var b = 2;
var c = 3;
var d = 4;
var _ref = { e: 5, f: 6 };
var e = _ref.e;
var f = _ref.f;
var _ref2 = { a: 7, b: 8 };
var g = _ref2.a;
var h = _ref2.b;

View File

@@ -16,8 +16,11 @@ var b = _ref2[1];
var _ref3 = [1, 2, 3];
var a = _ref3[0];
var b = _ref3[1];
var items = _ref3.slice(2);
var _ref4 = [1, 2, 3];
var a = _ref4[0];
var b = _ref4[1];
var items = _ref4.slice(2);

View File

@@ -1,14 +1,7 @@
"use strict";
var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } };
var _ref = ["hello", [", ", "junk"], ["world"]];
var a = _ref[0];
var _ref$1 = _slicedToArray(_ref[1], 1);
var b = _ref$1[0];
var _ref$2 = _slicedToArray(_ref[2], 1);
var c = _ref$2[0];
var d = _ref[3];
var a = "hello";
var _ref = [", ", "junk"];
var b = _ref[0];
var c = "world";
var d;

View File

@@ -1,6 +1,7 @@
"use strict";
var _temp, _temp2;
var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } };
console.log((_temp = [123], _temp2 = _slicedToArray(_temp, 1), x = _temp2[0], _temp));

View File

@@ -8,4 +8,5 @@ var _ref2 = _slicedToArray(_ref, 2);
a = _ref2[0];
b = _ref2[1];
;

View File

@@ -3,11 +3,12 @@
var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } };
var _ref = ["foo", "hello", [", ", "junk"], ["world"]];
var a = _ref[1];
var _ref$2 = _slicedToArray(_ref[2], 1);
var b = _ref$2[0];
var _ref$3 = _slicedToArray(_ref[3], 1);
var c = _ref$3[0];

View File

@@ -5,9 +5,11 @@ var _objectWithoutProperties = function (obj, keys) { var target = {}; for (var
var x = _objectWithoutProperties(z, []);
var x = z.x;
var y = _objectWithoutProperties(z, ["x"]);
(function (_ref) {
var x = _ref.x;
var y = _objectWithoutProperties(_ref, ["x"]);
});
});

View File

@@ -7,5 +7,6 @@ for (var _ref in obj) {
var name = _ref2[0];
var value = _ref2[1];
print("Name: " + name + ", Value: " + value);
}

View File

@@ -5,4 +5,5 @@ var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr
var _z = _toArray(z);
var x = _z[0];
var y = _z.slice(1);

View File

@@ -8,4 +8,5 @@ var _ref2 = _slicedToArray(_ref, 2);
foo.foo = _ref2[0];
foo.bar = _ref2[1];
;

View File

@@ -6,6 +6,7 @@ var _rect$topLeft = _slicedToArray(rect.topLeft, 2);
var x1 = _rect$topLeft[0];
var y1 = _rect$topLeft[1];
var _rect$bottomRight = _slicedToArray(rect.bottomRight, 2);
var x2 = _rect$bottomRight[0];

View File

@@ -14,6 +14,7 @@ function somethingAdvanced(_ref) {
function unpackObject(_ref) {
var title = _ref.title;
var author = _ref.author;
return title + " " + author;
}
@@ -25,11 +26,13 @@ var unpackArray = function unpackArray(_ref, _ref3) {
var a = _ref2[0];
var b = _ref2[1];
var c = _ref2[2];
var _ref32 = _slicedToArray(_ref3, 3);
var x = _ref32[0];
var y = _ref32[1];
var z = _ref32[2];
return a + b + c;
};

View File

@@ -7,6 +7,7 @@ var isSorted = function (_ref) {
var x = _ref2[0];
var y = _ref2[1];
var wow = _ref2.slice(2);
if (!zs.length) return true;

View File

@@ -2,6 +2,7 @@
for (var _iterator = arr, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
@@ -10,5 +11,6 @@ for (var _iterator = arr, _isArray = Array.isArray(_iterator), _i = 0, _iterator
if (_i.done) break;
_ref = _i.value;
}
var i = _ref;
}
}

View File

@@ -2,6 +2,7 @@
for (var _iterator = arr, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
@@ -10,11 +11,13 @@ for (var _iterator = arr, _isArray = Array.isArray(_iterator), _i = 0, _iterator
if (_i.done) break;
_ref = _i.value;
}
var i = _ref;
}
for (var _iterator2 = numbers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
var _ref2;
if (_isArray2) {
if (_i2 >= _iterator2.length) break;
_ref2 = _iterator2[_i2++];
@@ -23,5 +26,6 @@ for (var _iterator2 = numbers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _
if (_i2.done) break;
_ref2 = _i2.value;
}
var i = _ref2;
}
}

View File

@@ -2,6 +2,7 @@
for (var _iterator = arr, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
@@ -10,5 +11,6 @@ for (var _iterator = arr, _isArray = Array.isArray(_iterator), _i = 0, _iterator
if (_i.done) break;
_ref = _i.value;
}
var i = _ref;
}
}

View File

@@ -8,6 +8,7 @@ define(["exports", "module"], function (exports, module) {
module.exports = {};
module.exports = [];
module.exports = foo;
module.exports = function () {};
var _default = function _default() {
@@ -16,9 +17,10 @@ define(["exports", "module"], function (exports, module) {
module.exports = _default;
function foo() {}
var Foo = function Foo() {
_classCallCheck(this, Foo);
};
module.exports = Foo;
});
});

View File

@@ -13,6 +13,7 @@ define(["exports"], function (exports) {
var foo5 = exports.foo5 = undefined;
var foo6 = exports.foo6 = 3;
function foo7() {}
var foo8 = exports.foo8 = function foo8() {
_classCallCheck(this, foo8);
};

View File

@@ -0,0 +1,3 @@
define("my custom module name", ["exports"], function (exports) {
"use strict";
});

View File

@@ -0,0 +1,5 @@
exports.getModuleName = function () {
return "my custom module name";
};
exports.moduleIds = true;

View File

@@ -7,6 +7,7 @@ module.exports = 42;
module.exports = {};
module.exports = [];
module.exports = foo;
module.exports = function () {};
var _default = function _default() {
@@ -15,8 +16,9 @@ var _default = function _default() {
module.exports = _default;
function foo() {}
var Foo = function Foo() {
_classCallCheck(this, Foo);
};
module.exports = Foo;
module.exports = Foo;

View File

@@ -12,6 +12,7 @@ var foo4 = exports.foo4 = 2;
var foo5 = exports.foo5 = undefined;
var foo6 = exports.foo6 = 3;
function foo7() {}
var foo8 = exports.foo8 = function foo8() {
_classCallCheck(this, foo8);
};

View File

@@ -1,7 +1,9 @@
"use strict";
exports.nextOdd = nextOdd;
var isEven = require("./evens").isEven;
function nextOdd(n) {
return isEven(n) ? n + 1 : n + 2;
}
@@ -13,4 +15,4 @@ var isOdd = exports.isOdd = (function (isEven) {
})(isEven);
Object.defineProperty(exports, "__esModule", {
value: true
});
});

View File

@@ -15,9 +15,11 @@ var foo = _interopRequire(require("foo2"));
var foo2 = _interopRequireWildcard(require("foo3"));
var bar = require("foo4").bar;
var bar2 = require("foo5").foo;
exports.test = test;
var test = exports.test = 5;
Object.defineProperty(exports, "__esModule", {
value: true
});
});

View File

@@ -7,6 +7,7 @@ var _default = function _default() {
};
function foo() {}
var Foo = function Foo() {
_classCallCheck(this, Foo);
};
};

View File

@@ -2,6 +2,7 @@ System.register([], function (_export) {
"use strict";
var _classCallCheck, _default, Foo;
_export("default", foo);
function foo() {}
@@ -33,4 +34,4 @@ System.register([], function (_export) {
_export("default", Foo);
}
};
});
});

View File

@@ -7,6 +7,7 @@ System.register([], function (_export) {
case 0:
context$1$0.next = 2;
return 1;
case 2:
case "end":
return context$1$0.stop();

View File

@@ -2,6 +2,7 @@ System.register([], function (_export) {
"use strict";
var _classCallCheck, foo, foo2, foo3, foo4, foo5, foo6, foo8;
_export("foo7", foo7);
function foo7() {}
@@ -19,6 +20,7 @@ System.register([], function (_export) {
foo8 = _export("foo8", function foo8() {
_classCallCheck(this, foo8);
});
_export("foo3", foo3 = 5);
}
};

View File

@@ -0,0 +1,8 @@
System.register("my custom module name", [], function (_export) {
"use strict";
return {
setters: [],
execute: function () {}
};
});

View File

@@ -0,0 +1,5 @@
exports.getModuleName = function () {
return "my custom module name";
};
exports.moduleIds = true;

View File

@@ -2,6 +2,7 @@ System.register(["./evens"], function (_export) {
"use strict";
var isEven, p, isOdd;
_export("nextOdd", nextOdd);
function nextOdd(n) {

View File

@@ -13,6 +13,7 @@ System.register(["foo", "foo-bar", "./directory/foo-bar"], function (_export) {
_export("test", test);
test2 = _export("test2", 5);
_export("default", test);
}
};

View File

@@ -6,6 +6,7 @@ System.register([], function (_export) {
setters: [],
execute: function () {
test = _export("test", 2);
_export("test", test = 5);
_export("test", test += 1);

View File

@@ -14,6 +14,7 @@
module.exports = {};
module.exports = [];
module.exports = foo;
module.exports = function () {};
var _default = function _default() {
@@ -22,9 +23,10 @@
module.exports = _default;
function foo() {}
var Foo = function Foo() {
_classCallCheck(this, Foo);
};
module.exports = Foo;
});
});

View File

@@ -19,6 +19,7 @@
var foo5 = exports.foo5 = undefined;
var foo6 = exports.foo6 = 3;
function foo7() {}
var foo8 = exports.foo8 = function foo8() {
_classCallCheck(this, foo8);
};

View File

@@ -0,0 +1,9 @@
(function (factory) {
if (typeof define === "function" && define.amd) {
define("my custom module name", ["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
}
})(function (exports) {
"use strict";
});

View File

@@ -0,0 +1,5 @@
exports.getModuleName = function () {
return "my custom module name";
};
exports.moduleIds = true;

View File

@@ -21,4 +21,4 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
});
});

View File

@@ -1,12 +1,14 @@
"use strict";
var t = function () {
var t = function t() {
var t = arguments[0] === undefined ? "foo" : arguments[0];
var f = arguments[1] === undefined ? 5 : arguments[1];
return t + " bar " + f;
};
var a = function (t) {
var a = function a(t) {
var f = arguments[1] === undefined ? 5 : arguments[1];
return t + " bar " + f;
};

View File

@@ -1,6 +1,7 @@
"use strict";
var t = function () {
var t = function t() {
var t = arguments[0] === undefined ? "foo" : arguments[0];
return t + " bar";
};

View File

@@ -5,7 +5,6 @@ var foo = function foo() {
_ref[_key] = arguments[_key];
}
var _ref2 = _ref;
var a = _ref2[0];
var b = _ref2[1];
var a = _ref[0];
var b = _ref[1];
};

View File

@@ -2,7 +2,6 @@
foo((function () {
var _foo = {};
_foo[bar] = "foobar";
return _foo;
})());
})());

View File

@@ -2,7 +2,6 @@
foo = (function () {
var _foo = {};
_foo[bar] = "foobar";
return _foo;
})();
})();

View File

@@ -2,7 +2,6 @@
var foo = (function () {
var _foo = {};
_foo[Symbol.iterator] = "foobar";
return _foo;
})();

View File

@@ -8,4 +8,4 @@ var obj = (function () {
};
return _obj;
})();
})();

View File

@@ -2,10 +2,9 @@
var obj = (function () {
var _obj = {};
_obj["x" + foo] = "heh";
_obj["y" + bar] = "noo";
_obj.foo = "foo";
_obj.bar = "bar";
return _obj;
})();
})();

View File

@@ -2,8 +2,7 @@
var obj = (function () {
var _obj = {};
_obj["x" + foo] = "heh";
_obj["y" + bar] = "noo";
return _obj;
})();
})();

View File

@@ -2,7 +2,6 @@
var obj = (function () {
var _obj = {};
_obj["x" + foo] = "heh";
return _obj;
})();
})();

View File

@@ -2,7 +2,6 @@
var obj = (function () {
var _obj = {};
_obj["x" + foo.bar] = "heh";
return _obj;
})();

View File

@@ -2,7 +2,6 @@
var obj = (function () {
var _obj = {};
_obj.first = "first";
_obj.second = "second";
return _obj;

View File

@@ -2,7 +2,6 @@
var foo = (function () {
var _foo = {};
_foo[bar] = "foobar";
return _foo;
})();

View File

@@ -2,7 +2,6 @@
var foo = (function () {
var _foo = {};
_foo[Symbol.iterator] = "foobar";
return _foo;
})();

View File

@@ -1,19 +1,15 @@
"use strict";
var bar = {
foo: (function (_foo) {
var _fooWrapper = function foo() {
return _foo.apply(this, arguments);
};
foo: (function () {
function _getOuter() {
return foo;
}
_fooWrapper.toString = function () {
return _foo.toString();
return function foo() {
console.log(_getOuter());
};
return _fooWrapper;
})(function () {
console.log(foo);
})
})()
};
var bar = {
@@ -25,17 +21,13 @@ var bar = {
var foobar = 123;
var foobar2 = {
foobar: (function (_foobar) {
var _foobarWrapper = function foobar() {
return _foobar.apply(this, arguments);
};
foobar: (function () {
function _getOuter() {
return foobar;
}
_foobarWrapper.toString = function () {
return _foobar.toString();
return function foobar() {
console.log(_getOuter());
};
return _foobarWrapper;
})(function () {
console.log(foobar);
})
})()
};

View File

@@ -1,6 +1,7 @@
"use strict";
var _obj;
var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } };
(_obj = obj)[method].apply(_obj, [foo, bar].concat(_toConsumableArray(args)));

View File

@@ -1,6 +1,7 @@
"use strict";
var _obj;
var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } };
(_obj = obj)[method].apply(_obj, _toConsumableArray(args));

View File

@@ -1,6 +1,7 @@
"use strict";
var _foob, _foob$test;
var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } };
(_foob = foob).add.apply(_foob, [foo, bar].concat(_toConsumableArray(numbers)));

View File

@@ -1,6 +1,7 @@
"use strict";
var _foob, _foob$test;
var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } };
(_foob = foob).add.apply(_foob, _toConsumableArray(numbers));

View File

@@ -3,5 +3,6 @@
console.log(this, arguments);
return "foo";
}
return Math.random() > 0.5 ? f.call(this, n - 1) : f.apply(this, [n - 1]);
})(1e6) === "foo";

View File

@@ -3,12 +3,15 @@
(function f(_x) {
var _this = this,
_arguments = arguments;
_function: while (true) {
var n = _x;
if (n <= 0) {
console.log(_this, _arguments);
return "foo";
}
if (Math.random() > 0.5) {
_arguments = [_x = n - 1];
continue _function;

View File

@@ -2,6 +2,7 @@
(function f(_x) {
var _left;
_function: while (true) {
var n = _x;
if (n <= 0) {
@@ -12,9 +13,11 @@
if (!(_left = getTrueValue())) {
return _left;
}
if (_left = getFalseValue()) {
return _left;
}
_x = n - 1;
continue _function;
}return;

View File

@@ -1,16 +1,17 @@
"use strict";
function fact(_x2) {
var _arguments = arguments;
_function: while (true) {
var n = _x2;
acc = undefined;
var acc = _arguments[1] === undefined ? 1 : _arguments[1];
if (n > 1) {
_arguments = [_x2 = n - 1, acc * n];
continue _function;
} else {
return acc;
}return;
}
}
"use strict";
function fact(_x2) {
var _arguments = arguments;
_function: while (true) {
var n = _x2;
acc = undefined;
var acc = _arguments[1] === undefined ? 1 : _arguments[1];
if (n > 1) {
_arguments = [_x2 = n - 1, acc * n];
continue _function;
} else {
return acc;
}return;
}
}

View File

@@ -2,12 +2,14 @@
(function f(_x2) {
var _arguments = arguments;
_function: while (true) {
var g = function g() {};
var n = _x2;
m = local1 = local2 = local3 = undefined;
var m = _arguments[1] === undefined ? getDefaultValue() : _arguments[1];
// `m` should be `getDefaultValue()` after first pass
if (n <= 0) {
return "foo";

View File

@@ -2,6 +2,7 @@
if (n <= 0) {
return "foo";
}
try {
return f(n - 1);
} catch (e) {}
@@ -11,6 +12,7 @@
if (n <= 0) {
return "foo";
}
try {
throw new Error();
} catch (e) {
@@ -22,6 +24,7 @@
if (n <= 0) {
return "foo";
}
try {
throw new Error();
} catch (e) {
@@ -33,6 +36,7 @@
if (n <= 0) {
return "foo";
}
try {} finally {
return f(n - 1);
}

View File

@@ -4,6 +4,7 @@
if (n <= 0) {
return "foo";
}
try {
return f(n - 1);
} catch (e) {}
@@ -12,9 +13,11 @@
(function f(_x) {
_function: while (true) {
var n = _x;
if (n <= 0) {
return "foo";
}
try {
throw new Error();
} catch (e) {
@@ -29,6 +32,7 @@
if (n <= 0) {
return "foo";
}
try {
throw new Error();
} catch (e) {
@@ -39,9 +43,11 @@
(function f(_x) {
_function: while (true) {
var n = _x;
if (n <= 0) {
return "foo";
}
try {} finally {
_x = n - 1;
continue _function;

View File

@@ -1,6 +1,7 @@
"use strict";
var _foo, _foo2;
_foo = foo, bar[Symbol.referenceGet](_foo).call(_foo);
_foo2 = foo, bar[Symbol.referenceGet](_foo2).call(_foo2, "arg");

View File

@@ -5,10 +5,12 @@ var _classCallCheck = function (instance, Constructor) { if (!(instance instance
var A = new WeakMap();
var B = new WeakMap(),
C = new WeakMap();
var D = (function () {
var F = new WeakMap(),
G = new WeakMap();
var E = new WeakMap();
function D() {
_classCallCheck(this, D);
}
@@ -20,9 +22,10 @@ var H = (function () {
var J = new WeakMap(),
K = new WeakMap();
var I = new WeakMap();
function H() {
_classCallCheck(this, H);
}
return H;
})();
})();

View File

@@ -2,11 +2,13 @@
function add() {
var _arguments = arguments;
return (function () {
var _ref = [];
for (var _iterator = [1, 2, 3][Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
var i = _step.value;
_ref.push(i * _arguments[0]);
}

View File

@@ -5,6 +5,7 @@ var arr = (function () {
for (var _iterator = [1, 2, 3][Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
var i = _step.value;
if (i > 1) {
_arr.push(i * i);
}

View File

@@ -5,6 +5,7 @@ var arr = (function () {
for (var _iterator = [1, 2, 3][Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
var i = _step.value;
_arr.push(i * i);
}

View File

@@ -5,8 +5,10 @@ var seattlers = (function () {
for (var _iterator = countries[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
var customers = _step.value;
for (var _iterator2 = customers[Symbol.iterator](), _step2; !(_step2 = _iterator2.next()).done;) {
var c = _step2.value;
if (c.city == "Seattle") {
_seattlers.push({ name: c.name, age: c.age });
}

View File

@@ -5,8 +5,10 @@ var arr = (function () {
for (var _iterator = "abcdefgh".split("")[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
var x = _step.value;
for (var _iterator2 = "12345678".split("")[Symbol.iterator](), _step2; !(_step2 = _iterator2.next()).done;) {
var y = _step2.value;
_arr.push(x + y);
}
}

View File

@@ -5,6 +5,7 @@ var arr = (function () {
for (var _iterator = nums[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
var i = _step.value;
if (i > 1) {
_arr.push(i * i);
}

View File

@@ -5,6 +5,7 @@ var arr = (function () {
for (var _iterator = nums[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
var i = _step.value;
_arr.push(i * i);
}

View File

@@ -2,11 +2,13 @@
function add() {
var _this = this;
return (function () {
var _ref = [];
for (var _iterator = [1, 2, 3][Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
var i = _step.value;
_ref.push(i * _this.multiplier);
}

View File

@@ -1,4 +1,5 @@
"use strict";
num = Math.pow(num, 2);
;

View File

@@ -1,6 +1,7 @@
"use strict";
var _obj, _obj2, _obj$foo, _obj$foo2, _obj$foo3, _args, _args2, _args3;
var fn = (_obj = obj, _obj.method.bind(_obj));
var fn = (_obj2 = obj, _obj2.method.bind(_obj2, "foob"));
var fn = (_obj$foo = obj[foo], _obj$foo.method.bind(_obj$foo));

View File

@@ -1,5 +1,6 @@
var foo = function foo() {
var _this = this;
return function () {
return React.createElement(_this, null);
};
@@ -7,6 +8,7 @@ var foo = function foo() {
var bar = function bar() {
var _this = this;
return function () {
return React.createElement(_this.foo, null);
};

View File

@@ -1,6 +1,7 @@
var Component;
Component = React.createClass({
displayName: "Component",
render: function render() {
return null;
}

View File

@@ -1,5 +1,6 @@
module.exports = React.createClass({
displayName: "actual",
render: function render() {
return null;
}

View File

@@ -1,6 +1,7 @@
exports = {
Component: React.createClass({
displayName: "Component",
render: function render() {
return null;
}

View File

@@ -1,5 +1,6 @@
exports.Component = React.createClass({
displayName: "Component",
render: function render() {
return null;
}

View File

@@ -1,5 +1,6 @@
var Component = React.createClass({
displayName: "Component",
render: function render() {
return null;
}

View File

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

View File

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

View File

@@ -1,11 +1,13 @@
"use strict";
var _core = require("babel-runtime/core-js")["default"];
var arr = (function () {
var _arr = [];
for (var _iterator = _core.$for.getIterator(nums), _step; !(_step = _iterator.next()).done;) {
var i = _step.value;
_arr.push(i * i);
}

View File

@@ -1,14 +1,18 @@
"use strict";
var _core = require("babel-runtime/core-js")["default"];
var _regeneratorRuntime = require("babel-runtime/regenerator")["default"];
var _babelHelpers = require("babel-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) {
case 0:
context$1$0.next = 2;
return myWord;
case 2:
case "end":
return context$1$0.stop();
@@ -17,6 +21,7 @@ var giveWord = _regeneratorRuntime.mark(function giveWord() {
});
exports.giveWord = giveWord;
var _someModule = require("someModule");
var foo = _babelHelpers.interopRequire(_someModule);

View File

@@ -2,5 +2,6 @@ define(["exports", "foo", "babel-runtime/helpers"], function (exports, _foo, _ba
"use strict";
var _babelHelpers = _babelRuntimeHelpers["default"];
var foo = _babelHelpers.interopRequire(_foo);
});

View File

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

Some files were not shown because too many files have changed in this diff Show More