• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / js-slang / 28181093691

25 Jun 2026 03:25PM UTC coverage: 78.584% (+0.05%) from 78.53%
28181093691

Pull #1995

github

web-flow
Merge bf8fdcf90 into c5b34c1fc
Pull Request #1995: Operators Fix

3155 of 4228 branches covered (74.62%)

Branch coverage included in aggregate %.

22 of 24 new or added lines in 8 files covered. (91.67%)

81 existing lines in 13 files now uncovered.

7064 of 8776 relevant lines covered (80.49%)

177913.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.59
/src/runner/utils.ts
1
import type { Program } from 'estree';
2

3
import type { IOptions } from '..';
4
import type { Variant } from '../langs';
5
import { areBreakpointsSet } from '../stdlib/inspector';
6
import type { Context, RecursivePartial } from '../types';
7
import { simple } from '../utils/ast/walkers';
8

9
// Context Utils
10

11
/**
12
 * Small function to determine the variant to be used
13
 * by a program, as both context and options can have
14
 * a variant. The variant provided in options will
15
 * have precedence over the variant provided in context.
16
 *
17
 * @param context The context of the program.
18
 * @param options Options to be used when
19
 *                running the program.
20
 *
21
 * @returns The variant that the program is to be run in
22
 */
23
export function determineVariant(context: Context, options: RecursivePartial<IOptions>): Variant {
24
  if (options.variant) {
2,714!
UNCOV
25
    return options.variant;
×
26
  } else {
27
    return context.variant;
2,714✔
28
  }
29
}
30

31
export function determineExecutionMethod(
32
  theOptions: IOptions,
33
  context: Context,
34
  program: Program,
35
  verboseErrors: boolean,
36
): void {
37
  if (theOptions.executionMethod !== 'auto') {
1,693✔
38
    context.executionMethod = theOptions.executionMethod;
722✔
39
    return;
722✔
40
  }
41

42
  if (context.executionMethod !== 'auto') {
971✔
43
    return;
403✔
44
  }
45

46
  let isNativeRunnable;
47
  if (verboseErrors || areBreakpointsSet()) {
568✔
48
    isNativeRunnable = false;
27✔
49
  } else {
50
    let hasDebuggerStatement = false;
541✔
51
    simple(program, {
541✔
52
      DebuggerStatement() {
53
        hasDebuggerStatement = true;
6✔
54
      },
55
    });
56
    isNativeRunnable = !hasDebuggerStatement;
541✔
57
  }
58

59
  context.executionMethod = isNativeRunnable ? 'native' : 'cse-machine';
568✔
60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc