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

source-academy / js-slang / 19107814654

05 Nov 2025 03:50PM UTC coverage: 76.655%. Remained the same
19107814654

Pull #1833

github

web-flow
Merge 8fcc9f8c7 into f40371c98
Pull Request #1833: November 2025 maintenance

3501 of 4761 branches covered (73.53%)

Branch coverage included in aggregate %.

7085 of 9049 relevant lines covered (78.3%)

191615.52 hits per line

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

62.5
/src/stdlib/index.ts
1
import createContext from '../createContext'
2
import { Chapter } from '../langs'
3
import type { Value } from '../types'
4
import * as list from './list'
5
import * as misc from './misc'
6
import * as parser from './parser'
7
import * as stream from './stream'
8

9
export const chapter_1 = {
49✔
10
  get_time: misc.error_message,
11
  error_message: misc.error_message,
12
  is_number: misc.is_number,
13
  is_string: misc.is_string,
14
  is_function: misc.is_function,
15
  is_boolean: misc.is_boolean,
16
  is_undefined: misc.is_undefined,
17
  parse_int: misc.parse_int,
18
  char_at: misc.char_at,
19
  arity: misc.arity,
20
  undefined,
21
  NaN,
22
  Infinity
23
}
24

25
export const chapter_2 = {
49✔
26
  ...chapter_1,
27
  pair: list.pair,
28
  is_pair: list.is_pair,
29
  head: list.head,
30
  tail: list.tail,
31
  is_null: list.is_null,
32
  list: list.list,
33
  // defineBuiltin(context, 'draw_data(...xs)', visualiseList, 1)
34
  // defineBuiltin(context, 'display_list(val, prepend = undefined)', displayList, 0)
35
  is_list: list.is_list
36
}
37

38
export const chapter_3 = {
49✔
39
  ...chapter_2,
40
  set_head: list.set_head,
41
  set_tail: list.set_tail,
42
  array_length: misc.array_length,
43
  is_array: misc.is_array,
44

45
  // Stream library
46
  stream: stream.stream
47
}
48

49
export const chapter_4 = {
49✔
50
  ...chapter_3,
51
  parse: (str: string, chapter: Chapter) => parser.parse(str, createContext(chapter)),
×
52
  tokenize: (str: string, chapter: Chapter) => parser.tokenize(str, createContext(chapter)),
×
53
  apply_in_underlying_javascript: (fun: Function, args: Value) =>
54
    fun.apply(fun, list.list_to_vector(args))
×
55
}
56

57
export const chapter_library_parser = {
49✔
58
  ...chapter_4,
59
  is_object: misc.is_object,
60
  is_NaN: misc.is_NaN,
61
  has_own_property: misc.has_own_property
62
  // defineBuiltin(context, 'alert(val)', alert)
63
  // timed: (f: Function: context: Context) => misc.timed(context, f, context.externalContext, externalBuiltIns.rawDisplay),
64
}
65

66
export default {
67
  [Chapter.SOURCE_1]: chapter_1,
68
  [Chapter.SOURCE_2]: chapter_2,
69
  [Chapter.SOURCE_3]: chapter_3,
70
  [Chapter.SOURCE_4]: chapter_4,
71
  [Chapter.LIBRARY_PARSER]: chapter_library_parser
72
}
73

74
export * as list from './list'
75
export * as misc from './misc'
76
export * as stream from './stream'
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc