mol_dump_lib 0.0.884 → 0.0.886

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.js CHANGED
@@ -76,15 +76,15 @@ var $;
76
76
  "use strict";
77
77
  var $;
78
78
  (function ($) {
79
- const catched = new WeakMap();
79
+ const catched = new WeakSet();
80
80
  function $mol_fail_catch(error) {
81
81
  if (typeof error !== 'object')
82
82
  return false;
83
83
  if ($mol_promise_like(error))
84
84
  $mol_fail_hidden(error);
85
- if (catched.get(error))
85
+ if (catched.has(error))
86
86
  return false;
87
- catched.set(error, true);
87
+ catched.add(error);
88
88
  return true;
89
89
  }
90
90
  $.$mol_fail_catch = $mol_fail_catch;
@@ -4231,6 +4231,16 @@ var $;
4231
4231
  $.$mol_dom_render_events = $mol_dom_render_events;
4232
4232
  })($ || ($ = {}));
4233
4233
 
4234
+ ;
4235
+ "use strict";
4236
+ var $;
4237
+ (function ($) {
4238
+ function $mol_error_message(error) {
4239
+ return String((error instanceof Error ? error.message : null) || error) || 'Unknown';
4240
+ }
4241
+ $.$mol_error_message = $mol_error_message;
4242
+ })($ || ($ = {}));
4243
+
4234
4244
  ;
4235
4245
  "use strict";
4236
4246
  var $;
@@ -4472,8 +4482,8 @@ var $;
4472
4482
  if ($mol_promise_like(error))
4473
4483
  break render;
4474
4484
  try {
4475
- const message = error.message || error;
4476
- node.innerText = message.replace(/^|$/mg, '\xA0\xA0');
4485
+ ;
4486
+ node.innerText = this.$.$mol_error_message(error).replace(/^|$/mg, '\xA0\xA0');
4477
4487
  }
4478
4488
  catch { }
4479
4489
  }
@@ -6213,6 +6223,10 @@ var $;
6213
6223
  if(next !== undefined) return next;
6214
6224
  return null;
6215
6225
  }
6226
+ status(next){
6227
+ if(next !== undefined) return next;
6228
+ return [];
6229
+ }
6216
6230
  event(){
6217
6231
  return {
6218
6232
  ...(super.event()),
@@ -6244,6 +6258,7 @@ var $;
6244
6258
  ($mol_mem(($.$mol_button.prototype), "event_key_press"));
6245
6259
  ($mol_mem(($.$mol_button.prototype), "click"));
6246
6260
  ($mol_mem(($.$mol_button.prototype), "event_click"));
6261
+ ($mol_mem(($.$mol_button.prototype), "status"));
6247
6262
  ($mol_mem(($.$mol_button.prototype), "Speck"));
6248
6263
 
6249
6264
 
@@ -6366,7 +6381,6 @@ var $;
6366
6381
  var $$;
6367
6382
  (function ($$) {
6368
6383
  class $mol_button extends $.$mol_button {
6369
- status(next = [null]) { return next; }
6370
6384
  disabled() {
6371
6385
  return !this.enabled();
6372
6386
  }
@@ -6394,13 +6408,13 @@ var $;
6394
6408
  return this.enabled() ? super.tab_index() : -1;
6395
6409
  }
6396
6410
  error() {
6397
- const [error] = this.status();
6411
+ const error = this.status()?.[0];
6398
6412
  if (!error)
6399
6413
  return '';
6400
- if (error instanceof Promise) {
6414
+ if ($mol_promise_like(error)) {
6401
6415
  return $mol_fail_hidden(error);
6402
6416
  }
6403
- return String(error.message ?? error);
6417
+ return this.$.$mol_error_message(error);
6404
6418
  }
6405
6419
  hint_safe() {
6406
6420
  try {
@@ -6418,9 +6432,6 @@ var $;
6418
6432
  ];
6419
6433
  }
6420
6434
  }
6421
- __decorate([
6422
- $mol_mem
6423
- ], $mol_button.prototype, "status", null);
6424
6435
  $$.$mol_button = $mol_button;
6425
6436
  })($$ = $.$$ || ($.$$ = {}));
6426
6437
  })($ || ($ = {}));