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

Function shouldThrow

deps/v8/test/webkit/resources/standalone-pre.js:155–178  ·  view source on GitHub ↗
(_a, _e)

Source from the content-addressed store, hash-verified

153
154
155function shouldThrow(_a, _e)
156{
157 var exception;
158 var _av;
159 try {
160 _av = eval(_a);
161 } catch (e) {
162 exception = e;
163 }
164
165 var _ev;
166 if (_e)
167 _ev = eval(_e);
168
169 if (exception) {
170 if (typeof _e == "undefined" || exception == _ev)
171 testPassed(_a + " threw exception " + exception + ".");
172 else
173 testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Threw exception " + exception + ".");
174 } else if (typeof _av == "undefined")
175 testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was undefined.");
176 else
177 testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was " + stringify(_av) + ".");
178}
179
180
181function shouldNotThrow(_a)

Calls 4

testPassedFunction · 0.85
testFailedFunction · 0.85
stringifyFunction · 0.70
evalFunction · 0.50

Tested by 1

testFunction · 0.40