Skip to content

Commit

Permalink
[fix] async func failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Siubaak committed Feb 20, 2024
1 parent 795071c commit 464cad3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vdebugger",
"version": "0.1.18",
"version": "0.1.19",
"description": "A Front-End JavaScript Debugger",
"main": "dist/vdebugger.js",
"types": "dist/vdebugger.d.ts",
Expand Down
4 changes: 3 additions & 1 deletion src/transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ export default class Transformer {
'try{' +
'return yield* (function* () {' +
`${SCOPE_TRACER_NAME}(true,x=>eval(x),'(global)');` +
`let ${TMP_VARIABLE_NAME}o,${TMP_VARIABLE_NAME}f,${TMP_VARIABLE_NAME}y;` +
`${generate(ast, process.env.NODE_ENV === 'production' ? { indent: '', lineEnd: '' } : {})}` +
'})()' +
'}finally{' +
Expand Down Expand Up @@ -231,6 +230,9 @@ export default class Transformer {
// 创建作用域所需变量声明
createScopeVariableDeclarators() {
return [
this.createVariableDeclarator(this.createIdentifier(TMP_VARIABLE_NAME + 'o'), null),
this.createVariableDeclarator(this.createIdentifier(TMP_VARIABLE_NAME + 'f'), null),
this.createVariableDeclarator(this.createIdentifier(TMP_VARIABLE_NAME + 'y'), null),
this.createVariableDeclarator(this.createIdentifier(TMP_VARIABLE_NAME + 't'), this.createThisExpression()),
this.createVariableDeclarator(this.createIdentifier(TMP_VARIABLE_NAME + 'a'), this.createIdentifier('arguments')),
this.createVariableDeclarator(this.createIdentifier(NEW_TARGET_NAME),
Expand Down

0 comments on commit 464cad3

Please sign in to comment.