Debian Codegraph @

js/src/jit-test/tests/debug/Memory-takeCensus-07.js

raw
1 // Debugger.Memory.prototype.takeCensus breakdown: check error handling on
2 // property gets.
3
4 load(libdir + 'asserts.js');
5
6 var g = newGlobal({newCompartment: true});
7 var dbg = new Debugger(g);
8
9 assertThrowsValue(() => {
10 dbg.memory.takeCensus({
11 breakdown: { get by() { throw "ಠ_ಠ" } }
12 });
13 }, "ಠ_ಠ");
14
15
16
17 assertThrowsValue(() => {
18 dbg.memory.takeCensus({
19 breakdown: { by: 'count', get count() { throw "ಠ_ಠ" } }
20 });
21 }, "ಠ_ಠ");
22
23 assertThrowsValue(() => {
24 dbg.memory.takeCensus({
25 breakdown: { by: 'count', get bytes() { throw "ಠ_ಠ" } }
26 });
27 }, "ಠ_ಠ");
28
29
30
31 assertThrowsValue(() => {
32 dbg.memory.takeCensus({
33 breakdown: { by: 'objectClass', get then() { throw "ಠ_ಠ" } }
34 });
35 }, "ಠ_ಠ");
36
37 assertThrowsValue(() => {
38 dbg.memory.takeCensus({
39 breakdown: { by: 'objectClass', get other() { throw "ಠ_ಠ" } }
40 });
41 }, "ಠ_ಠ");
42
43
44
45 assertThrowsValue(() => {
46 dbg.memory.takeCensus({
47 breakdown: { by: 'coarseType', get objects() { throw "ಠ_ಠ" } }
48 });
49 }, "ಠ_ಠ");
50
51 assertThrowsValue(() => {
52 dbg.memory.takeCensus({
53 breakdown: { by: 'coarseType', get scripts() { throw "ಠ_ಠ" } }
54 });
55 }, "ಠ_ಠ");
56
57 assertThrowsValue(() => {
58 dbg.memory.takeCensus({
59 breakdown: { by: 'coarseType', get strings() { throw "ಠ_ಠ" } }
60 });
61 }, "ಠ_ಠ");
62
63 assertThrowsValue(() => {
64 dbg.memory.takeCensus({
65 breakdown: { by: 'coarseType', get other() { throw "ಠ_ಠ" } }
66 });
67 }, "ಠ_ಠ");
68
69
70
71 assertThrowsValue(() => {
72 dbg.memory.takeCensus({
73 breakdown: { by: 'internalType', get then() { throw "ಠ_ಠ" } }
74 });
75 }, "ಠ_ಠ");