@@ -817,6 +817,35 @@ Copyright (c) 2017, 2018, 2019, 2020 Tetsuya Mori <
[email protected] >. All ri
817
817
}
818
818
chainAcl ( acl ) ;
819
819
}
820
+ /* @ifdef unchainAcl */
821
+ static unchainAcl ( acl ) {
822
+ const unchainAcl = function unchainAcl ( _acl , path = [ [ _acl , 'acl' ] ] ) {
823
+ let properties = Object . getOwnPropertySymbols ( _acl ) . concat ( Object . getOwnPropertyNames ( _acl ) ) ;
824
+ if ( ! _acl [ S_CHAIN ] ) {
825
+ Reflect . setPrototypeOf ( _acl , null ) ;
826
+ }
827
+ for ( let property of properties ) {
828
+ if ( property === S_CHAIN ) {
829
+ }
830
+ else {
831
+ let __acl = _acl [ property ] ;
832
+ switch ( typeof __acl ) {
833
+ case 'object' :
834
+ if ( __acl ) {
835
+ path . push ( [ __acl , property ] ) ;
836
+ unchainAcl ( __acl , path ) ;
837
+ path . pop ( ) ;
838
+ }
839
+ break ;
840
+ default :
841
+ break ;
842
+ }
843
+ }
844
+ }
845
+ }
846
+ unchainAcl ( acl ) ;
847
+ }
848
+ /* @endif */
820
849
static mergeAcl ( target , ...sources ) {
821
850
const originalTarget = target ;
822
851
const mergeAcl = function mergeAcl ( target , source ) {
@@ -1352,23 +1381,38 @@ Copyright (c) 2017, 2018, 2019, 2020 Tetsuya Mori <
[email protected] >. All ri
1352
1381
case 'undefined' :
1353
1382
_acl = Reflect . has ( _acl , property )
1354
1383
? isGlobal
1384
+ /* @ifndef unchainAcl */
1355
1385
? _acl [ property ] instanceof Object && Reflect . has ( _acl [ property ] , S_OBJECT )
1386
+ /* @endif */
1387
+ /* @ifdef unchainAcl */
1388
+ ? _acl [ property ] && typeof _acl [ property ] === 'object' && Reflect . has ( _acl [ property ] , S_OBJECT )
1389
+ /* @endif */
1356
1390
? _acl [ property ] [ S_OBJECT ]
1357
1391
: _acl [ property ]
1358
1392
: _acl [ property ]
1359
1393
: Reflect . has ( _acl , context )
1360
1394
? context === S_DEFAULT
1361
1395
? isGlobal
1362
1396
? Reflect . has ( acl , property )
1397
+ /* @ifndef unchainAcl */
1363
1398
? acl [ property ] instanceof Object && Reflect . has ( acl [ property ] , S_OBJECT )
1399
+ /* @endif */
1400
+ /* @ifdef unchainAcl */
1401
+ ? acl [ property ] && typeof acl [ property ] === 'object' && Reflect . has ( acl [ property ] , S_OBJECT )
1402
+ /* @endif */
1364
1403
? acl [ property ] [ S_OBJECT ]
1365
1404
: acl [ property ]
1366
1405
: acl [ S_GLOBAL ]
1367
1406
: _acl [ context ]
1368
1407
: _acl [ context ]
1369
1408
: isGlobal
1370
1409
? Reflect . has ( acl , property )
1410
+ /* @ifndef unchainAcl */
1371
1411
? acl [ property ] instanceof Object && Reflect . has ( acl [ property ] , S_OBJECT )
1412
+ /* @endif */
1413
+ /* @ifdef unchainAcl */
1414
+ ? acl [ property ] && typeof acl [ property ] === 'object' && Reflect . has ( acl [ property ] , S_OBJECT )
1415
+ /* @endif */
1372
1416
? acl [ property ] [ S_OBJECT ]
1373
1417
: acl [ property ]
1374
1418
: acl [ S_GLOBAL ]
@@ -1395,23 +1439,38 @@ Copyright (c) 2017, 2018, 2019, 2020 Tetsuya Mori <
[email protected] >. All ri
1395
1439
for ( _property of property ) {
1396
1440
__acl = Reflect . has ( _acl , property )
1397
1441
? isGlobal
1442
+ /* @ifndef unchainAcl */
1398
1443
? _acl [ property ] instanceof Object && Reflect . has ( _acl [ property ] , S_OBJECT )
1444
+ /* @endif */
1445
+ /* @ifdef unchainAcl */
1446
+ ? _acl [ property ] && typeof _acl [ property ] === 'object' && Reflect . has ( _acl [ property ] , S_OBJECT )
1447
+ /* @endif */
1399
1448
? _acl [ property ] [ S_OBJECT ]
1400
1449
: _acl [ property ]
1401
1450
: _acl [ property ]
1402
1451
: Reflect . has ( _acl , context )
1403
1452
? context === S_DEFAULT
1404
1453
? isGlobal
1405
1454
? Reflect . has ( acl , property )
1455
+ /* @ifndef unchainAcl */
1406
1456
? acl [ property ] instanceof Object && Reflect . has ( acl [ property ] , S_OBJECT )
1457
+ /* @endif */
1458
+ /* @ifdef unchainAcl */
1459
+ ? acl [ property ] && typeof acl [ property ] === 'object' && Reflect . has ( acl [ property ] , S_OBJECT )
1460
+ /* @endif */
1407
1461
? acl [ property ] [ S_OBJECT ]
1408
1462
: acl [ property ]
1409
1463
: acl [ S_GLOBAL ]
1410
1464
: _acl [ context ]
1411
1465
: _acl [ context ]
1412
1466
: isGlobal
1413
1467
? Reflect . has ( acl , property )
1468
+ /* @ifndef unchainAcl */
1414
1469
? acl [ property ] instanceof Object && Reflect . has ( acl [ property ] , S_OBJECT )
1470
+ /* @endif */
1471
+ /* @ifdef unchainAcl */
1472
+ ? acl [ property ] && typeof acl [ property ] === 'object' && Reflect . has ( acl [ property ] , S_OBJECT )
1473
+ /* @endif */
1415
1474
? acl [ property ] [ S_OBJECT ]
1416
1475
: acl [ property ]
1417
1476
: acl [ S_GLOBAL ]
0 commit comments