Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Sep 4, 2023
1 parent a6c2f78 commit e413175
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
4 changes: 3 additions & 1 deletion packages/babel-helper-wrap-function/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ function plainFunction(
params.push(path.scope.generateUidIdentifier("x"));
}

const ref = path.scope.generateUidIdentifier("ref");
const ref = path.scope.generateUidIdentifier(
functionId ? functionId.name : "ref",
);

if (isDeclaration) {
path.replaceWith(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var _ref;
var _gen;
function gen() {
return (_ref = _ref || babelHelpers.skipFirstGeneratorNext(function* () {
return (_gen = _gen || babelHelpers.skipFirstGeneratorNext(function* () {
let _functionSent = yield;
let sent = _functionSent;
})).apply(this, arguments);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var _ref;
var _foo;
function foo() {
return (_ref = _ref || babelHelpers.wrapAsyncGenerator(babelHelpers.skipFirstGeneratorNext(function* () {
return (_foo = _foo || babelHelpers.wrapAsyncGenerator(babelHelpers.skipFirstGeneratorNext(function* () {
let _functionSent = yield;
_functionSent = yield babelHelpers.awaitAsyncGenerator(_functionSent);
}))).apply(this, arguments);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var _ref;
var _gen;
export default function gen() {
return (_ref = _ref || babelHelpers.skipFirstGeneratorNext(function* () {
return (_gen = _gen || babelHelpers.skipFirstGeneratorNext(function* () {
let _functionSent = yield;
return _functionSent;
})).apply(this, arguments);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var _ref;
var _gen;
export function gen() {
return (_ref = _ref || babelHelpers.skipFirstGeneratorNext(function* () {
return (_gen = _gen || babelHelpers.skipFirstGeneratorNext(function* () {
let _functionSent = yield;
return _functionSent;
})).apply(this, arguments);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var _ref;
var _gen;
const foo = function gen() {
return (_ref = _ref || babelHelpers.skipFirstGeneratorNext(function* () {
return (_gen = _gen || babelHelpers.skipFirstGeneratorNext(function* () {
let _functionSent = yield;
return _functionSent;
})).apply(this, arguments);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var _ref;
var _gen;
function gen() {
return (_ref = _ref || babelHelpers.skipFirstGeneratorNext(function* () {
return (_gen = _gen || babelHelpers.skipFirstGeneratorNext(function* () {
let _functionSent = yield;
return _functionSent;
})).apply(this, arguments);
Expand Down

0 comments on commit e413175

Please sign in to comment.