Update @babel/helper-wrap-function templates (#6984)

This commit introduces 4 changes:

1) Function declarations are wrapped using function declarations.
   This has two advantages:
    - We can rely on native hoisting, instead of using _blockHoist
    - The function isn't wrapped until it is called. This avoids
      problems where `regeneratorRuntime.wrap` was called before
      that `babel-polyfill` was imported.

   Example:
     function fn() {}
     // becomes
     function fn() { return _fn.apply(this, arguments); }
     function _fn() {
       _fn = _wrapper(/* Original function ... */);
       return _fn.apply(this, arguments);
     }

2) Use a single template for both named and anonymous function
   expressions. They already had the same behavior, but the one
   used for named functions was a bit longer.

3) Use normal functions instead of arrow functions to wrap
   function expressions.

4) Generate a name based on the original one for wrapped
   functions (e.g. `foo` becomes `_foo` instead of `_ref`).
This commit is contained in:
Nicolò Ribaudo 2017-12-13 16:21:58 +01:00 committed by GitHub
parent 9cc0a26694
commit 05b22d2597
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 546 additions and 611 deletions

View File

@ -5,54 +5,6 @@ Object.defineProperty(exports, "__esModule", {
}); });
exports.default = void 0; exports.default = void 0;
var foo =
/*#__PURE__*/
function () {
var _ref2 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee3() {
var bar =
/*#__PURE__*/
function () {
var _ref3 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2() {
var baz;
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
baz = {};
case 1:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
return function bar() {
return _ref3.apply(this, arguments);
};
}();
return regeneratorRuntime.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
case "end":
return _context3.stop();
}
}
}, _callee3, this);
}));
return function foo() {
return _ref2.apply(this, arguments);
};
}();
function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } } function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; }
@ -73,7 +25,7 @@ function () {
_createClass(Foo, [{ _createClass(Foo, [{
key: "bar", key: "bar",
value: function () { value: function () {
var _ref = _asyncToGenerator( var _bar = _asyncToGenerator(
/*#__PURE__*/ /*#__PURE__*/
regeneratorRuntime.mark(function _callee() { regeneratorRuntime.mark(function _callee() {
var baz; var baz;
@ -91,11 +43,9 @@ function () {
}, _callee, this); }, _callee, this);
})); }));
function bar() { return function bar() {
return _ref.apply(this, arguments); return _bar.apply(this, arguments);
} };
return bar;
}() }()
}]); }]);
@ -103,3 +53,52 @@ function () {
}(); }();
exports.default = Foo; exports.default = Foo;
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
_foo = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee3() {
var bar, _bar2;
return regeneratorRuntime.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
_bar2 = function _bar2() {
_bar2 = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee2() {
var baz;
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
baz = {};
case 1:
case "end":
return _context2.stop();
}
}
}, _callee2, this);
}));
return _bar2.apply(this, arguments);
};
bar = function bar() {
return _bar2.apply(this, arguments);
};
case 2:
case "end":
return _context3.stop();
}
}
}, _callee3, this);
}));
return _foo.apply(this, arguments);
}

View File

@ -81,9 +81,7 @@ export default function(path: NodePath, file: Object, helpers: Object) {
path.parentPath.isObjectProperty() || path.parentPath.isObjectProperty() ||
path.parentPath.isClassProperty(); path.parentPath.isClassProperty();
if (!isProperty && !isIIFE) { if (!isProperty && !isIIFE && path.isExpression()) {
annotateAsPure( annotateAsPure(path);
path.isDeclaration() ? path.get("declarations.0.init") : path,
);
} }
} }

View File

