File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * @file util-module.simple
3+ * Simple test for the builtin util module
4+ * @author Tom Tang <
[email protected] >
5+ * @date March 2024
6+ */
7+
8+ const util = require('util');
9+
10+ // https://github.com/Distributive-Network/PythonMonkey/pull/300
11+ const err = new TypeError();
12+ if (err.propertyIsEnumerable('stack'))
13+ throw new Error('The stack property should not be enumerable.');
14+ err.anything = 123;
15+ err.stack = 'abc';
16+ if (!err.propertyIsEnumerable('stack'))
17+ throw new Error('In SpiderMonkey, the stack property should be enumerable after changing it.');
18+ const output = util.format(err);
19+ if (output.match(/abc/g).length !== 1) // should only be printed once
20+ throw new Error('The stack property should not be printed along with other enumerable properties');
You can’t perform that action at this time.
0 commit comments