mol_jsx_lib 0.0.704 → 0.0.706
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.deps.json +1 -1
- package/node.js +15 -5
- package/node.js.map +1 -1
- package/node.mjs +15 -5
- package/node.test.js +64 -67
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +33 -33
- package/web.deps.json +1 -1
- package/web.js +67 -57
- package/web.js.map +1 -1
- package/web.mjs +67 -57
- package/web.test.js +44 -57
- package/web.test.js.map +1 -1
package/node.mjs
CHANGED
|
@@ -349,7 +349,7 @@ var $;
|
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
351
|
error(message, Class = Error) {
|
|
352
|
-
return new Class(`${message}${this}`);
|
|
352
|
+
return new Class(`${message} (${this})`);
|
|
353
353
|
}
|
|
354
354
|
span(row, col, length) {
|
|
355
355
|
return new $mol_span(this.uri, this.source, row, col, length);
|
|
@@ -364,11 +364,11 @@ var $;
|
|
|
364
364
|
if (end < 0)
|
|
365
365
|
end += len;
|
|
366
366
|
if (begin < 0 || begin > len)
|
|
367
|
-
this.$.$mol_fail(`Begin value '${begin}' out of range
|
|
367
|
+
this.$.$mol_fail(this.error(`Begin value '${begin}' out of range`, RangeError));
|
|
368
368
|
if (end < 0 || end > len)
|
|
369
|
-
this.$.$mol_fail(`End value '${end}' out of range
|
|
369
|
+
this.$.$mol_fail(this.error(`End value '${end}' out of range`, RangeError));
|
|
370
370
|
if (end < begin)
|
|
371
|
-
this.$.$mol_fail(`End value '${end}' can't be less than begin value
|
|
371
|
+
this.$.$mol_fail(this.error(`End value '${end}' can't be less than begin value`, RangeError));
|
|
372
372
|
return this.span(this.row, this.col + begin, end - begin);
|
|
373
373
|
}
|
|
374
374
|
}
|
|
@@ -1883,7 +1883,17 @@ var $;
|
|
|
1883
1883
|
break reuse;
|
|
1884
1884
|
return existen;
|
|
1885
1885
|
}
|
|
1886
|
-
|
|
1886
|
+
const next = new $mol_wire_task(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, args);
|
|
1887
|
+
if (existen?.temp) {
|
|
1888
|
+
$$.$mol_log3_warn({
|
|
1889
|
+
place: '$mol_wire_task',
|
|
1890
|
+
message: `Non idempotency`,
|
|
1891
|
+
existen,
|
|
1892
|
+
next,
|
|
1893
|
+
hint: 'Ignore it',
|
|
1894
|
+
});
|
|
1895
|
+
}
|
|
1896
|
+
return next;
|
|
1887
1897
|
};
|
|
1888
1898
|
}
|
|
1889
1899
|
get temp() {
|
package/node.test.js
CHANGED
|
@@ -341,7 +341,7 @@ var $;
|
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
343
|
error(message, Class = Error) {
|
|
344
|
-
return new Class(`${message}${this}`);
|
|
344
|
+
return new Class(`${message} (${this})`);
|
|
345
345
|
}
|
|
346
346
|
span(row, col, length) {
|
|
347
347
|
return new $mol_span(this.uri, this.source, row, col, length);
|
|
@@ -356,11 +356,11 @@ var $;
|
|
|
356
356
|
if (end < 0)
|
|
357
357
|
end += len;
|
|
358
358
|
if (begin < 0 || begin > len)
|
|
359
|
-
this.$.$mol_fail(`Begin value '${begin}' out of range
|
|
359
|
+
this.$.$mol_fail(this.error(`Begin value '${begin}' out of range`, RangeError));
|
|
360
360
|
if (end < 0 || end > len)
|
|
361
|
-
this.$.$mol_fail(`End value '${end}' out of range
|
|
361
|
+
this.$.$mol_fail(this.error(`End value '${end}' out of range`, RangeError));
|
|
362
362
|
if (end < begin)
|
|
363
|
-
this.$.$mol_fail(`End value '${end}' can't be less than begin value
|
|
363
|
+
this.$.$mol_fail(this.error(`End value '${end}' can't be less than begin value`, RangeError));
|
|
364
364
|
return this.span(this.row, this.col + begin, end - begin);
|
|
365
365
|
}
|
|
366
366
|
}
|
|
@@ -1875,7 +1875,17 @@ var $;
|
|
|
1875
1875
|
break reuse;
|
|
1876
1876
|
return existen;
|
|
1877
1877
|
}
|
|
1878
|
-
|
|
1878
|
+
const next = new $mol_wire_task(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, args);
|
|
1879
|
+
if (existen?.temp) {
|
|
1880
|
+
$$.$mol_log3_warn({
|
|
1881
|
+
place: '$mol_wire_task',
|
|
1882
|
+
message: `Non idempotency`,
|
|
1883
|
+
existen,
|
|
1884
|
+
next,
|
|
1885
|
+
hint: 'Ignore it',
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
return next;
|
|
1879
1889
|
};
|
|
1880
1890
|
}
|
|
1881
1891
|
get temp() {
|
|
@@ -2859,17 +2869,6 @@ var $;
|
|
|
2859
2869
|
;
|
|
2860
2870
|
"use strict";
|
|
2861
2871
|
var $;
|
|
2862
|
-
(function ($) {
|
|
2863
|
-
function $mol_dom_serialize(node) {
|
|
2864
|
-
const serializer = new $mol_dom_context.XMLSerializer;
|
|
2865
|
-
return serializer.serializeToString(node);
|
|
2866
|
-
}
|
|
2867
|
-
$.$mol_dom_serialize = $mol_dom_serialize;
|
|
2868
|
-
})($ || ($ = {}));
|
|
2869
|
-
//mol/dom/serialize/serialize.ts
|
|
2870
|
-
;
|
|
2871
|
-
"use strict";
|
|
2872
|
-
var $;
|
|
2873
2872
|
(function ($) {
|
|
2874
2873
|
function $mol_assert_ok(value) {
|
|
2875
2874
|
if (value)
|
|
@@ -2890,14 +2889,12 @@ var $;
|
|
|
2890
2889
|
handler();
|
|
2891
2890
|
}
|
|
2892
2891
|
catch (error) {
|
|
2893
|
-
if (!ErrorRight)
|
|
2894
|
-
return error;
|
|
2895
2892
|
$.$mol_fail = fail;
|
|
2896
2893
|
if (typeof ErrorRight === 'string') {
|
|
2897
2894
|
$mol_assert_equal(error.message, ErrorRight);
|
|
2898
2895
|
}
|
|
2899
2896
|
else {
|
|
2900
|
-
$
|
|
2897
|
+
$mol_assert_equal(error instanceof ErrorRight, true);
|
|
2901
2898
|
}
|
|
2902
2899
|
return error;
|
|
2903
2900
|
}
|
|
@@ -2907,58 +2904,47 @@ var $;
|
|
|
2907
2904
|
$mol_fail(new Error('Not failed'));
|
|
2908
2905
|
}
|
|
2909
2906
|
$.$mol_assert_fail = $mol_assert_fail;
|
|
2910
|
-
function $
|
|
2911
|
-
|
|
2912
|
-
for (let j = 0; j < args.length; ++j) {
|
|
2913
|
-
if (i === j)
|
|
2914
|
-
continue;
|
|
2915
|
-
if (Number.isNaN(args[i]) && Number.isNaN(args[j]))
|
|
2916
|
-
continue;
|
|
2917
|
-
if (args[i] !== args[j])
|
|
2918
|
-
$mol_fail(new Error(`Not equal (${i + 1}:${j + 1})\n${args[i]}\n${args[j]}`));
|
|
2919
|
-
}
|
|
2920
|
-
}
|
|
2907
|
+
function $mol_assert_like(...args) {
|
|
2908
|
+
$mol_assert_equal(...args);
|
|
2921
2909
|
}
|
|
2922
|
-
$.$
|
|
2910
|
+
$.$mol_assert_like = $mol_assert_like;
|
|
2923
2911
|
function $mol_assert_unique(...args) {
|
|
2924
2912
|
for (let i = 0; i < args.length; ++i) {
|
|
2925
2913
|
for (let j = 0; j < args.length; ++j) {
|
|
2926
2914
|
if (i === j)
|
|
2927
2915
|
continue;
|
|
2928
|
-
if (
|
|
2929
|
-
|
|
2930
|
-
}
|
|
2916
|
+
if (!$mol_compare_deep(args[i], args[j]))
|
|
2917
|
+
continue;
|
|
2918
|
+
$mol_fail(new Error(`args[${i}] = args[${j}] = ${args[i]}`));
|
|
2931
2919
|
}
|
|
2932
2920
|
}
|
|
2933
2921
|
}
|
|
2934
2922
|
$.$mol_assert_unique = $mol_assert_unique;
|
|
2935
|
-
function $
|
|
2936
|
-
for (let
|
|
2937
|
-
if (
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
return val;
|
|
2943
|
-
if ('outerHTML' in val)
|
|
2944
|
-
return val.outerHTML;
|
|
2945
|
-
try {
|
|
2946
|
-
return JSON.stringify(val, (k, v) => typeof v === 'bigint' ? String(v) : v, '\t');
|
|
2947
|
-
}
|
|
2948
|
-
catch (error) {
|
|
2949
|
-
console.error(error);
|
|
2950
|
-
return val;
|
|
2951
|
-
}
|
|
2952
|
-
};
|
|
2953
|
-
return $mol_fail(new Error(`Not like (1:${+index + 2})\n${print(head)}\n---\n${print(value)}`));
|
|
2954
|
-
}
|
|
2923
|
+
function $mol_assert_equal(...args) {
|
|
2924
|
+
for (let i = 1; i < args.length; ++i) {
|
|
2925
|
+
if ($mol_compare_deep(args[0], args[i]))
|
|
2926
|
+
continue;
|
|
2927
|
+
if (args[0] instanceof Element && args[i] instanceof Element && args[0].outerHTML === args[i].outerHTML)
|
|
2928
|
+
continue;
|
|
2929
|
+
return $mol_fail(new Error(`args[0] ≠ args[${i}]\n${print(args[0])}\n---\n${print(args[i])}`));
|
|
2955
2930
|
}
|
|
2956
2931
|
}
|
|
2957
|
-
$.$
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2932
|
+
$.$mol_assert_equal = $mol_assert_equal;
|
|
2933
|
+
const print = (val) => {
|
|
2934
|
+
if (!val)
|
|
2935
|
+
return val;
|
|
2936
|
+
if (typeof val !== 'object')
|
|
2937
|
+
return val;
|
|
2938
|
+
if ('outerHTML' in val)
|
|
2939
|
+
return val.outerHTML;
|
|
2940
|
+
try {
|
|
2941
|
+
return JSON.stringify(val, (k, v) => typeof v === 'bigint' ? String(v) : v, '\t');
|
|
2942
|
+
}
|
|
2943
|
+
catch (error) {
|
|
2944
|
+
console.error(error);
|
|
2945
|
+
return val;
|
|
2946
|
+
}
|
|
2947
|
+
};
|
|
2962
2948
|
})($ || ($ = {}));
|
|
2963
2949
|
//mol/assert/assert.ts
|
|
2964
2950
|
;
|
|
@@ -2979,10 +2965,10 @@ var $;
|
|
|
2979
2965
|
$mol_assert_equal(2, 2, 2);
|
|
2980
2966
|
},
|
|
2981
2967
|
'two must be unique'() {
|
|
2982
|
-
$mol_assert_unique([
|
|
2968
|
+
$mol_assert_unique([2], [3]);
|
|
2983
2969
|
},
|
|
2984
2970
|
'three must be unique'() {
|
|
2985
|
-
$mol_assert_unique([
|
|
2971
|
+
$mol_assert_unique([1], [2], [3]);
|
|
2986
2972
|
},
|
|
2987
2973
|
'two must be alike'() {
|
|
2988
2974
|
$mol_assert_like([3], [3]);
|
|
@@ -3139,14 +3125,14 @@ var $;
|
|
|
3139
3125
|
},
|
|
3140
3126
|
'slice span - out of range'($) {
|
|
3141
3127
|
const span = new $mol_span('test.ts', '', 1, 3, 5);
|
|
3142
|
-
$mol_assert_fail(() => span.slice(-1, 3));
|
|
3143
|
-
$mol_assert_fail(() => span.slice(1, 6));
|
|
3144
|
-
$mol_assert_fail(() => span.slice(1, 10));
|
|
3128
|
+
$mol_assert_fail(() => span.slice(-1, 3), `End value '3' can't be less than begin value (test.ts#1:3/5)`);
|
|
3129
|
+
$mol_assert_fail(() => span.slice(1, 6), `End value '6' out of range (test.ts#1:3/5)`);
|
|
3130
|
+
$mol_assert_fail(() => span.slice(1, 10), `End value '10' out of range (test.ts#1:3/5)`);
|
|
3145
3131
|
},
|
|
3146
3132
|
'error handling'($) {
|
|
3147
3133
|
const span = new $mol_span('test.ts', '', 1, 3, 4);
|
|
3148
|
-
const error = span.error('Some error
|
|
3149
|
-
$mol_assert_equal(error.message, 'Some error
|
|
3134
|
+
const error = span.error('Some error');
|
|
3135
|
+
$mol_assert_equal(error.message, 'Some error (test.ts#1:3/4)');
|
|
3150
3136
|
}
|
|
3151
3137
|
});
|
|
3152
3138
|
})($ || ($ = {}));
|
|
@@ -4460,7 +4446,7 @@ var $;
|
|
|
4460
4446
|
], App, "result", null);
|
|
4461
4447
|
$mol_assert_equal(App.result(), 1);
|
|
4462
4448
|
App.condition(true);
|
|
4463
|
-
$mol_assert_fail(() => App.result());
|
|
4449
|
+
$mol_assert_fail(() => App.result(), 'test error');
|
|
4464
4450
|
App.condition(false);
|
|
4465
4451
|
$mol_assert_equal(App.result(), 1);
|
|
4466
4452
|
},
|
|
@@ -4795,6 +4781,17 @@ var $;
|
|
|
4795
4781
|
;
|
|
4796
4782
|
"use strict";
|
|
4797
4783
|
var $;
|
|
4784
|
+
(function ($) {
|
|
4785
|
+
function $mol_dom_serialize(node) {
|
|
4786
|
+
const serializer = new $mol_dom_context.XMLSerializer;
|
|
4787
|
+
return serializer.serializeToString(node);
|
|
4788
|
+
}
|
|
4789
|
+
$.$mol_dom_serialize = $mol_dom_serialize;
|
|
4790
|
+
})($ || ($ = {}));
|
|
4791
|
+
//mol/dom/serialize/serialize.ts
|
|
4792
|
+
;
|
|
4793
|
+
"use strict";
|
|
4794
|
+
var $;
|
|
4798
4795
|
(function ($_1) {
|
|
4799
4796
|
$mol_test({
|
|
4800
4797
|
'Class as component'() {
|