Skip to content

Commit

Permalink
Deploying to gh-pages from @ 1c9eacd 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
nin-jin committed Feb 5, 2025
1 parent 96f1684 commit 1d4324d
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 16 deletions.
2 changes: 1 addition & 1 deletion node.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ declare namespace $ {
class $mol_error_mix<Cause extends {} = {}> extends AggregateError {
readonly cause: Cause;
name: string;
constructor(message: string, cause?: Cause, ...errors: Error[]);
constructor(message: string, cause?: Cause, ...errors: readonly Error[]);
static [Symbol.toPrimitive](): string;
static toString(): string;
static make(...params: ConstructorParameters<typeof $mol_error_mix>): $mol_error_mix<{}>;
Expand Down
2 changes: 1 addition & 1 deletion node.deps.json

Large diffs are not rendered by default.

27 changes: 23 additions & 4 deletions node.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node.js.map

Large diffs are not rendered by default.

27 changes: 23 additions & 4 deletions node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2054,17 +2054,36 @@ require = (req => Object.assign(function require(name) {
"use strict";
var $;
(function ($) {
function cause_serialize(cause) {
return JSON.stringify(cause, null, ' ')
.replace(/\(/, '<')
.replace(/\)/, ' >');
}
function frame_normalize(frame) {
return (typeof frame === 'string' ? frame : cause_serialize(frame))
.trim()
.replace(/at /gm, ' at ')
.replace(/^(?! +at )(.*)/gm, ' at | $1 (#)');
}
class $mol_error_mix extends AggregateError {
cause;
name = $$.$mol_func_name(this.constructor).replace(/^\$/, '') + '_Error';
constructor(message, cause = {}, ...errors) {
super(errors, message, { cause });
this.cause = cause;
const stack_get = Object.getOwnPropertyDescriptor(this, 'stack')?.get ?? (() => super.stack);
const desc = Object.getOwnPropertyDescriptor(this, 'stack');
const stack_get = () => desc?.get?.() ?? super.stack ?? desc?.value ?? this.message;
Object.defineProperty(this, 'stack', {
get: () => (stack_get.call(this) ?? this.message) + '\n' + [JSON.stringify(this.cause, null, ' ') ?? 'no cause', ...this.errors.map(e => e.stack)].map(e => e.trim()
.replace(/at /gm, ' at ')
.replace(/^(?! +at )(.*)/gm, ' at | $1 (#)')).join('\n')
get: () => stack_get() + '\n' + [
this.cause ?? 'no cause',
...this.errors.flatMap(e => [
e.stack,
...e instanceof $mol_error_mix || !e.cause ? [] : [e.cause]
])
].map(frame_normalize).join('\n')
});
Object.defineProperty(this, 'cause', {
get: () => cause
});
}
static [Symbol.toPrimitive]() {
Expand Down
27 changes: 23 additions & 4 deletions node.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node.test.js.map

Large diffs are not rendered by default.

0 comments on commit 1d4324d

Please sign in to comment.