Debian Codegraph @

rhino/testsrc/jstests/exceptionJson.jstest

raw
1 // Ensure that a NativeError can be converted to JSON.
2
3 try {
4 somethingUndefined();
5 } catch (ud) {
6 JSON.stringify(ud);
7 }
8
9 try {
10 throw new Error("Error with a message");
11 } catch (ex) {
12 JSON.stringify(ex);
13 }
14
15 "success";