MCPcopy Create free account
hub / github.com/nodejs/node / runTest

Function runTest

deps/v8/test/mjsunit/wasm/stackwalk.js:38–109  ·  view source on GitHub ↗
(builder)

Source from the content-addressed store, hash-verified

36
37
38function runTest(builder) {
39 // ---- THROWING TEST -----------------------------------------------
40
41 function throwadd(a, b) {
42 print("-- trying throw --");
43 throw a + b;
44 }
45
46 function throwa(a) {
47 print("-- trying throw --");
48 throw a;
49 }
50
51 function throwstr() {
52 print("-- trying throw --");
53 throw "string";
54 }
55
56 assertThrows(builder(throwadd));
57 assertThrows(builder(throwa));
58 assertThrows(builder(throwstr));
59
60 try {
61 builder(throwadd)(7.8, 9.9);
62 } catch(e) {
63 print(e);
64 }
65
66 try {
67 builder(throwa)(11.8, 9.3);
68 } catch(e) {
69 print(e);
70 }
71
72
73 try {
74 builder(throwstr)(3, 5);
75 } catch(e) {
76 print(e);
77 }
78
79
80 // ---- DEOPT TEST -----------------------------------------------
81
82 function deopt() {
83 print("-- trying deopt --");
84 %DeoptimizeFunction(deopter);
85 }
86
87 var deopter = builder(deopt);
88
89 deopter(5, 5);
90 for (var i = 0; i < 9; i++) {
91 deopter(6, 6);
92 }
93
94
95 // ---- GC TEST -----------------------------------------------

Callers 1

stackwalk.jsFile · 0.70

Calls 3

builderFunction · 0.70
assertThrowsFunction · 0.50
printFunction · 0.50

Tested by

no test coverage detected