Debian Codegraph @

js/src/tests/non262/extensions/toSource-infinite-recursion.js

raw
1 // |reftest| skip-if(!Error.prototype.toSource)
2
3 /*
4 * Any copyright is dedicated to the Public Domain.
5 * http://creativecommons.org/licenses/publicdomain/
6 */
7
8 //-----------------------------------------------------------------------------
9 var BUGNUMBER = 650574;
10 var summary = 'Check for too-deep stack when converting a value to source';
11
12 print(BUGNUMBER + ": " + summary);
13
14 /**************
15 * BEGIN TEST *
16 **************/
17
18 var e = Error('');
19 e.fileName = e;
20 assertEq(e.toSource(), `(new Error("", {}, 18))`);
21
22 /******************************************************************************/
23
24 if (typeof reportCompare === "function")
25 reportCompare(true, true);
26
27 print("All tests passed!");