@ -3,23 +3,21 @@ import nameFunction from "@babel/helper-function-name";
import template from "@babel/template"; import template from "@babel/template";
import * as t from "@babel/types"; import * as t from "@babel/types";
const buildWrapper = template(` const buildExpressionWrapper = template.expression(`
(() => { (function () {
var REF = FUNCTION; var REF = FUNCTION;
return function NAME(PARAMS) { return function NAME(PARAMS) {
return REF.apply(this, arguments); return REF.apply(this, arguments);
}; };
}) })()
`); `);
const namedBuildWrapper = template(` const buildDeclarationWrapper = template(`
(() => { function NAME(PARAMS) { return REF.apply(this, arguments); }
var REF = FUNCTION; function REF() {
function NAME(PARAMS) { REF = FUNCTION;
return REF.apply(this, arguments); return REF.apply(this, arguments);
} }
return NAME;
})
`); `);
function classOrObjectMethod(path: NodePath, callId: Object) { function classOrObjectMethod(path: NodePath, callId: Object) {
@ -53,12 +51,12 @@ function plainFunction(path: NodePath, callId: Object) {
const node = path.node; const node = path.node;
const isDeclaration = path.isFunctionDeclaration(); const isDeclaration = path.isFunctionDeclaration();
const functionId = node.id; const functionId = node.id;
let wrapper = buildWrapper; const wrapper = isDeclaration
? buildDeclarationWrapper
: buildExpressionWrapper;
if (path.isArrowFunctionExpression()) { if (path.isArrowFunctionExpression()) {
path.arrowFunctionToExpression(); path.arrowFunctionToExpression();
} else if (!isDeclaration && functionId) {
wrapper = namedBuildWrapper;
} }
node.id = null; node.id = null;
@ -70,7 +68,7 @@ function plainFunction(path: NodePath, callId: Object) {
const built = t.callExpression(callId, [node]); const built = t.callExpression(callId, [node]);
const container = wrapper({ const container = wrapper({
NAME: functionId || null, NAME: functionId || null,
REF: path.scope.generateUidIdentifier("ref"), REF: path.scope.generateUidIdentifier(functionId ? functionId.name : "ref"),
FUNCTION: built, FUNCTION: built,
PARAMS: node.params.reduce( PARAMS: node.params.reduce(
(acc, param) => { (acc, param) => {
@ -88,35 +86,16 @@ function plainFunction(path: NodePath, callId: Object) {
done: false, done: false,
}, },
).params, ).params,
}).expression; });
if (isDeclaration && functionId) { if (isDeclaration) {
const declar = t.variableDeclaration("let", [ const basePath = path.parentPath.isExportDeclaration()
t.variableDeclarator( ? path.parentPath
t.identifier(functionId.name), : path;
t.callExpression(container, []), basePath.insertAfter(container[1]);
), path.replaceWith(container[0]);
]);
(declar: any)._blockHoist = true;
if (path.parentPath.isExportDefaultDeclaration()) {
// change the path type so that replaceWith() does not wrap
// the identifier into an expressionStatement
path.parentPath.insertBefore(declar);
path.parentPath.replaceWith(
t.exportNamedDeclaration(null, [
t.exportSpecifier(
t.identifier(functionId.name),
t.identifier("default"),
),
]),
);
return;
}
path.replaceWith(declar);
} else { } else {
const retFunction = container.body.body[1].argument; const retFunction = container.callee.body.body[1].argument;
if (!functionId) { if (!functionId) {
nameFunction({ nameFunction({
node: retFunction, node: retFunction,
@ -127,7 +106,7 @@ function plainFunction(path: NodePath, callId: Object) {
if (!retFunction || retFunction.id || node.params.length) { if (!retFunction || retFunction.id || node.params.length) {
// we have an inferred function id or params so we need this wrapper // we have an inferred function id or params so we need this wrapper
path.replaceWith(t.callExpression(container, [])); path.replaceWith(container);
} else { } else {
// we can omit this wrapper as the conditions it protects for do not apply // we can omit this wrapper as the conditions it protects for do not apply
path.replaceWith(built); path.replaceWith(built);

View File

@ -1,14 +1,13 @@
let agf = function agf() {
/*#__PURE__*/ return _agf.apply(this, arguments);
(() => { }
var _ref = babelHelpers.wrapAsyncGenerator(function* () {
function _agf() {
_agf = babelHelpers.wrapAsyncGenerator(function* () {
this; this;
yield babelHelpers.awaitAsyncGenerator(1); yield babelHelpers.awaitAsyncGenerator(1);
yield 2; yield 2;
return 3; return 3;
}); });
return _agf.apply(this, arguments);
return function agf() { }
return _ref.apply(this, arguments);
};
})();

View File

@ -1,15 +1,13 @@
/*#__PURE__*/ /*#__PURE__*/
(() => { (function () {
var _ref = babelHelpers.wrapAsyncGenerator(function* () { var _agf = babelHelpers.wrapAsyncGenerator(function* () {
this; this;
yield babelHelpers.awaitAsyncGenerator(1); yield babelHelpers.awaitAsyncGenerator(1);
yield 2; yield 2;
return 3; return 3;
}); });
function agf() { return function agf() {
return _ref.apply(this, arguments); return _agf.apply(this, arguments);
} };
return agf;
})(); })();

View File

@ -1,12 +1,11 @@
let g = function g() {
/*#__PURE__*/ return _g.apply(this, arguments);
(() => { }
var _ref = babelHelpers.wrapAsyncGenerator(function* () {
function _g() {
_g = babelHelpers.wrapAsyncGenerator(function* () {
yield* babelHelpers.asyncGeneratorDelegate(babelHelpers.asyncIterator([1, 2, 3]), babelHelpers.awaitAsyncGenerator); yield* babelHelpers.asyncGeneratorDelegate(babelHelpers.asyncIterator([1, 2, 3]), babelHelpers.awaitAsyncGenerator);
yield* babelHelpers.asyncGeneratorDelegate(babelHelpers.asyncIterator(iterable), babelHelpers.awaitAsyncGenerator); yield* babelHelpers.asyncGeneratorDelegate(babelHelpers.asyncIterator(iterable), babelHelpers.awaitAsyncGenerator);
}); });
return _g.apply(this, arguments);
return function g() { }
return _ref.apply(this, arguments);
};
})();

View File

@ -1,7 +1,9 @@
let f = function f() {
/*#__PURE__*/ return _f.apply(this, arguments);
(() => { }
var _ref = babelHelpers.asyncToGenerator(function* () {
function _f() {
_f = babelHelpers.asyncToGenerator(function* () {
var _iteratorNormalCompletion = true; var _iteratorNormalCompletion = true;
var _didIteratorError = false; var _didIteratorError = false;
@ -27,8 +29,5 @@ let f =
} }
} }
}); });
return _f.apply(this, arguments);
return function f() { }
return _ref.apply(this, arguments);
};
})();

View File

@ -1,7 +1,9 @@
let g = function g() {
/*#__PURE__*/ return _g.apply(this, arguments);
(() => { }
var _ref = babelHelpers.wrapAsyncGenerator(function* () {
function _g() {
_g = babelHelpers.wrapAsyncGenerator(function* () {
var _iteratorNormalCompletion = true; var _iteratorNormalCompletion = true;
var _didIteratorError = false; var _didIteratorError = false;
@ -27,8 +29,5 @@ let g =
} }
} }
}); });
return _g.apply(this, arguments);
return function g() { }
return _ref.apply(this, arguments);
};
})();

View File

@ -1,7 +1,9 @@
let f = function f() {
/*#__PURE__*/ return _f.apply(this, arguments);
(() => { }
var _ref = babelHelpers.asyncToGenerator(function* () {
function _f() {
_f = babelHelpers.asyncToGenerator(function* () {
var _iteratorNormalCompletion = true; var _iteratorNormalCompletion = true;
var _didIteratorError = false; var _didIteratorError = false;
@ -30,8 +32,5 @@ let f =
} }
} }
}); });
return _f.apply(this, arguments);
return function f() { }
return _ref.apply(this, arguments);
};
})();

View File

@ -1,7 +1,9 @@
let g = function g() {
/*#__PURE__*/ return _g.apply(this, arguments);
(() => { }
var _ref = babelHelpers.wrapAsyncGenerator(function* () {
function _g() {
_g = babelHelpers.wrapAsyncGenerator(function* () {
var _this = this; var _this = this;
() => this; () => this;
@ -17,8 +19,5 @@ let g =
}); });
yield babelHelpers.awaitAsyncGenerator(1); yield babelHelpers.awaitAsyncGenerator(1);
}); });
return _g.apply(this, arguments);
return function g() { }
return _ref.apply(this, arguments);
};
})();

View File

@ -1,7 +1,9 @@
let g = function g() {
/*#__PURE__*/ return _g.apply(this, arguments);
(() => { }
var _ref = babelHelpers.wrapAsyncGenerator(function* (x =
function _g() {
_g = babelHelpers.wrapAsyncGenerator(function* (x =
/*#__PURE__*/ /*#__PURE__*/
babelHelpers.asyncToGenerator(function* () { babelHelpers.asyncToGenerator(function* () {
yield 1; yield 1;
@ -9,8 +11,5 @@ let g =
yield babelHelpers.awaitAsyncGenerator(2); yield babelHelpers.awaitAsyncGenerator(2);
yield 3; yield 3;
}); });
return _g.apply(this, arguments);
return function g() { }
return _ref.apply(this, arguments);
};
})();

View File

@ -1,24 +1,22 @@
let f = function f() {
/*#__PURE__*/ return _f.apply(this, arguments);
(() => { }
var _ref = babelHelpers.asyncToGenerator(function* () {
let g = function _f() {
/*#__PURE__*/ _f = babelHelpers.asyncToGenerator(function* () {
(() => { yield 1;
var _ref2 = babelHelpers.wrapAsyncGenerator(function* () {
function g() {
return _g.apply(this, arguments);
}
function _g() {
_g = babelHelpers.wrapAsyncGenerator(function* () {
yield babelHelpers.awaitAsyncGenerator(2); yield babelHelpers.awaitAsyncGenerator(2);
yield 3; yield 3;
}); });
return _g.apply(this, arguments);
return function g() { }
return _ref2.apply(this, arguments);
};
})();
yield 1;
}); });
return _f.apply(this, arguments);
return function f() { }
return _ref.apply(this, arguments);
};
})();

View File

@ -6,7 +6,7 @@ class MyClass {
configurable: true, configurable: true,
enumerable: true, enumerable: true,
writable: true, writable: true,
value: (() => { value: function () {
var _ref = babelHelpers.asyncToGenerator(function* () { var _ref = babelHelpers.asyncToGenerator(function* () {
console.log(_this); console.log(_this);
}); });
@ -14,7 +14,7 @@ class MyClass {
return function value() { return function value() {
return _ref.apply(this, arguments); return _ref.apply(this, arguments);
}; };
})() }()
}); });
} }
@ -28,7 +28,7 @@ class MyClass {
configurable: true, configurable: true,
enumerable: true, enumerable: true,
writable: true, writable: true,
value: (() => { value: function () {
var _ref2 = babelHelpers.asyncToGenerator(function* () { var _ref2 = babelHelpers.asyncToGenerator(function* () {
console.log(_this2); console.log(_this2);
}); });
@ -36,7 +36,7 @@ class MyClass {
return function value() { return function value() {
return _ref2.apply(this, arguments); return _ref2.apply(this, arguments);
}; };
})() }()
}); });
} }
@ -50,7 +50,7 @@ export default class MyClass3 {
configurable: true, configurable: true,
enumerable: true, enumerable: true,
writable: true, writable: true,
value: (() => { value: function () {
var _ref3 = babelHelpers.asyncToGenerator(function* () { var _ref3 = babelHelpers.asyncToGenerator(function* () {
console.log(_this3); console.log(_this3);
}); });
@ -58,7 +58,7 @@ export default class MyClass3 {
return function value() { return function value() {
return _ref3.apply(this, arguments); return _ref3.apply(this, arguments);
}; };
})() }()
}); });
} }

View File

@ -1,13 +1,14 @@
let gen = (() => { function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; }
var _ref = _skipFirstGeneratorNext(function* () {
function gen() {
return _gen.apply(this, arguments);
}
function _gen() {
_gen = _skipFirstGeneratorNext(function* () {
let _functionSent = yield; let _functionSent = yield;
let sent = _functionSent; let sent = _functionSent;
}); });
return _gen.apply(this, arguments);
return function gen() { }
return _ref.apply(this, arguments);
};
})();
function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; }

View File

@ -1,17 +1,3 @@
let foo =
/*#__PURE__*/
(() => {
var _ref = _wrapAsyncGenerator(_skipFirstGeneratorNext(function* () {
let _functionSent = yield;
_functionSent = yield _awaitAsyncGenerator(_functionSent);
}));
return function foo() {
return _ref.apply(this, arguments);
};
})();
function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; } function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; }
function _awaitAsyncGenerator(value) { return new _AwaitValue(value); } function _awaitAsyncGenerator(value) { return new _AwaitValue(value); }
@ -29,3 +15,16 @@ _AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw",
_AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); }; _AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); };
function _AwaitValue(value) { this.wrapped = value; } function _AwaitValue(value) { this.wrapped = value; }
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
_foo = _wrapAsyncGenerator(_skipFirstGeneratorNext(function* () {
let _functionSent = yield;
_functionSent = yield _awaitAsyncGenerator(_functionSent);
}));
return _foo.apply(this, arguments);
}

View File

@ -1,7 +1,14 @@
function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; } function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; }
export default _skipFirstGeneratorNext(function* () { export default function () {
return _ref.apply(this, arguments);
}
function _ref() {
_ref = _skipFirstGeneratorNext(function* () {
let _functionSent = yield; let _functionSent = yield;
return _functionSent; return _functionSent;
}); });
return _ref.apply(this, arguments);
}

View File

@ -1,15 +1,14 @@
let gen = (() => { function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; }
var _ref = _skipFirstGeneratorNext(function* () {
export default function gen() {
return _gen.apply(this, arguments);
}
function _gen() {
_gen = _skipFirstGeneratorNext(function* () {
let _functionSent = yield; let _functionSent = yield;
return _functionSent; return _functionSent;
}); });
return _gen.apply(this, arguments);
return function gen() { }
return _ref.apply(this, arguments);
};
})();
function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; }
export { gen as default };

View File

@ -1,13 +1,14 @@
function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; } function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; }
export let gen = (() => { export function gen() {
var _ref = _skipFirstGeneratorNext(function* () { return _gen.apply(this, arguments);
}
function _gen() {
_gen = _skipFirstGeneratorNext(function* () {
let _functionSent = yield; let _functionSent = yield;
return _functionSent; return _functionSent;
}); });
return _gen.apply(this, arguments);
return function gen() { }
return _ref.apply(this, arguments);
};
})();

View File

@ -1,15 +1,13 @@
function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; } function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; }
const foo = (() => { const foo = function () {
var _ref = _skipFirstGeneratorNext(function* () { var _gen = _skipFirstGeneratorNext(function* () {
let _functionSent = yield; let _functionSent = yield;
return _functionSent; return _functionSent;
}); });
function gen() { return function gen() {
return _ref.apply(this, arguments); return _gen.apply(this, arguments);
} };
}();
return gen;
})();

View File

@ -1,13 +1,14 @@
let gen = (() => { function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; }
var _ref = _skipFirstGeneratorNext(function* () {
function gen() {
return _gen.apply(this, arguments);
}
function _gen() {
_gen = _skipFirstGeneratorNext(function* () {
let _functionSent = yield; let _functionSent = yield;
return _functionSent; return _functionSent;
}); });
return _gen.apply(this, arguments);
return function gen() { }
return _ref.apply(this, arguments);
};
})();
function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); it.next(); return it; }; }

View File

