Skip to content

Commit bc990b4

Browse files
committedMar 17, 2025·
Simplify determineExecutionMethod
1 parent a0c588e commit bc990b4

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed
 

‎src/runner/utils.ts

+3-24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { DebuggerStatement, Program } from 'estree'
1+
import type { Program } from 'estree'
22

33
import type { IOptions, Result } from '..'
44
import { areBreakpointsSet } from '../stdlib/inspector'
@@ -43,33 +43,12 @@ export function determineExecutionMethod(
4343
}
4444

4545
let isNativeRunnable
46-
if (verboseErrors) {
46+
if (verboseErrors || areBreakpointsSet()) {
4747
isNativeRunnable = false
48-
} else if (areBreakpointsSet()) {
49-
isNativeRunnable = false
50-
} else if (theOptions.executionMethod === 'auto') {
51-
if (context.executionMethod === 'auto') {
52-
if (verboseErrors) {
53-
isNativeRunnable = false
54-
} else if (areBreakpointsSet()) {
55-
isNativeRunnable = false
56-
} else {
57-
let hasDebuggerStatement = false
58-
simple(program, {
59-
DebuggerStatement() {
60-
hasDebuggerStatement = true
61-
}
62-
})
63-
isNativeRunnable = !hasDebuggerStatement
64-
}
65-
context.executionMethod = isNativeRunnable ? 'native' : 'cse-machine'
66-
} else {
67-
isNativeRunnable = context.executionMethod === 'native'
68-
}
6948
} else {
7049
let hasDebuggerStatement = false
7150
simple(program, {
72-
DebuggerStatement(_node: DebuggerStatement) {
51+
DebuggerStatement() {
7352
hasDebuggerStatement = true
7453
}
7554
})

0 commit comments

Comments
 (0)
Please sign in to comment.