summaryrefslogtreecommitdiff
path: root/js/src/gdb/tests/test-jsval.py
blob: 38edb281975220714444b0fb8b191c8d6e7b5477 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Basic unit tests for jsval pretty-printer.

assert_subprinter_registered('SpiderMonkey', 'JS::Value')

run_fragment('jsval.simple')

assert_pretty('fortytwo', '$jsval(42)')
assert_pretty('negone', '$jsval(-1)')
assert_pretty('undefined', 'JSVAL_VOID')
assert_pretty('null', 'JSVAL_NULL')
assert_pretty('js_true', 'JSVAL_TRUE')
assert_pretty('js_false', 'JSVAL_FALSE')
assert_pretty('elements_hole', '$jsmagic(JS_ELEMENTS_HOLE)')
assert_pretty('empty_string', '$jsval("")')
assert_pretty('friendly_string', '$jsval("Hello!")')
assert_pretty('symbol', '$jsval(Symbol.for("Hello!"))')
if enable_bigint:
    assert_pretty('bi', '$JS::BigIntValue()')
assert_pretty('global', '$jsval((JSObject *)  [object global] delegate)')
assert_pretty('onehundredthirtysevenonehundredtwentyeighths', '$jsval(1.0703125)')