@ -6,7 +6,7 @@ let TestClass = {
return new Promise( return new Promise(
/*#__PURE__*/ /*#__PURE__*/
(() => { function () {
var _ref = babelHelpers.asyncToGenerator(function* (resolve) { var _ref = babelHelpers.asyncToGenerator(function* (resolve) {
console.log(_this); console.log(_this);
setTimeout(resolve, 1000); setTimeout(resolve, 1000);
@ -15,7 +15,7 @@ let TestClass = {
return function (_x) { return function (_x) {
return _ref.apply(this, arguments); return _ref.apply(this, arguments);
}; };
})()); }());
} }
}; };

View File

@ -1,19 +1,18 @@
let foo = function mandatory(paramName) {
/*#__PURE__*/ throw new Error(`Missing parameter: ${paramName}`);
(() => { }
var _ref2 = babelHelpers.asyncToGenerator(function* (_ref) {
function foo(_x) {
return _foo.apply(this, arguments);
}
function _foo() {
_foo = babelHelpers.asyncToGenerator(function* (_ref) {
let { let {
a, a,
b = mandatory("b") b = mandatory("b")
} = _ref; } = _ref;
return Promise.resolve(b); return Promise.resolve(b);
}); });
return _foo.apply(this, arguments);
return function foo(_x) {
return _ref2.apply(this, arguments);
};
})();
function mandatory(paramName) {
throw new Error(`Missing parameter: ${paramName}`);
} }

View File

@ -1,4 +1,3 @@
(async function() { await 'ok' })(); (async function() { await 'ok' })();
(async () => { await 'ok' })(); (async () => { await 'ok' })();
async function notIIFE() { await 'ok' } (async function notIIFE() { await 'ok' });
notIIFE();

View File

@ -1,19 +1,17 @@
let notIIFE = babelHelpers.asyncToGenerator(function* () {
yield 'ok';
})();
babelHelpers.asyncToGenerator(function* () {
yield 'ok';
})();
/*#__PURE__*/ /*#__PURE__*/
(() => { (function () {
var _ref3 = babelHelpers.asyncToGenerator(function* () { var _notIIFE = babelHelpers.asyncToGenerator(function* () {
yield 'ok'; yield 'ok';
}); });
return function notIIFE() { return function notIIFE() {
return _ref3.apply(this, arguments); return _notIIFE.apply(this, arguments);
}; };
})(); })();
babelHelpers.asyncToGenerator(function* () {
yield 'ok';
})();
babelHelpers.asyncToGenerator(function* () {
yield 'ok';
})();
notIIFE();

View File

@ -1,7 +1,9 @@
let s = function s(_x) {
/*#__PURE__*/ return _s.apply(this, arguments);
(() => { }
var _ref = babelHelpers.asyncToGenerator(function* (x) {
function _s() {
_s = babelHelpers.asyncToGenerator(function* (x) {
var _this = this, var _this = this,
_arguments = arguments; _arguments = arguments;
@ -11,12 +13,12 @@ let s =
let t = let t =
/*#__PURE__*/ /*#__PURE__*/
(() => { function () {
var _ref2 = babelHelpers.asyncToGenerator(function* (y, a) { var _ref = babelHelpers.asyncToGenerator(function* (y, a) {
let r = let r =
/*#__PURE__*/ /*#__PURE__*/
(() => { function () {
var _ref3 = babelHelpers.asyncToGenerator(function* (z, b) { var _ref2 = babelHelpers.asyncToGenerator(function* (z, b) {
yield z; yield z;
for (var _len2 = arguments.length, innerArgs = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { for (var _len2 = arguments.length, innerArgs = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
@ -28,9 +30,9 @@ let s =
}); });
return function r(_x4, _x5) { return function r(_x4, _x5) {
return _ref3.apply(this, arguments); return _ref2.apply(this, arguments);
}; };
})(); }();
yield r(); yield r();
console.log(_this, args, _arguments); console.log(_this, args, _arguments);
@ -38,15 +40,12 @@ let s =
}); });
return function t(_x2, _x3) { return function t(_x2, _x3) {
return _ref2.apply(this, arguments); return _ref.apply(this, arguments);
}; };
})(); }();
yield t(); yield t();
return this.h(t); return this.h(t);
}); });
return _s.apply(this, arguments);
return function s(_x) { }
return _ref.apply(this, arguments);
};
})();

View File

@ -1,6 +1,6 @@
var foo = var foo =
/*#__PURE__*/ /*#__PURE__*/
(() => { function () {
var _ref = babelHelpers.asyncToGenerator(function* () { var _ref = babelHelpers.asyncToGenerator(function* () {
var wat = yield bar(); var wat = yield bar();
}); });
@ -8,11 +8,11 @@ var foo =
return function foo() { return function foo() {
return _ref.apply(this, arguments); return _ref.apply(this, arguments);
}; };
})(); }();
var foo2 = var foo2 =
/*#__PURE__*/ /*#__PURE__*/
(() => { function () {
var _ref2 = babelHelpers.asyncToGenerator(function* () { var _ref2 = babelHelpers.asyncToGenerator(function* () {
var wat = yield bar(); var wat = yield bar();
}); });
@ -20,10 +20,10 @@ var foo2 =
return function foo2() { return function foo2() {
return _ref2.apply(this, arguments); return _ref2.apply(this, arguments);
}; };
})(), }(),
bar = bar =
/*#__PURE__*/ /*#__PURE__*/
(() => { function () {
var _ref3 = babelHelpers.asyncToGenerator(function* () { var _ref3 = babelHelpers.asyncToGenerator(function* () {
var wat = yield foo(); var wat = yield foo();
}); });
@ -31,4 +31,4 @@ var foo2 =
return function bar() { return function bar() {
return _ref3.apply(this, arguments); return _ref3.apply(this, arguments);
}; };
})(); }();

View File

@ -1,63 +1,57 @@
let one = function one(_x) {
/*#__PURE__*/ return _one.apply(this, arguments);
(() => { }
var _ref = babelHelpers.asyncToGenerator(function* (a, b = 1) {});
return function one(_x) { function _one() {
return _ref.apply(this, arguments); _one = babelHelpers.asyncToGenerator(function* (a, b = 1) {});
}; return _one.apply(this, arguments);
})(); }
let two = function two(_x2, _x3) {
/*#__PURE__*/ return _two.apply(this, arguments);
(() => { }
var _ref2 = babelHelpers.asyncToGenerator(function* (a, b, ...c) {});
return function two(_x2, _x3) { function _two() {
return _ref2.apply(this, arguments); _two = babelHelpers.asyncToGenerator(function* (a, b, ...c) {});
}; return _two.apply(this, arguments);
})(); }
let three = function three(_x4) {
/*#__PURE__*/ return _three.apply(this, arguments);
(() => { }
var _ref3 = babelHelpers.asyncToGenerator(function* (a, b = 1, c, d = 3) {});
return function three(_x4) { function _three() {
return _ref3.apply(this, arguments); _three = babelHelpers.asyncToGenerator(function* (a, b = 1, c, d = 3) {});
}; return _three.apply(this, arguments);
})(); }
let four = function four(_x5) {
/*#__PURE__*/ return _four.apply(this, arguments);
(() => { }
var _ref4 = babelHelpers.asyncToGenerator(function* (a, b = 1, c, ...d) {});
return function four(_x5) { function _four() {
return _ref4.apply(this, arguments); _four = babelHelpers.asyncToGenerator(function* (a, b = 1, c, ...d) {});
}; return _four.apply(this, arguments);
})(); }
let five = function five(_x6, _x7) {
/*#__PURE__*/ return _five.apply(this, arguments);
(() => { }
var _ref5 = babelHelpers.asyncToGenerator(function* (a, {
function _five() {
_five = babelHelpers.asyncToGenerator(function* (a, {
b b
}) {}); }) {});
return _five.apply(this, arguments);
}
return function five(_x6, _x7) { function six(_x8) {
return _ref5.apply(this, arguments); return _six.apply(this, arguments);
}; }
})();
let six = function _six() {
/*#__PURE__*/ _six = babelHelpers.asyncToGenerator(function* (a, {
(() => {
var _ref6 = babelHelpers.asyncToGenerator(function* (a, {
b b
} = {}) {}); } = {}) {});
return _six.apply(this, arguments);
return function six(_x8) { }
return _ref6.apply(this, arguments);
};
})();

View File

@ -1,13 +1,11 @@
var foo = var foo =
/*#__PURE__*/ /*#__PURE__*/
(() => { function () {
var _ref = babelHelpers.asyncToGenerator(function* () { var _bar = babelHelpers.asyncToGenerator(function* () {
console.log(bar); console.log(bar);
}); });
function bar() { return function bar() {
return _ref.apply(this, arguments); return _bar.apply(this, arguments);
} };
}();
return bar;
})();

View File

@ -1,9 +1,8 @@
let foo = function foo(_x) {
/*#__PURE__*/ return _foo.apply(this, arguments);
(() => { }
var _ref = babelHelpers.asyncToGenerator(function* (bar) {});
return function foo(_x) { function _foo() {
return _ref.apply(this, arguments); _foo = babelHelpers.asyncToGenerator(function* (bar) {});
}; return _foo.apply(this, arguments);
})(); }

View File

@ -1,15 +1,14 @@
let foo =
/*#__PURE__*/
(() => {
var _ref = _asyncToGenerator(function* () {
yield _Promise.resolve();
});
return function foo() {
return _ref.apply(this, arguments);
};
})();
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; }
import _Promise from 'somewhere'; import _Promise from 'somewhere';
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
_foo = _asyncToGenerator(function* () {
yield _Promise.resolve();
});
return _foo.apply(this, arguments);
}

View File

@ -1,28 +1,26 @@
let foo =
/*#__PURE__*/
(() => {
var _ref = _asyncToGenerator(function* () {
let bar =
/*#__PURE__*/
(() => {
var _ref2 = _asyncToGenerator(function* () {
return Promise.resolve();
});
return function bar() {
return _ref2.apply(this, arguments);
};
})();
let Promise;
yield bar();
});
return function foo() {
return _ref.apply(this, arguments);
};
})();
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; }
let _Promise; let _Promise;
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
_foo = _asyncToGenerator(function* () {
let Promise;
yield bar();
function bar() {
return _bar.apply(this, arguments);
}
function _bar() {
_bar = _asyncToGenerator(function* () {
return Promise.resolve();
});
return _bar.apply(this, arguments);
}
});
return _foo.apply(this, arguments);
}

View File

@ -1,17 +1,16 @@
let foo = function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; }
/*#__PURE__*/
(() => { let _Promise;
var _ref = _asyncToGenerator(function* () {
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
_foo = _asyncToGenerator(function* () {
yield new _Promise(resolve => { yield new _Promise(resolve => {
resolve(); resolve();
}); });
}); });
return _foo.apply(this, arguments);
return function foo() { }
return _ref.apply(this, arguments);
};
})();
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; }
let _Promise;

View File

@ -1,11 +1,10 @@
let foo = function foo() {
/*#__PURE__*/ return _foo.apply(this, arguments);
(() => { }
var _ref = babelHelpers.asyncToGenerator(function* () {
function _foo() {
_foo = babelHelpers.asyncToGenerator(function* () {
var wat = yield bar(); var wat = yield bar();
}); });
return _foo.apply(this, arguments);
return function foo() { }
return _ref.apply(this, arguments);
};
})();

View File

@ -2,7 +2,7 @@ var _coroutine = require("bluebird").coroutine;
var foo = var foo =
/*#__PURE__*/ /*#__PURE__*/
(() => { function () {
var _ref = _coroutine(function* () { var _ref = _coroutine(function* () {
var wat = yield bar(); var wat = yield bar();
}); });
@ -10,4 +10,4 @@ var foo =
return function foo() { return function foo() {
return _ref.apply(this, arguments); return _ref.apply(this, arguments);
}; };
})(); }();

View File

@ -2,14 +2,12 @@ var _coroutine = require("bluebird").coroutine;
var foo = var foo =
/*#__PURE__*/ /*#__PURE__*/
(() => { function () {
var _ref = _coroutine(function* () { var _bar = _coroutine(function* () {
console.log(bar); console.log(bar);
}); });
function bar() { return function bar() {
return _ref.apply(this, arguments); return _bar.apply(this, arguments);
} };
}();
return bar;
})();

View File

@ -1,13 +1,12 @@
var _coroutine = require("bluebird").coroutine; var _coroutine = require("bluebird").coroutine;
let foo = function foo() {
/*#__PURE__*/ return _foo.apply(this, arguments);
(() => { }
var _ref = _coroutine(function* () {
function _foo() {
_foo = _coroutine(function* () {
var wat = yield bar(); var wat = yield bar();
}); });
return _foo.apply(this, arguments);
return function foo() { }
return _ref.apply(this, arguments);
};
})();

View File

@ -3,16 +3,13 @@
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
exports.default = void 0;
let myFunc = (() => {
var _ref = babelHelpers.asyncToGenerator(
/*#__PURE__*/
function* () {});
return function myFunc() {
return _ref.apply(this, arguments);
};
})();
exports.default = myFunc; exports.default = myFunc;
function myFunc() {
return _myFunc.apply(this, arguments);
}
function _myFunc() {
_myFunc = babelHelpers.asyncToGenerator(function* () {});
return _myFunc.apply(this, arguments);
}

View File

@ -3,18 +3,15 @@
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
exports.foo = void 0; exports.foo = foo;
var _bar = babelHelpers.interopRequireDefault(require("bar")); var _bar = babelHelpers.interopRequireDefault(require("bar"));
let foo = function foo() {
/*#__PURE__*/ return _foo.apply(this, arguments);
(() => { }
var _ref = babelHelpers.asyncToGenerator(function* () {});
return function foo() { function _foo() {
return _ref.apply(this, arguments); _foo = babelHelpers.asyncToGenerator(function* () {});
}; return _foo.apply(this, arguments);
})(); }
exports.foo = foo;

View File

@ -3,16 +3,13 @@
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
exports.foo = void 0;
let foo =
/*#__PURE__*/
(() => {
var _ref = babelHelpers.asyncToGenerator(function* () {});
return function foo() {
return _ref.apply(this, arguments);
};
})();
exports.foo = foo; exports.foo = foo;
function foo() {
return _foo.apply(this, arguments);
}
function _foo() {
_foo = babelHelpers.asyncToGenerator(function* () {});
return _foo.apply(this, arguments);
}

View File

@ -1,22 +1,21 @@
"use strict"; "use strict";
let foo =
/*#__PURE__*/
(() => {
var _ref = _asyncToGenerator(function* (_ref2) {
let a = _ref2.a,
_ref2$b = _ref2.b,
b = _ref2$b === void 0 ? mandatory("b") : _ref2$b;
return Promise.resolve(b);
});
return function foo(_x) {
return _ref.apply(this, arguments);
};
})();
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; }
function mandatory(paramName) { function mandatory(paramName) {
throw new Error(`Missing parameter: ${paramName}`); throw new Error(`Missing parameter: ${paramName}`);
} }
function foo(_x) {
return _foo.apply(this, arguments);
}
function _foo() {
_foo = _asyncToGenerator(function* (_ref) {
let a = _ref.a,
_ref$b = _ref.b,
b = _ref$b === void 0 ? mandatory("b") : _ref$b;
return Promise.resolve(b);
});
return _foo.apply(this, arguments);
}

View File

@ -19,7 +19,7 @@ class Test {
console.log(_this2); console.log(_this2);
setTimeout( setTimeout(
/*#__PURE__*/ /*#__PURE__*/
(() => { function () {
var _ref2 = babelHelpers.asyncToGenerator(function* (arg) { var _ref2 = babelHelpers.asyncToGenerator(function* (arg) {
console.log(_this2); console.log(_this2);
}); });
@ -27,7 +27,7 @@ class Test {
return function (_x) { return function (_x) {
return _ref2.apply(this, arguments); return _ref2.apply(this, arguments);
}; };
})()); }());
})(); })();
} }
@ -51,7 +51,7 @@ class Test {
console.log(_this4); console.log(_this4);
setTimeout( setTimeout(
/*#__PURE__*/ /*#__PURE__*/
(() => { function () {
var _ref4 = babelHelpers.asyncToGenerator(function* (arg) { var _ref4 = babelHelpers.asyncToGenerator(function* (arg) {
console.log(_this4); console.log(_this4);
}); });
@ -59,7 +59,7 @@ class Test {
return function (_x2) { return function (_x2) {
return _ref4.apply(this, arguments); return _ref4.apply(this, arguments);
}; };
})()); }());
})(); })();
} }

View File

@ -1,10 +1,14 @@
import "core-js/modules/es6.promise";
import "regenerator-runtime/runtime"; import "regenerator-runtime/runtime";
import "core-js/modules/es6.promise";
var a = function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; }
/*#__PURE__*/
function () { function a() {
var _ref = _asyncToGenerator( return _a.apply(this, arguments);
}
function _a() {
_a = _asyncToGenerator(
/*#__PURE__*/ /*#__PURE__*/
regeneratorRuntime.mark(function _callee() { regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) { return regeneratorRuntime.wrap(function _callee$(_context) {
@ -17,10 +21,5 @@ function () {
} }
}, _callee, this); }, _callee, this);
})); }));
return _a.apply(this, arguments);
return function a() { }
return _ref.apply(this, arguments);
};
}();
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; }

View File

@ -1,33 +1,3 @@
var agf =
/*#__PURE__*/
function () {
var _ref = _wrapAsyncGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return _awaitAsyncGenerator(1);
case 2:
_context.next = 4;
return 2;
case 4:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
return function agf() {
return _ref.apply(this, arguments);
};
}();
function _awaitAsyncGenerator(value) { return new _AwaitValue(value); } function _awaitAsyncGenerator(value) { return new _AwaitValue(value); }
function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; } function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; }
@ -60,3 +30,32 @@ var n = Object.assign({
x: x, x: x,
y: y y: y
}, z); }, z);
function agf() {
return _agf.apply(this, arguments);
}
function _agf() {
_agf = _wrapAsyncGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return _awaitAsyncGenerator(1);
case 2:
_context.next = 4;
return 2;
case 4:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
return _agf.apply(this, arguments);
}

View File

@ -1,43 +1,13 @@
"use strict"; "use strict";
require("regenerator-runtime/runtime");
require("core-js/modules/es6.symbol"); require("core-js/modules/es6.symbol");
require("core-js/modules/es6.promise"); require("core-js/modules/es6.promise");
require("regenerator-runtime/runtime");
require("core-js/modules/es6.object.assign"); require("core-js/modules/es6.object.assign");
var agf =
/*#__PURE__*/
function () {
var _ref = _wrapAsyncGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return _awaitAsyncGenerator(1);
case 2:
_context.next = 4;
return 2;
case 4:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
return function agf() {
return _ref.apply(this, arguments);
};
}();
function _awaitAsyncGenerator(value) { return new _AwaitValue(value); } function _awaitAsyncGenerator(value) { return new _AwaitValue(value); }
function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; } function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; }
@ -70,3 +40,32 @@ var n = Object.assign({
x: x, x: x,
y: y y: y
}, z); }, z);
function agf() {
return _agf.apply(this, arguments);
}
function _agf() {
_agf = _wrapAsyncGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return _awaitAsyncGenerator(1);
case 2:
_context.next = 4;
return 2;
case 4:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
return _agf.apply(this, arguments);
}

View File

@ -1,33 +1,3 @@
var agf =
/*#__PURE__*/
function () {
var _ref = _wrapAsyncGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return _awaitAsyncGenerator(1);
case 2:
_context.next = 4;
return 2;
case 4:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
return function agf() {
return _ref.apply(this, arguments);
};
}();
function _awaitAsyncGenerator(value) { return new _AwaitValue(value); } function _awaitAsyncGenerator(value) { return new _AwaitValue(value); }
function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; } function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; }
@ -62,3 +32,32 @@ var n = _extends({
x: x, x: x,
y: y y: y
}, z); }, z);
function agf() {
return _agf.apply(this, arguments);
}
function _agf() {
_agf = _wrapAsyncGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return _awaitAsyncGenerator(1);
case 2:
_context.next = 4;
return 2;
case 4:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
return _agf.apply(this, arguments);
}