mol_regexp 0.0.673 → 0.0.674

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 CHANGED
@@ -321,6 +321,24 @@ var $;
321
321
  //mol/regexp/regexp.ts
322
322
  ;
323
323
  "use strict";
324
+ //mol/type/error/error.ts
325
+ ;
326
+ "use strict";
327
+ //mol/type/assert/assert.ts
328
+ ;
329
+ "use strict";
330
+ //mol/type/assert/assert.test.ts
331
+ ;
332
+ "use strict";
333
+ //mol/type/equals/equals.test.ts
334
+ ;
335
+ "use strict";
336
+ //mol/type/merge/merge.test.ts
337
+ ;
338
+ "use strict";
339
+ //mol/type/intersect/intersect.test.ts
340
+ ;
341
+ "use strict";
324
342
  var $;
325
343
  (function ($) {
326
344
  function $mol_fail_hidden(error) {
@@ -694,24 +712,12 @@ var $;
694
712
  //mol/dom/render/children/children.ts
695
713
  ;
696
714
  "use strict";
697
- //mol/type/error/error.ts
698
- ;
699
- "use strict";
700
- //mol/type/assert/assert.test.ts
701
- ;
702
- "use strict";
703
- //mol/type/assert/assert.ts
704
- ;
705
- "use strict";
706
- //mol/type/equals/equals.test.ts
715
+ //mol/type/partial/deep/deep.ts
707
716
  ;
708
717
  "use strict";
709
718
  //mol/type/partial/deep/deep.test.ts
710
719
  ;
711
720
  "use strict";
712
- //mol/type/partial/deep/deep.ts
713
- ;
714
- "use strict";
715
721
  var $;
716
722
  (function ($) {
717
723
  $mol_test({
@@ -1156,38 +1162,6 @@ var $;
1156
1162
  ;
1157
1163
  "use strict";
1158
1164
  var $;
1159
- (function ($) {
1160
- $mol_test({
1161
- 'must be false'() {
1162
- $mol_assert_not(0);
1163
- },
1164
- 'must be true'() {
1165
- $mol_assert_ok(1);
1166
- },
1167
- 'two must be equal'() {
1168
- $mol_assert_equal(2, 2);
1169
- },
1170
- 'three must be equal'() {
1171
- $mol_assert_equal(2, 2, 2);
1172
- },
1173
- 'two must be unique'() {
1174
- $mol_assert_unique([3], [3]);
1175
- },
1176
- 'three must be unique'() {
1177
- $mol_assert_unique([3], [3], [3]);
1178
- },
1179
- 'two must be alike'() {
1180
- $mol_assert_like([3], [3]);
1181
- },
1182
- 'three must be alike'() {
1183
- $mol_assert_like([3], [3], [3]);
1184
- },
1185
- });
1186
- })($ || ($ = {}));
1187
- //mol/assert/assert.test.ts
1188
- ;
1189
- "use strict";
1190
- var $;
1191
1165
  (function ($) {
1192
1166
  function $mol_assert_ok(value) {
1193
1167
  if (value)
@@ -1281,121 +1255,47 @@ var $;
1281
1255
  //mol/assert/assert.ts
1282
1256
  ;
1283
1257
  "use strict";
1284
- //mol/type/merge/merge.test.ts
1285
- ;
1286
- "use strict";
1287
- //mol/type/intersect/intersect.test.ts
1288
- ;
1289
- "use strict";
1290
- var $;
1291
- (function ($) {
1292
- $.$mol_ambient_ref = Symbol('$mol_ambient_ref');
1293
- function $mol_ambient(overrides) {
1294
- return Object.setPrototypeOf(overrides, this || $);
1295
- }
1296
- $.$mol_ambient = $mol_ambient;
1297
- })($ || ($ = {}));
1298
- //mol/ambient/ambient.ts
1299
- ;
1300
- "use strict";
1301
1258
  var $;
1302
1259
  (function ($) {
1303
1260
  $mol_test({
1304
- 'get'() {
1305
- const proxy = $mol_delegate({}, () => ({ foo: 777 }));
1306
- $mol_assert_equal(proxy.foo, 777);
1307
- },
1308
- 'has'() {
1309
- const proxy = $mol_delegate({}, () => ({ foo: 777 }));
1310
- $mol_assert_equal('foo' in proxy, true);
1261
+ 'must be false'() {
1262
+ $mol_assert_not(0);
1311
1263
  },
1312
- 'set'() {
1313
- const target = { foo: 777 };
1314
- const proxy = $mol_delegate({}, () => target);
1315
- proxy.foo = 123;
1316
- $mol_assert_equal(target.foo, 123);
1264
+ 'must be true'() {
1265
+ $mol_assert_ok(1);
1317
1266
  },
1318
- 'getOwnPropertyDescriptor'() {
1319
- const proxy = $mol_delegate({}, () => ({ foo: 777 }));
1320
- $mol_assert_like(Object.getOwnPropertyDescriptor(proxy, 'foo'), {
1321
- value: 777,
1322
- writable: true,
1323
- enumerable: true,
1324
- configurable: true,
1325
- });
1267
+ 'two must be equal'() {
1268
+ $mol_assert_equal(2, 2);
1326
1269
  },
1327
- 'ownKeys'() {
1328
- const proxy = $mol_delegate({}, () => ({ foo: 777, [Symbol.toStringTag]: 'bar' }));
1329
- $mol_assert_like(Reflect.ownKeys(proxy), ['foo', Symbol.toStringTag]);
1270
+ 'three must be equal'() {
1271
+ $mol_assert_equal(2, 2, 2);
1330
1272
  },
1331
- 'getPrototypeOf'() {
1332
- class Foo {
1333
- }
1334
- const proxy = $mol_delegate({}, () => new Foo);
1335
- $mol_assert_equal(Object.getPrototypeOf(proxy), Foo.prototype);
1273
+ 'two must be unique'() {
1274
+ $mol_assert_unique([3], [3]);
1336
1275
  },
1337
- 'setPrototypeOf'() {
1338
- class Foo {
1339
- }
1340
- const target = {};
1341
- const proxy = $mol_delegate({}, () => target);
1342
- Object.setPrototypeOf(proxy, Foo.prototype);
1343
- $mol_assert_equal(Object.getPrototypeOf(target), Foo.prototype);
1276
+ 'three must be unique'() {
1277
+ $mol_assert_unique([3], [3], [3]);
1344
1278
  },
1345
- 'instanceof'() {
1346
- class Foo {
1347
- }
1348
- const proxy = $mol_delegate({}, () => new Foo);
1349
- $mol_assert_ok(proxy instanceof Foo);
1350
- $mol_assert_ok(proxy instanceof $mol_delegate);
1279
+ 'two must be alike'() {
1280
+ $mol_assert_like([3], [3]);
1351
1281
  },
1352
- 'autobind'() {
1353
- class Foo {
1354
- }
1355
- const proxy = $mol_delegate({}, () => new Foo);
1356
- $mol_assert_ok(proxy instanceof Foo);
1357
- $mol_assert_ok(proxy instanceof $mol_delegate);
1282
+ 'three must be alike'() {
1283
+ $mol_assert_like([3], [3], [3]);
1358
1284
  },
1359
1285
  });
1360
1286
  })($ || ($ = {}));
1361
- //mol/delegate/delegate.test.ts
1287
+ //mol/assert/assert.test.ts
1362
1288
  ;
1363
1289
  "use strict";
1364
1290
  var $;
1365
1291
  (function ($) {
1366
- const instances = new WeakSet();
1367
- function $mol_delegate(proto, target) {
1368
- const proxy = new Proxy(proto, {
1369
- get: (_, field) => {
1370
- const obj = target();
1371
- let val = Reflect.get(obj, field);
1372
- if (typeof val === 'function') {
1373
- val = val.bind(obj);
1374
- }
1375
- return val;
1376
- },
1377
- has: (_, field) => Reflect.has(target(), field),
1378
- set: (_, field, value) => Reflect.set(target(), field, value),
1379
- getOwnPropertyDescriptor: (_, field) => Reflect.getOwnPropertyDescriptor(target(), field),
1380
- ownKeys: () => Reflect.ownKeys(target()),
1381
- getPrototypeOf: () => Reflect.getPrototypeOf(target()),
1382
- setPrototypeOf: (_, donor) => Reflect.setPrototypeOf(target(), donor),
1383
- isExtensible: () => Reflect.isExtensible(target()),
1384
- preventExtensions: () => Reflect.preventExtensions(target()),
1385
- apply: (_, self, args) => Reflect.apply(target(), self, args),
1386
- construct: (_, args, retarget) => Reflect.construct(target(), args, retarget),
1387
- defineProperty: (_, field, descr) => Reflect.defineProperty(target(), field, descr),
1388
- deleteProperty: (_, field) => Reflect.deleteProperty(target(), field),
1389
- });
1390
- instances.add(proxy);
1391
- return proxy;
1292
+ $.$mol_ambient_ref = Symbol('$mol_ambient_ref');
1293
+ function $mol_ambient(overrides) {
1294
+ return Object.setPrototypeOf(overrides, this || $);
1392
1295
  }
1393
- $.$mol_delegate = $mol_delegate;
1394
- Reflect.defineProperty($mol_delegate, Symbol.hasInstance, {
1395
- value: (obj) => instances.has(obj),
1396
- });
1296
+ $.$mol_ambient = $mol_ambient;
1397
1297
  })($ || ($ = {}));
1398
- //mol/delegate/delegate.ts
1298
+ //mol/ambient/ambient.ts
1399
1299
  ;
1400
1300
  "use strict";
1401
1301
  var $;
@@ -1454,10 +1354,10 @@ var $;
1454
1354
  //mol/owning/owning.ts
1455
1355
  ;
1456
1356
  "use strict";
1457
- //mol/type/writable/writable.test.ts
1357
+ //mol/type/writable/writable.ts
1458
1358
  ;
1459
1359
  "use strict";
1460
- //mol/type/writable/writable.ts
1360
+ //mol/type/writable/writable.test.ts
1461
1361
  ;
1462
1362
  "use strict";
1463
1363
  var $;
@@ -1504,66 +1404,6 @@ var $;
1504
1404
  ;
1505
1405
  "use strict";
1506
1406
  var $;
1507
- (function ($_1) {
1508
- $mol_test({
1509
- 'tree parsing'() {
1510
- $mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub.length, 2);
1511
- $mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub[1].type, "bar");
1512
- $mol_assert_equal($mol_tree.fromString("foo\n\n\n").sub.length, 1);
1513
- $mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub.length, 2);
1514
- $mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub[1].data, "bar");
1515
- $mol_assert_equal($mol_tree.fromString("foo bar \\pol").sub[0].sub[0].sub[0].data, "pol");
1516
- $mol_assert_equal($mol_tree.fromString("foo bar\n\t\\pol\n\t\\men").sub[0].sub[0].sub[1].data, "men");
1517
- $mol_assert_equal($mol_tree.fromString('foo bar \\text\n').toString(), 'foo bar \\text\n');
1518
- },
1519
- 'inserting'() {
1520
- $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 'a', 'b', 'c').toString(), 'a b \\\n');
1521
- $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 'a', 'b', 'c', 'd').toString(), 'a b c \\\n');
1522
- $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 0, 0, 0).toString(), 'a b \\\n');
1523
- $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 0, 0, 0, 0).toString(), 'a b \\\n\t\\\n');
1524
- $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, null, null, null).toString(), 'a b \\\n');
1525
- $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, null, null, null, null).toString(), 'a b \\\n\t\\\n');
1526
- },
1527
- 'fromJSON'() {
1528
- $mol_assert_equal($mol_tree.fromJSON([]).toString(), '/\n');
1529
- $mol_assert_equal($mol_tree.fromJSON([false, true]).toString(), '/\n\tfalse\n\ttrue\n');
1530
- $mol_assert_equal($mol_tree.fromJSON([0, 1, 2.3]).toString(), '/\n\t0\n\t1\n\t2.3\n');
1531
- $mol_assert_equal($mol_tree.fromJSON(['', 'foo', 'bar\nbaz']).toString(), '/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n');
1532
- $mol_assert_equal($mol_tree.fromJSON({ 'foo': false, 'bar\nbaz': 'lol' }).toString(), '*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n');
1533
- },
1534
- 'toJSON'() {
1535
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n').sub[0]), '[]');
1536
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\tfalse\n\ttrue\n').sub[0]), '[false,true]');
1537
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t0\n\t1\n\t2.3\n').sub[0]), '[0,1,2.3]');
1538
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n').sub[0]), '["","foo","bar\\nbaz"]');
1539
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n').sub[0]), '{"foo":false,"bar\\nbaz":"lol"}');
1540
- },
1541
- 'hack'() {
1542
- const res = $mol_tree.fromString(`foo bar xxx`).hack({
1543
- '': (tree, context) => [tree.hack(context)],
1544
- 'bar': (tree, context) => [tree.hack(context).clone({ type: '777' })],
1545
- });
1546
- $mol_assert_equal(res.toString(), new $mol_tree({ type: 'foo 777 xxx' }).toString());
1547
- },
1548
- 'errors handling'($) {
1549
- const errors = [];
1550
- class Tree extends $mol_tree {
1551
- static $ = $.$mol_ambient({
1552
- $mol_fail: error => errors.push(error.message)
1553
- });
1554
- }
1555
- Tree.fromString(`
1556
- \t \tfoo
1557
- bar \\data
1558
- `, 'test');
1559
- $mol_assert_like(errors, ['Syntax error at test:2\n \tfoo']);
1560
- },
1561
- });
1562
- })($ || ($ = {}));
1563
- //mol/tree/tree.test.ts
1564
- ;
1565
- "use strict";
1566
- var $;
1567
1407
  (function ($) {
1568
1408
  $.$mol_tree_convert = Symbol('$mol_tree_convert');
1569
1409
  class $mol_tree extends $mol_object2 {
@@ -1894,17 +1734,163 @@ var $;
1894
1734
  ;
1895
1735
  "use strict";
1896
1736
  var $;
1737
+ (function ($) {
1738
+ const instances = new WeakSet();
1739
+ function $mol_delegate(proto, target) {
1740
+ const proxy = new Proxy(proto, {
1741
+ get: (_, field) => {
1742
+ const obj = target();
1743
+ let val = Reflect.get(obj, field);
1744
+ if (typeof val === 'function') {
1745
+ val = val.bind(obj);
1746
+ }
1747
+ return val;
1748
+ },
1749
+ has: (_, field) => Reflect.has(target(), field),
1750
+ set: (_, field, value) => Reflect.set(target(), field, value),
1751
+ getOwnPropertyDescriptor: (_, field) => Reflect.getOwnPropertyDescriptor(target(), field),
1752
+ ownKeys: () => Reflect.ownKeys(target()),
1753
+ getPrototypeOf: () => Reflect.getPrototypeOf(target()),
1754
+ setPrototypeOf: (_, donor) => Reflect.setPrototypeOf(target(), donor),
1755
+ isExtensible: () => Reflect.isExtensible(target()),
1756
+ preventExtensions: () => Reflect.preventExtensions(target()),
1757
+ apply: (_, self, args) => Reflect.apply(target(), self, args),
1758
+ construct: (_, args, retarget) => Reflect.construct(target(), args, retarget),
1759
+ defineProperty: (_, field, descr) => Reflect.defineProperty(target(), field, descr),
1760
+ deleteProperty: (_, field) => Reflect.deleteProperty(target(), field),
1761
+ });
1762
+ instances.add(proxy);
1763
+ return proxy;
1764
+ }
1765
+ $.$mol_delegate = $mol_delegate;
1766
+ Reflect.defineProperty($mol_delegate, Symbol.hasInstance, {
1767
+ value: (obj) => instances.has(obj),
1768
+ });
1769
+ })($ || ($ = {}));
1770
+ //mol/delegate/delegate.ts
1771
+ ;
1772
+ "use strict";
1773
+ var $;
1774
+ (function ($) {
1775
+ $mol_test({
1776
+ 'get'() {
1777
+ const proxy = $mol_delegate({}, () => ({ foo: 777 }));
1778
+ $mol_assert_equal(proxy.foo, 777);
1779
+ },
1780
+ 'has'() {
1781
+ const proxy = $mol_delegate({}, () => ({ foo: 777 }));
1782
+ $mol_assert_equal('foo' in proxy, true);
1783
+ },
1784
+ 'set'() {
1785
+ const target = { foo: 777 };
1786
+ const proxy = $mol_delegate({}, () => target);
1787
+ proxy.foo = 123;
1788
+ $mol_assert_equal(target.foo, 123);
1789
+ },
1790
+ 'getOwnPropertyDescriptor'() {
1791
+ const proxy = $mol_delegate({}, () => ({ foo: 777 }));
1792
+ $mol_assert_like(Object.getOwnPropertyDescriptor(proxy, 'foo'), {
1793
+ value: 777,
1794
+ writable: true,
1795
+ enumerable: true,
1796
+ configurable: true,
1797
+ });
1798
+ },
1799
+ 'ownKeys'() {
1800
+ const proxy = $mol_delegate({}, () => ({ foo: 777, [Symbol.toStringTag]: 'bar' }));
1801
+ $mol_assert_like(Reflect.ownKeys(proxy), ['foo', Symbol.toStringTag]);
1802
+ },
1803
+ 'getPrototypeOf'() {
1804
+ class Foo {
1805
+ }
1806
+ const proxy = $mol_delegate({}, () => new Foo);
1807
+ $mol_assert_equal(Object.getPrototypeOf(proxy), Foo.prototype);
1808
+ },
1809
+ 'setPrototypeOf'() {
1810
+ class Foo {
1811
+ }
1812
+ const target = {};
1813
+ const proxy = $mol_delegate({}, () => target);
1814
+ Object.setPrototypeOf(proxy, Foo.prototype);
1815
+ $mol_assert_equal(Object.getPrototypeOf(target), Foo.prototype);
1816
+ },
1817
+ 'instanceof'() {
1818
+ class Foo {
1819
+ }
1820
+ const proxy = $mol_delegate({}, () => new Foo);
1821
+ $mol_assert_ok(proxy instanceof Foo);
1822
+ $mol_assert_ok(proxy instanceof $mol_delegate);
1823
+ },
1824
+ 'autobind'() {
1825
+ class Foo {
1826
+ }
1827
+ const proxy = $mol_delegate({}, () => new Foo);
1828
+ $mol_assert_ok(proxy instanceof Foo);
1829
+ $mol_assert_ok(proxy instanceof $mol_delegate);
1830
+ },
1831
+ });
1832
+ })($ || ($ = {}));
1833
+ //mol/delegate/delegate.test.ts
1834
+ ;
1835
+ "use strict";
1836
+ var $;
1897
1837
  (function ($_1) {
1898
1838
  $mol_test({
1899
- 'FQN of anon function'($) {
1900
- const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
1901
- $mol_assert_equal($$.$mol_func_name_test.name, '');
1902
- $mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
1903
- $mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
1839
+ 'tree parsing'() {
1840
+ $mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub.length, 2);
1841
+ $mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub[1].type, "bar");
1842
+ $mol_assert_equal($mol_tree.fromString("foo\n\n\n").sub.length, 1);
1843
+ $mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub.length, 2);
1844
+ $mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub[1].data, "bar");
1845
+ $mol_assert_equal($mol_tree.fromString("foo bar \\pol").sub[0].sub[0].sub[0].data, "pol");
1846
+ $mol_assert_equal($mol_tree.fromString("foo bar\n\t\\pol\n\t\\men").sub[0].sub[0].sub[1].data, "men");
1847
+ $mol_assert_equal($mol_tree.fromString('foo bar \\text\n').toString(), 'foo bar \\text\n');
1848
+ },
1849
+ 'inserting'() {
1850
+ $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 'a', 'b', 'c').toString(), 'a b \\\n');
1851
+ $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 'a', 'b', 'c', 'd').toString(), 'a b c \\\n');
1852
+ $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 0, 0, 0).toString(), 'a b \\\n');
1853
+ $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 0, 0, 0, 0).toString(), 'a b \\\n\t\\\n');
1854
+ $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, null, null, null).toString(), 'a b \\\n');
1855
+ $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, null, null, null, null).toString(), 'a b \\\n\t\\\n');
1856
+ },
1857
+ 'fromJSON'() {
1858
+ $mol_assert_equal($mol_tree.fromJSON([]).toString(), '/\n');
1859
+ $mol_assert_equal($mol_tree.fromJSON([false, true]).toString(), '/\n\tfalse\n\ttrue\n');
1860
+ $mol_assert_equal($mol_tree.fromJSON([0, 1, 2.3]).toString(), '/\n\t0\n\t1\n\t2.3\n');
1861
+ $mol_assert_equal($mol_tree.fromJSON(['', 'foo', 'bar\nbaz']).toString(), '/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n');
1862
+ $mol_assert_equal($mol_tree.fromJSON({ 'foo': false, 'bar\nbaz': 'lol' }).toString(), '*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n');
1863
+ },
1864
+ 'toJSON'() {
1865
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n').sub[0]), '[]');
1866
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\tfalse\n\ttrue\n').sub[0]), '[false,true]');
1867
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t0\n\t1\n\t2.3\n').sub[0]), '[0,1,2.3]');
1868
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n').sub[0]), '["","foo","bar\\nbaz"]');
1869
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n').sub[0]), '{"foo":false,"bar\\nbaz":"lol"}');
1870
+ },
1871
+ 'hack'() {
1872
+ const res = $mol_tree.fromString(`foo bar xxx`).hack({
1873
+ '': (tree, context) => [tree.hack(context)],
1874
+ 'bar': (tree, context) => [tree.hack(context).clone({ type: '777' })],
1875
+ });
1876
+ $mol_assert_equal(res.toString(), new $mol_tree({ type: 'foo 777 xxx' }).toString());
1877
+ },
1878
+ 'errors handling'($) {
1879
+ const errors = [];
1880
+ class Tree extends $mol_tree {
1881
+ static $ = $.$mol_ambient({
1882
+ $mol_fail: error => errors.push(error.message)
1883
+ });
1884
+ }
1885
+ Tree.fromString(`
1886
+ \t \tfoo
1887
+ bar \\data
1888
+ `, 'test');
1889
+ $mol_assert_like(errors, ['Syntax error at test:2\n \tfoo']);
1904
1890
  },
1905
1891
  });
1906
1892
  })($ || ($ = {}));
1907
- //mol/func/name/name.test.ts
1893
+ //mol/tree/tree.test.ts
1908
1894
  ;
1909
1895
  "use strict";
1910
1896
  var $;
@@ -1940,6 +1926,20 @@ var $;
1940
1926
  ;
1941
1927
  "use strict";
1942
1928
  var $;
1929
+ (function ($_1) {
1930
+ $mol_test({
1931
+ 'FQN of anon function'($) {
1932
+ const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
1933
+ $mol_assert_equal($$.$mol_func_name_test.name, '');
1934
+ $mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
1935
+ $mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
1936
+ },
1937
+ });
1938
+ })($ || ($ = {}));
1939
+ //mol/func/name/name.test.ts
1940
+ ;
1941
+ "use strict";
1942
+ var $;
1943
1943
  (function ($) {
1944
1944
  $mol_test({
1945
1945
  'escape'() {