Merge branch 'scoped-es6-runtime' of https://github.com/AluisioASG/6to5 into AluisioASG-scoped-es6-runtime
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequire = function (obj) {
|
||||
return obj && (obj["default"] || obj);
|
||||
};
|
||||
|
||||
var _bluebird = _interopRequire(require("bluebird"));
|
||||
var _bluebird = require("bluebird");
|
||||
|
||||
var foo = _bluebird.coroutine(function* () {
|
||||
var wat = yield bar();
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequire = function (obj) {
|
||||
return obj && (obj["default"] || obj);
|
||||
};
|
||||
|
||||
var _bluebird = _interopRequire(require("bluebird"));
|
||||
var _bluebird = require("bluebird");
|
||||
|
||||
var foo = _bluebird.coroutine(function* foo() {
|
||||
var wat = yield bar();
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequire = function (obj) {
|
||||
return obj && (obj["default"] || obj);
|
||||
};
|
||||
|
||||
var _core = _interopRequire(require("core-js/library"));
|
||||
|
||||
obj.constructor === Object;
|
||||
obj.constructor === _core.Promise;
|
||||
|
||||
_core.Symbol();
|
||||
_core.Symbol("test");
|
||||
|
||||
new _core.Map();
|
||||
@@ -1 +0,0 @@
|
||||
var [a, [b], [c], d] = ["hello", [", ", "junk"], ["world"]];
|
||||
@@ -1,34 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
var _slicedToArray = function (arr, i) {
|
||||
if (Array.isArray(arr)) {
|
||||
return arr;
|
||||
} else {
|
||||
var _arr = [];
|
||||
|
||||
for (var _iterator = _core.$for.getIterator(arr), _step; !(_step = _iterator.next()).done;) {
|
||||
_arr.push(_step.value);
|
||||
|
||||
if (i && _arr.length === i) break;
|
||||
}
|
||||
|
||||
return _arr;
|
||||
}
|
||||
};
|
||||
|
||||
var _interopRequire = function (obj) {
|
||||
return obj && (obj["default"] || obj);
|
||||
};
|
||||
|
||||
var _core = _interopRequire(require("core-js/library"));
|
||||
|
||||
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];
|
||||
@@ -1,11 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequire = function (obj) {
|
||||
return obj && (obj["default"] || obj);
|
||||
};
|
||||
|
||||
var _core = _interopRequire(require("core-js/library"));
|
||||
|
||||
for (var _iterator = _core.$for.getIterator(arr), _step; !(_step = _iterator.next()).done;) {
|
||||
var i = _step.value;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
var lyrics = ["head", "and", "toes", ...parts];
|
||||
@@ -1,13 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
var _toArray = function (arr) {
|
||||
return Array.isArray(arr) ? arr : _core.Array.from(arr);
|
||||
};
|
||||
|
||||
var _interopRequire = function (obj) {
|
||||
return obj && (obj["default"] || obj);
|
||||
};
|
||||
|
||||
var _core = _interopRequire(require("core-js/library"));
|
||||
|
||||
var lyrics = ["head", "and", "toes"].concat(_toArray(parts));
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"optional": ["coreAliasing"],
|
||||
"experimental": true
|
||||
}
|
||||
15
test/fixtures/transformation/optional-self-contained/aliased-constructors/expected.js
vendored
Normal file
15
test/fixtures/transformation/optional-self-contained/aliased-constructors/expected.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
var _to5Runtime = require("6to5-runtime/helpers");
|
||||
|
||||
var _core = require("6to5-runtime/core-js");
|
||||
|
||||
var _regeneratorRuntime = require("6to5-runtime/regenerator");
|
||||
|
||||
obj.constructor === Object;
|
||||
obj.constructor === _core.Promise;
|
||||
|
||||
_core.Symbol();
|
||||
_core.Symbol("test");
|
||||
|
||||
new _core.Map();
|
||||
11
test/fixtures/transformation/optional-self-contained/es6-for-of/expected.js
vendored
Normal file
11
test/fixtures/transformation/optional-self-contained/es6-for-of/expected.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
var _to5Runtime = require("6to5-runtime/helpers");
|
||||
|
||||
var _core = require("6to5-runtime/core-js");
|
||||
|
||||
var _regeneratorRuntime = require("6to5-runtime/regenerator");
|
||||
|
||||
for (var _iterator = _core.$for.getIterator(arr), _step; !(_step = _iterator.next()).done;) {
|
||||
var i = _step.value;
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequire = function (obj) {
|
||||
return obj && (obj["default"] || obj);
|
||||
};
|
||||
var _to5Runtime = require("6to5-runtime/helpers");
|
||||
|
||||
var _core = _interopRequire(require("core-js/library"));
|
||||
var _core = require("6to5-runtime/core-js");
|
||||
|
||||
var _regeneratorRuntime = require("6to5-runtime/regenerator");
|
||||
|
||||
var arr = (function () {
|
||||
var _arr = [];
|
||||
6
test/fixtures/transformation/optional-self-contained/full/actual.js
vendored
Normal file
6
test/fixtures/transformation/optional-self-contained/full/actual.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import foo, * as bar from "someModule";
|
||||
|
||||
export const myWord = Symbol("abc");
|
||||
export function* giveWord () {
|
||||
yield myWord;
|
||||
}
|
||||
27
test/fixtures/transformation/optional-self-contained/full/expected.js
vendored
Normal file
27
test/fixtures/transformation/optional-self-contained/full/expected.js
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
|
||||
var _to5Runtime = require("6to5-runtime/helpers");
|
||||
|
||||
var _core = require("6to5-runtime/core-js");
|
||||
|
||||
var _regeneratorRuntime = require("6to5-runtime/regenerator");
|
||||
|
||||
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();
|
||||
}
|
||||
}, giveWord, this);
|
||||
});
|
||||
|
||||
exports.giveWord = giveWord;
|
||||
var foo = _to5Runtime.interopRequire(require("someModule"));
|
||||
|
||||
var bar = _to5Runtime.interopRequireWildcard(require("someModule"));
|
||||
|
||||
var myWord = exports.myWord = _core.Symbol("abc");
|
||||
4
test/fixtures/transformation/optional-self-contained/options.json
vendored
Normal file
4
test/fixtures/transformation/optional-self-contained/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"optional": ["selfContained"],
|
||||
"experimental": true
|
||||
}
|
||||
2
test/fixtures/transformation/optional-self-contained/regenerator-runtime/actual.js
vendored
Normal file
2
test/fixtures/transformation/optional-self-contained/regenerator-runtime/actual.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
void function* () {
|
||||
};
|
||||
17
test/fixtures/transformation/optional-self-contained/regenerator-runtime/expected.js
vendored
Normal file
17
test/fixtures/transformation/optional-self-contained/regenerator-runtime/expected.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
|
||||
var _to5Runtime = require("6to5-runtime/helpers");
|
||||
|
||||
var _core = require("6to5-runtime/core-js");
|
||||
|
||||
var _regeneratorRuntime = require("6to5-runtime/regenerator");
|
||||
|
||||
void _regeneratorRuntime.mark(function callee$0$0() {
|
||||
return _regeneratorRuntime.wrap(function callee$0$0$(context$1$0) {
|
||||
while (1) switch (context$1$0.prev = context$1$0.next) {
|
||||
case 0:
|
||||
case "end":
|
||||
return context$1$0.stop();
|
||||
}
|
||||
}, callee$0$0, this);
|
||||
});
|
||||
1
test/fixtures/transformation/optional-self-contained/runtime-amd/actual.js
vendored
Normal file
1
test/fixtures/transformation/optional-self-contained/runtime-amd/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import foo from "someModule";
|
||||
5
test/fixtures/transformation/optional-self-contained/runtime-amd/expected.js
vendored
Normal file
5
test/fixtures/transformation/optional-self-contained/runtime-amd/expected.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
define(["exports", "6to5-runtime/helpers", "6to5-runtime/core-js", "6to5-runtime/regenerator", "someModule"], function (exports, _to5Runtime, _core, _regeneratorRuntime, _someModule) {
|
||||
"use strict";
|
||||
|
||||
var foo = _to5Runtime.interopRequire(_someModule);
|
||||
});
|
||||
3
test/fixtures/transformation/optional-self-contained/runtime-amd/options.json
vendored
Normal file
3
test/fixtures/transformation/optional-self-contained/runtime-amd/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"modules": "amd"
|
||||
}
|
||||
1
test/fixtures/transformation/optional-self-contained/runtime-commonjs/actual.js
vendored
Normal file
1
test/fixtures/transformation/optional-self-contained/runtime-commonjs/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import * as foo from "someModule";
|
||||
9
test/fixtures/transformation/optional-self-contained/runtime-commonjs/expected.js
vendored
Normal file
9
test/fixtures/transformation/optional-self-contained/runtime-commonjs/expected.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var _to5Runtime = require("6to5-runtime/helpers");
|
||||
|
||||
var _core = require("6to5-runtime/core-js");
|
||||
|
||||
var _regeneratorRuntime = require("6to5-runtime/regenerator");
|
||||
|
||||
var foo = _to5Runtime.interopRequireWildcard(require("someModule"));
|
||||
Reference in New Issue
Block a user