Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4392362
test_suppressed_error_symbols.cjs
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
test_suppressed_error_symbols.cjs
View Options
function assert(condition, message) {
if (!condition) throw new Error(message);
}
assert(typeof Symbol.dispose === "symbol", "Symbol.dispose exists");
assert(typeof Symbol.asyncDispose === "symbol", "Symbol.asyncDispose exists");
assert(Symbol.dispose.description === "Symbol.dispose", "Symbol.dispose description");
assert(Symbol.asyncDispose.description === "Symbol.asyncDispose", "Symbol.asyncDispose description");
const error = new Error("inner");
const suppressed = new TypeError("outer");
const err = new SuppressedError(error, suppressed, "cleanup failed");
assert(err instanceof SuppressedError, "instanceof SuppressedError");
assert(err instanceof Error, "instanceof Error");
assert(Error.isError(err), "Error.isError recognizes SuppressedError");
assert(err.name === "SuppressedError", "name is SuppressedError");
assert(err.message === "cleanup failed", "message is set");
assert(err.error === error, "error field is set");
assert(err.suppressed === suppressed, "suppressed field is set");
assert(typeof err.stack === "string", "stack is captured");
const called = SuppressedError(error, suppressed);
assert(called instanceof SuppressedError, "SuppressedError is callable");
assert(called.error === error, "callable error field");
assert(called.suppressed === suppressed, "callable suppressed field");
console.log("SuppressedError and dispose symbol tests completed!");
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, May 1, 11:58 AM (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
542824
Default Alt Text
test_suppressed_error_symbols.cjs (1 KB)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment