( d: Deferred, target: BaseRoot, k: PropertyKey )
| 1369 | } |
| 1370 | |
| 1371 | const delegateGet = ( |
| 1372 | d: Deferred, |
| 1373 | target: BaseRoot, |
| 1374 | k: PropertyKey |
| 1375 | ): unknown => { |
| 1376 | const value = Reflect.get(target, k, target) |
| 1377 | if ( |
| 1378 | typeof value !== "function" || |
| 1379 | k === "constructor" || |
| 1380 | k === "pipe" || |
| 1381 | isNode(value) |
| 1382 | ) |
| 1383 | return value |
| 1384 | // bound once, so it reads as the method it read before, as any Type's does. |
| 1385 | // Keyed by the function, so one that compiling replaces isn't answered with |
| 1386 | // what was bound before it |
| 1387 | let bound = d.bound?.get(value) |
| 1388 | if (!bound) |
| 1389 | (d.bound ??= new WeakMap()).set(value, (bound = value.bind(target))) |
| 1390 | return bound |
| 1391 | } |
| 1392 | |
| 1393 | const shellProto = new Proxy(Object.create(proto), { |
| 1394 | get: (target, k, receiver) => { |
no test coverage detected