mam 1.11.683 → 1.11.684
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node.d.ts +8 -4
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +132 -15
- package/node.js.map +1 -1
- package/node.mjs +132 -15
- package/node.test.js +146 -37
- package/node.test.js.map +1 -1
- package/package.json +3 -2
package/node.js
CHANGED
|
@@ -152,6 +152,16 @@ var $;
|
|
|
152
152
|
$.$mol_wire_affected = [];
|
|
153
153
|
})($ || ($ = {}));
|
|
154
154
|
|
|
155
|
+
;
|
|
156
|
+
"use strict";
|
|
157
|
+
var $;
|
|
158
|
+
(function ($) {
|
|
159
|
+
function $mol_fail_hidden(error) {
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
162
|
+
$.$mol_fail_hidden = $mol_fail_hidden;
|
|
163
|
+
})($ || ($ = {}));
|
|
164
|
+
|
|
155
165
|
;
|
|
156
166
|
"use strict";
|
|
157
167
|
var $;
|
|
@@ -163,6 +173,17 @@ var $;
|
|
|
163
173
|
$.$mol_dev_format_register = $mol_dev_format_register;
|
|
164
174
|
$.$mol_dev_format_head = Symbol('$mol_dev_format_head');
|
|
165
175
|
$.$mol_dev_format_body = Symbol('$mol_dev_format_body');
|
|
176
|
+
function $mol_dev_format_button(label, click) {
|
|
177
|
+
return $mol_dev_format_auto({
|
|
178
|
+
[$.$mol_dev_format_head]() {
|
|
179
|
+
return $mol_dev_format_span({ color: 'cornflowerblue' }, label);
|
|
180
|
+
},
|
|
181
|
+
[$.$mol_dev_format_body]() {
|
|
182
|
+
Promise.resolve().then(click);
|
|
183
|
+
return $mol_dev_format_span({});
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
166
187
|
$mol_dev_format_register({
|
|
167
188
|
header: (val, config = false) => {
|
|
168
189
|
if (config)
|
|
@@ -180,13 +201,41 @@ var $;
|
|
|
180
201
|
if (typeof val === 'function') {
|
|
181
202
|
return $mol_dev_format_native(val);
|
|
182
203
|
}
|
|
204
|
+
if (Error.isError(val)) {
|
|
205
|
+
return $mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
|
|
206
|
+
}
|
|
207
|
+
if (val instanceof Promise) {
|
|
208
|
+
return $.$mol_dev_format_shade($mol_dev_format_native(val), ' ', val[Symbol.toStringTag] ?? '');
|
|
209
|
+
}
|
|
183
210
|
if (Symbol.toStringTag in val) {
|
|
184
211
|
return $mol_dev_format_native(val);
|
|
185
212
|
}
|
|
186
213
|
return null;
|
|
187
214
|
},
|
|
188
|
-
hasBody: val =>
|
|
189
|
-
|
|
215
|
+
hasBody: (val, config = false) => {
|
|
216
|
+
if (config)
|
|
217
|
+
return false;
|
|
218
|
+
if (!val)
|
|
219
|
+
return false;
|
|
220
|
+
if (val[$.$mol_dev_format_body])
|
|
221
|
+
return true;
|
|
222
|
+
return false;
|
|
223
|
+
},
|
|
224
|
+
body: (val, config = false) => {
|
|
225
|
+
if (config)
|
|
226
|
+
return null;
|
|
227
|
+
if (!val)
|
|
228
|
+
return null;
|
|
229
|
+
if ($.$mol_dev_format_body in val) {
|
|
230
|
+
try {
|
|
231
|
+
return val[$.$mol_dev_format_body]();
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return null;
|
|
238
|
+
},
|
|
190
239
|
});
|
|
191
240
|
function $mol_dev_format_native(obj) {
|
|
192
241
|
if (typeof obj === 'undefined')
|
|
@@ -252,6 +301,69 @@ var $;
|
|
|
252
301
|
$.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
|
|
253
302
|
'margin-left': '13px'
|
|
254
303
|
});
|
|
304
|
+
class Stack extends Array {
|
|
305
|
+
toString() {
|
|
306
|
+
return this.join('\n');
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
class Call extends Object {
|
|
310
|
+
type;
|
|
311
|
+
function;
|
|
312
|
+
method;
|
|
313
|
+
eval;
|
|
314
|
+
source;
|
|
315
|
+
offset;
|
|
316
|
+
pos;
|
|
317
|
+
object;
|
|
318
|
+
flags;
|
|
319
|
+
[Symbol.toStringTag];
|
|
320
|
+
constructor(call) {
|
|
321
|
+
super();
|
|
322
|
+
this.type = call.getTypeName() ?? '';
|
|
323
|
+
this.function = call.getFunctionName() ?? '';
|
|
324
|
+
this.method = call.getMethodName() ?? '';
|
|
325
|
+
if (this.method === this.function)
|
|
326
|
+
this.method = '';
|
|
327
|
+
this.pos = [call.getEnclosingLineNumber() ?? 0, call.getEnclosingColumnNumber() ?? 0];
|
|
328
|
+
this.eval = call.getEvalOrigin() ?? '';
|
|
329
|
+
this.source = call.getScriptNameOrSourceURL() ?? '';
|
|
330
|
+
this.object = call.getThis();
|
|
331
|
+
this.offset = call.getPosition();
|
|
332
|
+
const flags = [];
|
|
333
|
+
if (call.isAsync())
|
|
334
|
+
flags.push('async');
|
|
335
|
+
if (call.isConstructor())
|
|
336
|
+
flags.push('constructor');
|
|
337
|
+
if (call.isEval())
|
|
338
|
+
flags.push('eval');
|
|
339
|
+
if (call.isNative())
|
|
340
|
+
flags.push('native');
|
|
341
|
+
if (call.isPromiseAll())
|
|
342
|
+
flags.push('PromiseAll');
|
|
343
|
+
if (call.isToplevel())
|
|
344
|
+
flags.push('top');
|
|
345
|
+
this.flags = flags;
|
|
346
|
+
const type = this.type ? this.type + '.' : '';
|
|
347
|
+
const func = this.function || '<anon>';
|
|
348
|
+
const method = this.method ? ' [' + this.method + '] ' : '';
|
|
349
|
+
this[Symbol.toStringTag] = `${type}${func}${method}`;
|
|
350
|
+
}
|
|
351
|
+
[Symbol.toPrimitive]() {
|
|
352
|
+
return this.toString();
|
|
353
|
+
}
|
|
354
|
+
toString() {
|
|
355
|
+
const object = this.object || '';
|
|
356
|
+
const label = this[Symbol.toStringTag];
|
|
357
|
+
const source = `${this.source}:${this.pos.join(':')} #${this.offset}`;
|
|
358
|
+
return `\tat ${object}${label} (${source})`;
|
|
359
|
+
}
|
|
360
|
+
[$.$mol_dev_format_head]() {
|
|
361
|
+
return $.$mol_dev_format_div({}, $mol_dev_format_native(this), $.$mol_dev_format_shade(' '), ...this.object ? [
|
|
362
|
+
$mol_dev_format_native(this.object),
|
|
363
|
+
] : [], ...this.method ? [$.$mol_dev_format_shade(' ', ' [', this.method, ']')] : [], $.$mol_dev_format_shade(' ', this.flags.join(', ')));
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
Error.prepareStackTrace ??= (error, stack) => new Stack(...stack.map(call => new Call(call)));
|
|
255
367
|
})($ || ($ = {}));
|
|
256
368
|
|
|
257
369
|
;
|
|
@@ -493,16 +605,6 @@ var $;
|
|
|
493
605
|
$.$mol_owning_catch = $mol_owning_catch;
|
|
494
606
|
})($ || ($ = {}));
|
|
495
607
|
|
|
496
|
-
;
|
|
497
|
-
"use strict";
|
|
498
|
-
var $;
|
|
499
|
-
(function ($) {
|
|
500
|
-
function $mol_fail_hidden(error) {
|
|
501
|
-
throw error;
|
|
502
|
-
}
|
|
503
|
-
$.$mol_fail_hidden = $mol_fail_hidden;
|
|
504
|
-
})($ || ($ = {}));
|
|
505
|
-
|
|
506
608
|
;
|
|
507
609
|
"use strict";
|
|
508
610
|
|
|
@@ -908,7 +1010,7 @@ var $;
|
|
|
908
1010
|
if (left instanceof RegExp)
|
|
909
1011
|
return left.source === right.source && left.flags === right.flags;
|
|
910
1012
|
if (left instanceof Error)
|
|
911
|
-
return left.message === right.message && left.stack
|
|
1013
|
+
return left.message === right.message && $mol_compare_deep(left.stack, right.stack);
|
|
912
1014
|
let left_cache = $.$mol_compare_deep_cache.get(left);
|
|
913
1015
|
if (left_cache) {
|
|
914
1016
|
const right_cache = left_cache.get(right);
|
|
@@ -1803,6 +1905,21 @@ var $;
|
|
|
1803
1905
|
$.$mol_fail_catch = $mol_fail_catch;
|
|
1804
1906
|
})($ || ($ = {}));
|
|
1805
1907
|
|
|
1908
|
+
;
|
|
1909
|
+
"use strict";
|
|
1910
|
+
var $;
|
|
1911
|
+
(function ($) {
|
|
1912
|
+
function $mol_try(handler) {
|
|
1913
|
+
try {
|
|
1914
|
+
return handler();
|
|
1915
|
+
}
|
|
1916
|
+
catch (error) {
|
|
1917
|
+
return error;
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
$.$mol_try = $mol_try;
|
|
1921
|
+
})($ || ($ = {}));
|
|
1922
|
+
|
|
1806
1923
|
;
|
|
1807
1924
|
"use strict";
|
|
1808
1925
|
var $;
|
|
@@ -1812,7 +1929,7 @@ var $;
|
|
|
1812
1929
|
return false;
|
|
1813
1930
|
if (!$mol_fail_catch(error))
|
|
1814
1931
|
return false;
|
|
1815
|
-
|
|
1932
|
+
$mol_try(() => { $mol_fail_hidden(error); });
|
|
1816
1933
|
return true;
|
|
1817
1934
|
}
|
|
1818
1935
|
$.$mol_fail_log = $mol_fail_log;
|
|
@@ -2289,7 +2406,7 @@ var $;
|
|
|
2289
2406
|
get: () => stack_get() + '\n' + [
|
|
2290
2407
|
this.cause ?? 'no cause',
|
|
2291
2408
|
...this.errors.flatMap(e => [
|
|
2292
|
-
e.stack,
|
|
2409
|
+
String(e.stack),
|
|
2293
2410
|
...e instanceof $mol_error_mix || !e.cause ? [] : [e.cause]
|
|
2294
2411
|
])
|
|
2295
2412
|
].map(frame_normalize).join('\n')
|