main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[79a0317] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.default = void 0;
|
---|
| 7 | var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
---|
| 8 | var _regeneratorTransform = require("regenerator-transform");
|
---|
| 9 | var _default = exports.default = (0, _helperPluginUtils.declare)(({
|
---|
| 10 | types: t,
|
---|
| 11 | assertVersion
|
---|
| 12 | }) => {
|
---|
| 13 | assertVersion(7);
|
---|
| 14 | return {
|
---|
| 15 | name: "transform-regenerator",
|
---|
| 16 | inherits: _regeneratorTransform.default,
|
---|
| 17 | visitor: {
|
---|
| 18 | CallExpression(path) {
|
---|
| 19 | {
|
---|
| 20 | var _this$availableHelper;
|
---|
| 21 | if (!((_this$availableHelper = this.availableHelper) != null && _this$availableHelper.call(this, "regeneratorRuntime"))) {
|
---|
| 22 | return;
|
---|
| 23 | }
|
---|
| 24 | }
|
---|
| 25 | const callee = path.get("callee");
|
---|
| 26 | if (!callee.isMemberExpression()) return;
|
---|
| 27 | const obj = callee.get("object");
|
---|
| 28 | if (obj.isIdentifier({
|
---|
| 29 | name: "regeneratorRuntime"
|
---|
| 30 | })) {
|
---|
| 31 | const helper = this.addHelper("regeneratorRuntime");
|
---|
| 32 | {
|
---|
| 33 | if (t.isArrowFunctionExpression(helper)) {
|
---|
| 34 | obj.replaceWith(helper.body);
|
---|
| 35 | return;
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
| 38 | obj.replaceWith(t.callExpression(helper, []));
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
| 42 | };
|
---|
| 43 | });
|
---|
| 44 |
|
---|
| 45 | //# sourceMappingURL=index.js.map
|
---|
Note:
See
TracBrowser
for help on using the repository browser.