mol_wire_lib 1.0.1231 → 1.0.1233
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 +6 -4
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +16 -5
- package/node.js.map +1 -1
- package/node.mjs +16 -5
- package/node.test.js +40 -5
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +6 -4
- package/web.d.ts.map +1 -1
- package/web.deps.json +1 -1
- package/web.js +16 -5
- package/web.js.map +1 -1
- package/web.mjs +16 -5
- package/web.test.js +24 -0
- package/web.test.js.map +1 -1
package/web.mjs
CHANGED
|
@@ -850,6 +850,12 @@ var $;
|
|
|
850
850
|
};
|
|
851
851
|
});
|
|
852
852
|
}
|
|
853
|
+
destructor() {
|
|
854
|
+
super.destructor();
|
|
855
|
+
if ($mol_owning_check(this, this.cache)) {
|
|
856
|
+
this.cache.destructor();
|
|
857
|
+
}
|
|
858
|
+
}
|
|
853
859
|
}
|
|
854
860
|
$.$mol_wire_fiber = $mol_wire_fiber;
|
|
855
861
|
})($ || ($ = {}));
|
|
@@ -1076,7 +1082,8 @@ var $;
|
|
|
1076
1082
|
$$.$mol_log3_warn({
|
|
1077
1083
|
place: '$mol_wire_task',
|
|
1078
1084
|
message: `Non idempotency`,
|
|
1079
|
-
|
|
1085
|
+
sub,
|
|
1086
|
+
pubs: [...sub?.pub_list ?? [], existen],
|
|
1080
1087
|
next,
|
|
1081
1088
|
hint: 'Ignore it',
|
|
1082
1089
|
});
|
|
@@ -1099,6 +1106,14 @@ var $;
|
|
|
1099
1106
|
this.cursor = $mol_wire_cursor.fresh;
|
|
1100
1107
|
if (next !== prev)
|
|
1101
1108
|
this.emit();
|
|
1109
|
+
if ($mol_owning_catch(this, next)) {
|
|
1110
|
+
try {
|
|
1111
|
+
next[Symbol.toStringTag] = this[Symbol.toStringTag];
|
|
1112
|
+
}
|
|
1113
|
+
catch {
|
|
1114
|
+
Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1102
1117
|
return next;
|
|
1103
1118
|
}
|
|
1104
1119
|
this.cursor = $mol_wire_cursor.final;
|
|
@@ -1357,10 +1372,6 @@ var $;
|
|
|
1357
1372
|
}
|
|
1358
1373
|
destructor() {
|
|
1359
1374
|
super.destructor();
|
|
1360
|
-
const prev = this.cache;
|
|
1361
|
-
if ($mol_owning_check(this, prev)) {
|
|
1362
|
-
prev.destructor();
|
|
1363
|
-
}
|
|
1364
1375
|
if (this.pub_from === 0) {
|
|
1365
1376
|
;
|
|
1366
1377
|
(this.host ?? this.task)[this.field()] = null;
|
package/web.test.js
CHANGED
|
@@ -178,6 +178,17 @@ var $;
|
|
|
178
178
|
;
|
|
179
179
|
"use strict";
|
|
180
180
|
|
|
181
|
+
;
|
|
182
|
+
"use strict";
|
|
183
|
+
var $;
|
|
184
|
+
(function ($) {
|
|
185
|
+
function $mol_dom_serialize(node) {
|
|
186
|
+
const serializer = new $mol_dom_context.XMLSerializer;
|
|
187
|
+
return serializer.serializeToString(node);
|
|
188
|
+
}
|
|
189
|
+
$.$mol_dom_serialize = $mol_dom_serialize;
|
|
190
|
+
})($ || ($ = {}));
|
|
191
|
+
|
|
181
192
|
;
|
|
182
193
|
"use strict";
|
|
183
194
|
var $;
|
|
@@ -335,6 +346,19 @@ var $;
|
|
|
335
346
|
"!");
|
|
336
347
|
$mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
|
|
337
348
|
},
|
|
349
|
+
'Make fragment'() {
|
|
350
|
+
const dom = $mol_jsx($mol_jsx_frag, null,
|
|
351
|
+
$mol_jsx("br", null),
|
|
352
|
+
$mol_jsx("hr", null));
|
|
353
|
+
$mol_assert_equal($mol_dom_serialize(dom), '<br xmlns="http://www.w3.org/1999/xhtml" /><hr xmlns="http://www.w3.org/1999/xhtml" />');
|
|
354
|
+
},
|
|
355
|
+
'Spread fragment'() {
|
|
356
|
+
const dom = $mol_jsx("div", null,
|
|
357
|
+
$mol_jsx($mol_jsx_frag, null,
|
|
358
|
+
$mol_jsx("br", null),
|
|
359
|
+
$mol_jsx("hr", null)));
|
|
360
|
+
$mol_assert_equal(dom.outerHTML, '<div><br><hr></div>');
|
|
361
|
+
},
|
|
338
362
|
'Function as component'() {
|
|
339
363
|
const Button = (props, target) => {
|
|
340
364
|
return $mol_jsx("button", { title: props.hint }, target());
|