mol_regexp 0.0.970 → 0.0.972
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.test.js +51 -47
- package/node.test.js.map +1 -1
- package/package.json +1 -1
package/node.test.js
CHANGED
|
@@ -1646,7 +1646,7 @@ var $;
|
|
|
1646
1646
|
try {
|
|
1647
1647
|
if (!having)
|
|
1648
1648
|
return false;
|
|
1649
|
-
if (typeof having !== 'object')
|
|
1649
|
+
if (typeof having !== 'object' && typeof having !== 'function')
|
|
1650
1650
|
return false;
|
|
1651
1651
|
if (having instanceof $mol_delegate)
|
|
1652
1652
|
return false;
|
|
@@ -1733,9 +1733,13 @@ var $;
|
|
|
1733
1733
|
return this.name;
|
|
1734
1734
|
}
|
|
1735
1735
|
destructor() { }
|
|
1736
|
+
static destructor() { }
|
|
1736
1737
|
toString() {
|
|
1737
1738
|
return this[Symbol.toStringTag] || this.constructor.name + '()';
|
|
1738
1739
|
}
|
|
1740
|
+
static toJSON() {
|
|
1741
|
+
return this[Symbol.toStringTag] || this.$.$mol_func_name(this);
|
|
1742
|
+
}
|
|
1739
1743
|
toJSON() {
|
|
1740
1744
|
return this.toString();
|
|
1741
1745
|
}
|
|
@@ -1746,6 +1750,52 @@ var $;
|
|
|
1746
1750
|
;
|
|
1747
1751
|
"use strict";
|
|
1748
1752
|
var $;
|
|
1753
|
+
(function ($) {
|
|
1754
|
+
const named = new WeakSet();
|
|
1755
|
+
function $mol_func_name(func) {
|
|
1756
|
+
let name = func.name;
|
|
1757
|
+
if (name?.length > 1)
|
|
1758
|
+
return name;
|
|
1759
|
+
if (named.has(func))
|
|
1760
|
+
return name;
|
|
1761
|
+
for (let key in this) {
|
|
1762
|
+
try {
|
|
1763
|
+
if (this[key] !== func)
|
|
1764
|
+
continue;
|
|
1765
|
+
name = key;
|
|
1766
|
+
Object.defineProperty(func, 'name', { value: name });
|
|
1767
|
+
break;
|
|
1768
|
+
}
|
|
1769
|
+
catch { }
|
|
1770
|
+
}
|
|
1771
|
+
named.add(func);
|
|
1772
|
+
return name;
|
|
1773
|
+
}
|
|
1774
|
+
$.$mol_func_name = $mol_func_name;
|
|
1775
|
+
function $mol_func_name_from(target, source) {
|
|
1776
|
+
Object.defineProperty(target, 'name', { value: source.name });
|
|
1777
|
+
return target;
|
|
1778
|
+
}
|
|
1779
|
+
$.$mol_func_name_from = $mol_func_name_from;
|
|
1780
|
+
})($ || ($ = {}));
|
|
1781
|
+
//mol/func/name/name.ts
|
|
1782
|
+
;
|
|
1783
|
+
"use strict";
|
|
1784
|
+
var $;
|
|
1785
|
+
(function ($_1) {
|
|
1786
|
+
$mol_test({
|
|
1787
|
+
'FQN of anon function'($) {
|
|
1788
|
+
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
1789
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
1790
|
+
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
1791
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
1792
|
+
},
|
|
1793
|
+
});
|
|
1794
|
+
})($ || ($ = {}));
|
|
1795
|
+
//mol/func/name/name.test.ts
|
|
1796
|
+
;
|
|
1797
|
+
"use strict";
|
|
1798
|
+
var $;
|
|
1749
1799
|
(function ($) {
|
|
1750
1800
|
const instances = new WeakSet();
|
|
1751
1801
|
function $mol_delegate(proto, target) {
|
|
@@ -2445,52 +2495,6 @@ var $;
|
|
|
2445
2495
|
;
|
|
2446
2496
|
"use strict";
|
|
2447
2497
|
var $;
|
|
2448
|
-
(function ($) {
|
|
2449
|
-
const named = new WeakSet();
|
|
2450
|
-
function $mol_func_name(func) {
|
|
2451
|
-
let name = func.name;
|
|
2452
|
-
if (name?.length > 1)
|
|
2453
|
-
return name;
|
|
2454
|
-
if (named.has(func))
|
|
2455
|
-
return name;
|
|
2456
|
-
for (let key in this) {
|
|
2457
|
-
try {
|
|
2458
|
-
if (this[key] !== func)
|
|
2459
|
-
continue;
|
|
2460
|
-
name = key;
|
|
2461
|
-
Object.defineProperty(func, 'name', { value: name });
|
|
2462
|
-
break;
|
|
2463
|
-
}
|
|
2464
|
-
catch { }
|
|
2465
|
-
}
|
|
2466
|
-
named.add(func);
|
|
2467
|
-
return name;
|
|
2468
|
-
}
|
|
2469
|
-
$.$mol_func_name = $mol_func_name;
|
|
2470
|
-
function $mol_func_name_from(target, source) {
|
|
2471
|
-
Object.defineProperty(target, 'name', { value: source.name });
|
|
2472
|
-
return target;
|
|
2473
|
-
}
|
|
2474
|
-
$.$mol_func_name_from = $mol_func_name_from;
|
|
2475
|
-
})($ || ($ = {}));
|
|
2476
|
-
//mol/func/name/name.ts
|
|
2477
|
-
;
|
|
2478
|
-
"use strict";
|
|
2479
|
-
var $;
|
|
2480
|
-
(function ($_1) {
|
|
2481
|
-
$mol_test({
|
|
2482
|
-
'FQN of anon function'($) {
|
|
2483
|
-
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
2484
|
-
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
2485
|
-
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
2486
|
-
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
2487
|
-
},
|
|
2488
|
-
});
|
|
2489
|
-
})($ || ($ = {}));
|
|
2490
|
-
//mol/func/name/name.test.ts
|
|
2491
|
-
;
|
|
2492
|
-
"use strict";
|
|
2493
|
-
var $;
|
|
2494
2498
|
(function ($) {
|
|
2495
2499
|
$mol_test({
|
|
2496
2500
|
'escape'() {
|