Skip to content

Commit

Permalink
[fix] start bp id from 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Siubaak committed Feb 5, 2024
1 parent 5340707 commit f386bbc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from './consts';

export default class Transformer {
static breakpointId = Date.now();
static breakpointId = 1;
static breakpointMap = new Map();

debuggerId = '';
Expand Down Expand Up @@ -304,14 +304,13 @@ export default class Transformer {
)
])
)
];
node.body.forEach((bodyNode) => cookedBody.push(
].concat(...node.body.map((bodyNode) => [
// 给每个语句前都插入断点
this.createExpressionStatement(
this.createBreakpointExpression(bodyNode)
),
bodyNode
));
]));
node.body = isFunction ? cookedBody : [
this.createTryStatement(
this.createBlockStatement(cookedBody),
Expand Down

0 comments on commit f386bbc

Please sign in to comment.