ses 0.16.0 → 0.18.0

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/dist/ses.umd.js CHANGED
@@ -78,9 +78,10 @@ const {
78
78
  toStringTag: toStringTagSymbol,
79
79
  iterator: iteratorSymbol,
80
80
  matchAll: matchAllSymbol,
81
+ unscopables: unscopablesSymbol,
81
82
  keyFor: symbolKeyFor,
82
83
  for: symbolFor}=
83
- Symbol;$h‍_once.speciesSymbol(speciesSymbol);$h‍_once.toStringTagSymbol(toStringTagSymbol);$h‍_once.iteratorSymbol(iteratorSymbol);$h‍_once.matchAllSymbol(matchAllSymbol);$h‍_once.symbolKeyFor(symbolKeyFor);$h‍_once.symbolFor(symbolFor);
84
+ Symbol;$h‍_once.speciesSymbol(speciesSymbol);$h‍_once.toStringTagSymbol(toStringTagSymbol);$h‍_once.iteratorSymbol(iteratorSymbol);$h‍_once.matchAllSymbol(matchAllSymbol);$h‍_once.unscopablesSymbol(unscopablesSymbol);$h‍_once.symbolKeyFor(symbolKeyFor);$h‍_once.symbolFor(symbolFor);
84
85
 
85
86
  const { isInteger}= Number;$h‍_once.isInteger(isInteger);
86
87
 
@@ -814,6 +815,64 @@ freeze(bestEffortStringify);
814
815
  * `string[]` can also be used as a template.
815
816
  */
816
817
 
818
+ /**
819
+ * @typedef {(template: TemplateStringsArray | string[], ...args: any) => never} FailTag
820
+ * The `Fail` tamplate tag supports replacing patterns like
821
+ * ```js
822
+ * assert(cond, X`...complaint...`);
823
+ * ```
824
+ * or
825
+ * ```js
826
+ * cond || assert.fail(X`...complaint...`);
827
+ * ```
828
+ * with patterns like
829
+ * ```js
830
+ * cond || Fail`...complaint...`;
831
+ * ```
832
+ *
833
+ * However, due to [weakness in current
834
+ * TypeScript](https://github.com/microsoft/TypeScript/issues/51426), the `||`
835
+ * patterns are not as powerful as the `assert(...)` call at enabling static
836
+ * reasoning. Of the `||`, again due to weaknesses in current TypeScript,
837
+ * the
838
+ * ```js
839
+ * cond || Fail`...complaint...`
840
+ * ```
841
+ * pattern is not as powerful as the
842
+ * ```js
843
+ * cond || assert.fail(X`...complaint...`);
844
+ * ```
845
+ * at enabling static resoning. Despite these problems, we do not want to
846
+ * return to the
847
+ * ```js
848
+ * assert(cond, X`...complaint...`)
849
+ * ```
850
+ * style because of the substantial overhead in
851
+ * evaluating the `X` template in the typical `true` case where it is not
852
+ * needed. And we do not want to return to the
853
+ * ```js
854
+ * assert.fail(X`...complaint...`)`
855
+ * ```
856
+ * because of the verbosity and loss of readability. Instead, until/unless
857
+ * https://github.com/microsoft/TypeScript/issues/51426 is fixed, for those
858
+ * new-style assertions where this loss of static reasoning is a problem,
859
+ * instead express the assertion as
860
+ * ```js
861
+ * if (!cond) {
862
+ * Fail`...complaint...`;
863
+ * }
864
+ * ```
865
+ * or, if needed,
866
+ * ```js
867
+ * if (!cond) {
868
+ * // `throw` is noop since `Fail` throws. But linter confused
869
+ * throw Fail`...complaint...`;
870
+ * }
871
+ * ```
872
+ * This avoid the TypeScript bugs that cause the loss of static reasoning,
873
+ * but with no loss of efficiency and little loss of readability.
874
+ */
875
+
817
876
  /**
818
877
  * assert that expr is truthy, with an optional details to describe
819
878
  * the assertion. It is a tagged template literal like
@@ -840,6 +899,7 @@ freeze(bestEffortStringify);
840
899
  * string: AssertString,
841
900
  * note: AssertNote,
842
901
  * details: DetailsTag,
902
+ * Fail: FailTag,
843
903
  * quote: AssertQuote,
844
904
  * makeAssert: MakeAssert,
845
905
  * } } Assert
@@ -1282,6 +1342,9 @@ const makeAssert= (optRaise= undefined, unredacted= false)=> {
1282
1342
  };
1283
1343
  freeze(fail);
1284
1344
 
1345
+ /** @type {FailTag} */
1346
+ const Fail= (template, ...args)=> fail(details(template, ...args));
1347
+
1285
1348
  // Don't freeze or export `baseAssert` until we add methods.
1286
1349
  // TODO If I change this from a `function` function to an arrow
1287
1350
  // function, I seem to get type errors from TypeScript. Why?
@@ -1340,6 +1403,7 @@ const makeAssert= (optRaise= undefined, unredacted= false)=> {
1340
1403
  string: assertString,
1341
1404
  note,
1342
1405
  details,
1406
+ Fail,
1343
1407
  quote,
1344
1408
  makeAssert});
1345
1409
 
@@ -1353,77 +1417,93 @@ const assert= makeAssert();$h‍_once.assert(assert);
1353
1417
  })
1354
1418
  ,
1355
1419
  // === functors[5] ===
1356
- (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_FUNCTION,arrayJoin;$h‍_imports([["./commons.js", [["FERAL_FUNCTION", [$h‍_a => (FERAL_FUNCTION = $h‍_a)]],["arrayJoin", [$h‍_a => (arrayJoin = $h‍_a)]]]]]);
1420
+ (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_EVAL,create,defineProperties,freeze,assert;$h‍_imports([["./commons.js", [["FERAL_EVAL", [$h‍_a => (FERAL_EVAL = $h‍_a)]],["create", [$h‍_a => (create = $h‍_a)]],["defineProperties", [$h‍_a => (defineProperties = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]]]);
1357
1421
 
1358
- /**
1359
- * buildOptimizer()
1360
- * Given an array of indentifier, the optimizer return a `const` declaration
1361
- * destructring `this`.
1362
- *
1363
- * @param {Array<string>} constants
1364
- */
1365
- function buildOptimizer(constants) {
1366
- // No need to build an optimizer when there are no constants.
1367
- if( constants.length=== 0) return '';
1368
- // Use 'this' to avoid going through the scope proxy, which is unecessary
1369
- // since the optimizer only needs references to the safe global.
1370
- return `const {${arrayJoin(constants,',') }} = this;`;
1371
- }
1372
1422
 
1373
- /**
1374
- * makeEvaluateFactory()
1375
- * The factory create 'evaluate' functions with the correct optimizer
1376
- * inserted.
1377
- *
1378
- * @param {Array<string>} [constants]
1379
- */
1380
- const makeEvaluateFactory= (constants= [])=> {
1381
- const optimizer= buildOptimizer(constants);
1382
1423
 
1383
- // Create a function in sloppy mode, so that we can use 'with'. It returns
1384
- // a function in strict mode that evaluates the provided code using direct
1385
- // eval, and thus in strict mode in the same scope. We must be very careful
1386
- // to not create new names in this scope
1424
+ const { Fail}= assert;
1387
1425
 
1388
- // 1: we use 'with' (around a Proxy) to catch all free variable names. The
1389
- // `this` value holds the Proxy which safely wraps the safeGlobal
1390
- // 2: 'optimizer' catches constant variable names for speed.
1391
- // 3: The inner strict function is effectively passed two parameters:
1392
- // a) its arguments[0] is the source to be directly evaluated.
1393
- // b) its 'this' is the this binding seen by the code being
1394
- // directly evaluated (the globalObject).
1395
- // 4: The outer sloppy function is passed one parameter, the scope proxy.
1396
- // as the `this` parameter.
1426
+ // We attempt to frustrate stack bumping attacks on the safe evaluator
1427
+ // (`make-safe-evaluator.js`).
1428
+ // A stack bumping attack forces an API call to throw a stack overflow
1429
+ // `RangeError` at an inopportune time.
1430
+ // The attacker arranges for the stack to be sufficiently deep that the API
1431
+ // consumes exactly enough stack frames to throw an exception.
1432
+ //
1433
+ // For the safe evaluator, an exception thrown between adding and then deleting
1434
+ // `eval` on `evalScope` could leak the real `eval` to an attacker's lexical
1435
+ // scope.
1436
+ // This would be sufficiently disastrous that we guard against it twice.
1437
+ // First, we delete `eval` from `evalScope` immediately before rendering it to
1438
+ // the guest program's lexical scope.
1439
+ //
1440
+ // If the attacker manages to arrange for `eval` to throw an exception after we
1441
+ // call `allowNextEvalToBeUnsafe` but before the guest program accesses `eval`,
1442
+ // it would be able to access `eval` once more in its own code.
1443
+ // Although they could do no harm with a direct `eval`, they would be able to
1444
+ // escape to the true global scope with an indirect `eval`.
1445
+ //
1446
+ // prepareStack(depth, () => {
1447
+ // (eval)('');
1448
+ // });
1449
+ // const unsafeEval = (eval);
1450
+ // const safeEval = (eval);
1451
+ // const realGlobal = unsafeEval('globalThis');
1452
+ //
1453
+ // To protect against that case, we also delete `eval` from the `evalScope` in
1454
+ // a `finally` block surrounding the call to the safe evaluator.
1455
+ // The only way to reach this case is if `eval` remains on `evalScope` due to
1456
+ // an attack, so we assume that attack would have have invalided our isolation
1457
+ // and revoke all future access to the evaluator.
1458
+ //
1459
+ // To defeat a stack bumping attack, we must use fewer stack frames to recover
1460
+ // in that `finally` block than we used in the `try` block.
1461
+ // We have no reliable guarantees about how many stack frames a block of
1462
+ // JavaScript will consume.
1463
+ // Function inlining, tail-call optimization, variations in the size of a stack
1464
+ // frame, and block scopes may affect the depth of the stack.
1465
+ // The only number of acceptable stack frames to use in the finally block is
1466
+ // zero.
1467
+ // We only use property assignment and deletion in the safe evaluator's
1468
+ // `finally` block.
1469
+ // We use `delete evalScope.eval` to withhold the evaluator.
1470
+ // We assign an envelope object over `evalScopeKit.revoked` to revoke the
1471
+ // evaluator.
1472
+ //
1473
+ // This is why we supply a meaningfully named function for
1474
+ // `allowNextEvalToBeUnsafe` but do not provide a corresponding
1475
+ // `revokeAccessToUnsafeEval` or even simply `revoke`.
1476
+ // These recovery routines are expressed inline in the safe evaluator.
1477
+
1478
+ const makeEvalScopeKit= ()=> {
1479
+ const evalScope= create(null);
1480
+ const oneTimeEvalProperties= freeze({
1481
+ eval: {
1482
+ get() {
1483
+ delete evalScope.eval;
1484
+ return FERAL_EVAL;
1485
+ },
1486
+ enumerable: false,
1487
+ configurable: true}});
1397
1488
 
1398
- // Notes:
1399
- // - everything in the 'optimizer' string is looked up in the proxy
1400
- // (including an 'arguments[0]', which points at the Proxy).
1401
- // - keywords like 'function' which are reserved keywords, and cannot be
1402
- // used as a variable, so they are not part of the optimizer.
1403
- // - when 'eval' is looked up in the proxy, and it's the first time it is
1404
- // looked up after allowNextEvalToBeUnsafe is turned on, the proxy returns
1405
- // the powerful, unsafe eval intrinsic, and flips allowNextEvalToBeUnsafe
1406
- // back to false. Any reference to 'eval' in that string will get the tamed
1407
- // evaluator.
1408
1489
 
1409
- // TODO https://github.com/endojs/endo/issues/816
1410
- // The optimizer currently runs under sloppy mode, and although we doubt that
1411
- // there is any vulnerability introduced just by running the optimizer
1412
- // sloppy, we are much more confident in the semantics of strict mode.
1413
- // The motivation for having the optimizer in sloppy mode is that it can be
1414
- // reused for multiple evaluations, but in practice we have no such calls.
1415
- // We could probably both move the optimizer into the inner function
1416
- // and we could also simplify makeEvaluateFactory to simply evaluate.
1417
- return FERAL_FUNCTION( `
1418
- with (this) {
1419
- ${optimizer }
1420
- return function() {
1421
- 'use strict';
1422
- return eval(arguments[0]);
1423
- };
1424
- }
1425
- `);
1426
- };$h‍_once.makeEvaluateFactory(makeEvaluateFactory);
1490
+
1491
+ const evalScopeKit= {
1492
+ evalScope,
1493
+ allowNextEvalToBeUnsafe() {
1494
+ if( evalScopeKit.revoked!== null) {
1495
+ Fail `a handler did not reset allowNextEvalToBeUnsafe ${this.revoked.err}`;
1496
+ }
1497
+ // Allow next reference to eval produce the unsafe FERAL_EVAL.
1498
+ // We avoid defineProperty because it consumes an extra stack frame taming
1499
+ // its return value.
1500
+ defineProperties(evalScope, oneTimeEvalProperties);
1501
+ },
1502
+ revoked: null};
1503
+
1504
+
1505
+ return evalScopeKit;
1506
+ };$h‍_once.makeEvalScopeKit(makeEvalScopeKit);
1427
1507
  })
1428
1508
  ,
1429
1509
  // === functors[6] ===
@@ -1506,7 +1586,7 @@ const keywords= [
1506
1586
 
1507
1587
  /**
1508
1588
  * identifierPattern
1509
- * Simplified validation of indentifier names: may only contain alphanumeric
1589
+ * Simplified validation of identifier names: may only contain alphanumeric
1510
1590
  * characters (or "$" or "_"), and may not start with a digit. This is safe
1511
1591
  * and does not reduces the compatibility of the shim. The motivation for
1512
1592
  * this limitation was to decrease the complexity of the implementation,
@@ -1573,44 +1653,156 @@ function isImmutableDataProperty(obj, name) {
1573
1653
  * safe and only prevent performance optimization.
1574
1654
  *
1575
1655
  * @param {Object} globalObject
1576
- * @param {Object} localObject
1656
+ * @param {Object} moduleLexicals
1577
1657
  */
1578
- const getScopeConstants= (globalObject, localObject= {})=> {
1658
+ const getScopeConstants= (globalObject, moduleLexicals= {})=> {
1579
1659
  // getOwnPropertyNames() does ignore Symbols so we don't need to
1580
1660
  // filter them out.
1581
- const globalNames= getOwnPropertyNames(globalObject);
1582
- const localNames= getOwnPropertyNames(localObject);
1661
+ const globalObjectNames= getOwnPropertyNames(globalObject);
1662
+ const moduleLexicalNames= getOwnPropertyNames(moduleLexicals);
1583
1663
 
1584
1664
  // Collect all valid & immutable identifiers from the endowments.
1585
- const localConstants= arrayFilter(
1586
- localNames,
1665
+ const moduleLexicalConstants= arrayFilter(
1666
+ moduleLexicalNames,
1587
1667
  (name)=>
1588
- isValidIdentifierName(name)&& isImmutableDataProperty(localObject, name));
1668
+ isValidIdentifierName(name)&&
1669
+ isImmutableDataProperty(moduleLexicals, name));
1589
1670
 
1590
1671
 
1591
1672
  // Collect all valid & immutable identifiers from the global that
1592
- // are also not present in the endwoments (immutable or not).
1593
- const globalConstants= arrayFilter(
1594
- globalNames,
1673
+ // are also not present in the endowments (immutable or not).
1674
+ const globalObjectConstants= arrayFilter(
1675
+ globalObjectNames,
1595
1676
  (name)=>
1596
1677
  // Can't define a constant: it would prevent a
1597
1678
  // lookup on the endowments.
1598
- !arrayIncludes(localNames, name)&&
1679
+ !arrayIncludes(moduleLexicalNames, name)&&
1599
1680
  isValidIdentifierName(name)&&
1600
1681
  isImmutableDataProperty(globalObject, name));
1601
1682
 
1602
1683
 
1603
- return [...globalConstants, ...localConstants];
1684
+ return {
1685
+ globalObjectConstants,
1686
+ moduleLexicalConstants};
1687
+
1604
1688
  };$h‍_once.getScopeConstants(getScopeConstants);
1605
1689
  })
1606
1690
  ,
1607
1691
  // === functors[7] ===
1608
- (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_EVAL,Proxy,String,TypeError,create,freeze,getOwnPropertyDescriptor,getOwnPropertyDescriptors,globalThis,immutableObject,objectHasOwnProperty,reflectGet,reflectSet,seal,assert;$h‍_imports([["./commons.js", [["FERAL_EVAL", [$h‍_a => (FERAL_EVAL = $h‍_a)]],["Proxy", [$h‍_a => (Proxy = $h‍_a)]],["String", [$h‍_a => (String = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["create", [$h‍_a => (create = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["getOwnPropertyDescriptor", [$h‍_a => (getOwnPropertyDescriptor = $h‍_a)]],["getOwnPropertyDescriptors", [$h‍_a => (getOwnPropertyDescriptors = $h‍_a)]],["globalThis", [$h‍_a => (globalThis = $h‍_a)]],["immutableObject", [$h‍_a => (immutableObject = $h‍_a)]],["objectHasOwnProperty", [$h‍_a => (objectHasOwnProperty = $h‍_a)]],["reflectGet", [$h‍_a => (reflectGet = $h‍_a)]],["reflectSet", [$h‍_a => (reflectSet = $h‍_a)]],["seal", [$h‍_a => (seal = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]]]);
1692
+ (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_FUNCTION,arrayJoin,apply,getScopeConstants;$h‍_imports([["./commons.js", [["FERAL_FUNCTION", [$h‍_a => (FERAL_FUNCTION = $h‍_a)]],["arrayJoin", [$h‍_a => (arrayJoin = $h‍_a)]],["apply", [$h‍_a => (apply = $h‍_a)]]]],["./scope-constants.js", [["getScopeConstants", [$h‍_a => (getScopeConstants = $h‍_a)]]]]]);
1609
1693
 
1610
1694
 
1611
1695
 
1612
1696
 
1697
+ /**
1698
+ * buildOptimizer()
1699
+ * Given an array of identifiers, the optimizer returns a `const` declaration
1700
+ * destructuring `this.${name}`.
1701
+ *
1702
+ * @param {Array<string>} constants
1703
+ * @param {string} name
1704
+ */
1705
+ function buildOptimizer(constants, name) {
1706
+ // No need to build an optimizer when there are no constants.
1707
+ if( constants.length=== 0) return '';
1708
+ // Use 'this' to avoid going through the scope proxy, which is unnecessary
1709
+ // since the optimizer only needs references to the safe global.
1710
+ // Destructure the constants from the target scope object.
1711
+ return `const {${arrayJoin(constants,',') }} = this.${name};`;
1712
+ }
1613
1713
 
1714
+ /**
1715
+ * makeEvaluate()
1716
+ * Create an 'evaluate' function with the correct optimizer inserted.
1717
+ *
1718
+ * @param {object} context
1719
+ * @param {object} context.evalScope
1720
+ * @param {object} context.moduleLexicals
1721
+ * @param {object} context.globalObject
1722
+ * @param {object} context.scopeTerminator
1723
+ */
1724
+ const makeEvaluate= (context)=>{
1725
+ const { globalObjectConstants, moduleLexicalConstants}= getScopeConstants(
1726
+ context.globalObject,
1727
+ context.moduleLexicals);
1728
+
1729
+ const globalObjectOptimizer= buildOptimizer(
1730
+ globalObjectConstants,
1731
+ 'globalObject');
1732
+
1733
+ const moduleLexicalOptimizer= buildOptimizer(
1734
+ moduleLexicalConstants,
1735
+ 'moduleLexicals');
1736
+
1737
+
1738
+ // Create a function in sloppy mode, so that we can use 'with'. It returns
1739
+ // a function in strict mode that evaluates the provided code using direct
1740
+ // eval, and thus in strict mode in the same scope. We must be very careful
1741
+ // to not create new names in this scope
1742
+
1743
+ // 1: we use multiple nested 'with' to catch all free variable names. The
1744
+ // `this` value of the outer sloppy function holds the different scope
1745
+ // layers, from inner to outer:
1746
+ // a) `evalScope` which must release the `FERAL_EVAL` as 'eval' once for
1747
+ // every invocation of the inner `evaluate` function in order to
1748
+ // trigger direct eval. The direct eval semantics is what allows the
1749
+ // evaluated code to lookup free variable names on the other scope
1750
+ // objects and not in global scope.
1751
+ // b) `moduleLexicals` which provide a way to introduce free variables
1752
+ // that are not available on the globalObject.
1753
+ // c) `globalObject` is the global scope object of the evaluator, aka the
1754
+ // Compartment's `globalThis`.
1755
+ // d) `scopeTerminator` is a proxy object which prevents free variable
1756
+ // lookups to escape to the start compartment's global object.
1757
+ // 2: `optimizer`s catch constant variable names for speed.
1758
+ // 3: The inner strict `evaluate` function should be passed two parameters:
1759
+ // a) its arguments[0] is the source to be directly evaluated.
1760
+ // b) its 'this' is the this binding seen by the code being
1761
+ // directly evaluated (the globalObject).
1762
+
1763
+ // Notes:
1764
+ // - The `optimizer` strings only lookup values on the `globalObject` and
1765
+ // `moduleLexicals` objects by construct. Keywords like 'function' are
1766
+ // reserved and cannot be used as a variable, so they are excluded from the
1767
+ // optimizer. Furthermore to prevent shadowing 'eval', while a valid
1768
+ // identifier, that name is also explicitly excluded.
1769
+ // - when 'eval' is looked up in the `evalScope`, the powerful unsafe eval
1770
+ // intrinsic is returned after automatically removing it from the
1771
+ // `evalScope`. Any further reference to 'eval' in the evaluate string will
1772
+ // get the tamed evaluator from the `globalObject`, if any.
1773
+
1774
+ // TODO https://github.com/endojs/endo/issues/816
1775
+ // The optimizer currently runs under sloppy mode, and although we doubt that
1776
+ // there is any vulnerability introduced just by running the optimizer
1777
+ // sloppy, we are much more confident in the semantics of strict mode.
1778
+ // The `evaluate` function can be and is reused across multiple evaluations.
1779
+ // Since the optimizer should not be re-evaluated every time, it cannot be
1780
+ // inside the `evaluate` closure. While we could potentially nest an
1781
+ // intermediate layer of `() => {'use strict'; ${optimizers}; ...`, it
1782
+ // doesn't seem worth the overhead and complexity.
1783
+ const evaluateFactory= FERAL_FUNCTION( `
1784
+ with (this.scopeTerminator) {
1785
+ with (this.globalObject) {
1786
+ with (this.moduleLexicals) {
1787
+ with (this.evalScope) {
1788
+ ${globalObjectOptimizer }
1789
+ ${moduleLexicalOptimizer }
1790
+ return function() {
1791
+ 'use strict';
1792
+ return eval(arguments[0]);
1793
+ };
1794
+ }
1795
+ }
1796
+ }
1797
+ }
1798
+ `);
1799
+
1800
+ return apply(evaluateFactory, context, []);
1801
+ };$h‍_once.makeEvaluate(makeEvaluate);
1802
+ })
1803
+ ,
1804
+ // === functors[8] ===
1805
+ (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let Proxy,String,TypeError,ReferenceError,create,freeze,getOwnPropertyDescriptors,globalThis,immutableObject,assert;$h‍_imports([["./commons.js", [["Proxy", [$h‍_a => (Proxy = $h‍_a)]],["String", [$h‍_a => (String = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["ReferenceError", [$h‍_a => (ReferenceError = $h‍_a)]],["create", [$h‍_a => (create = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["getOwnPropertyDescriptors", [$h‍_a => (getOwnPropertyDescriptors = $h‍_a)]],["globalThis", [$h‍_a => (globalThis = $h‍_a)]],["immutableObject", [$h‍_a => (immutableObject = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]]]);
1614
1806
 
1615
1807
 
1616
1808
 
@@ -1623,202 +1815,139 @@ const getScopeConstants= (globalObject, localObject= {})=> {
1623
1815
 
1624
1816
 
1625
1817
 
1626
- const { details: d, quote: q}= assert;
1818
+ const { Fail, quote: q}= assert;
1627
1819
 
1628
1820
  /**
1629
1821
  * alwaysThrowHandler
1630
1822
  * This is an object that throws if any property is called. It's used as
1631
1823
  * a proxy handler which throws on any trap called.
1632
1824
  * It's made from a proxy with a get trap that throws. It's safe to
1633
- * create one and share it between all scopeHandlers.
1825
+ * create one and share it between all Proxy handlers.
1634
1826
  */
1635
- const alwaysThrowHandler= new Proxy(
1827
+ const alwaysThrowHandler= new Proxy(
1636
1828
  immutableObject,
1637
1829
  freeze({
1638
1830
  get(_shadow, prop) {
1639
- // eslint-disable-next-line @endo/no-polymorphic-call
1640
- assert.fail(
1641
- d `Please report unexpected scope handler trap: ${q(String(prop))}`);
1642
-
1831
+ Fail `Please report unexpected scope handler trap: ${q(String(prop))}`;
1643
1832
  }}));
1644
1833
 
1645
1834
 
1646
1835
 
1647
1836
  /*
1648
- * createScopeHandler()
1649
- * ScopeHandler manages a Proxy which serves as the global scope for the
1650
- * safeEvaluate operation (the Proxy is the argument of a 'with' binding).
1651
- * As described in createSafeEvaluator(), it has several functions:
1652
- * - allow the very first (and only the very first) use of 'eval' to map to
1653
- * the real (unsafe) eval function, so it acts as a 'direct eval' and can
1654
- * access its lexical scope (which maps to the 'with' binding, which the
1655
- * ScopeHandler also controls).
1656
- * - ensure that all subsequent uses of 'eval' map to the safeEvaluator,
1657
- * which lives as the 'eval' property of the safeGlobal.
1658
- * - route all other property lookups at the safeGlobal.
1659
- * - hide the unsafeGlobal which lives on the scope chain above the 'with'.
1660
- * - ensure the Proxy invariants despite some global properties being frozen.
1661
- */
1662
- const createScopeHandler= (
1663
- globalObject,
1664
- globalLexicals= {},
1665
- { sloppyGlobalsMode= false}= {})=>
1666
- {
1667
- // This flag allow us to determine if the eval() call is an done by the
1668
- // compartment's code or if it is user-land invocation, so we can react
1669
- // differently.
1670
- // Using a flag on an object with a single mutable property allows a safe
1671
- // evaluator to signal to the scope proxy without consuming a stack frame.
1672
- // Consuming a stack frame could possibly allow an attacker to control the
1673
- // stack depth before calling `evaluate` to cause a RangeError before this
1674
- // flag can be reset, leaving the unsafe evaluator available.
1675
- const scopeController= {
1676
- allowNextEvalToBeUnsafe: false};
1677
-
1678
- seal(scopeController);
1837
+ * scopeProxyHandlerProperties
1838
+ * scopeTerminatorHandler manages a strictScopeTerminator Proxy which serves as
1839
+ * the final scope boundary that will always return "undefined" in order
1840
+ * to prevent access to "start compartment globals".
1841
+ */$h‍_once.alwaysThrowHandler(alwaysThrowHandler);
1842
+ const scopeProxyHandlerProperties= {
1843
+ get(_shadow, _prop) {
1844
+ return undefined;
1845
+ },
1679
1846
 
1680
- const scopeProxyHandlerProperties= {
1681
- get(_shadow, prop) {
1682
- if( typeof prop=== 'symbol') {
1683
- return undefined;
1684
- }
1847
+ set(_shadow, prop, _value) {
1848
+ // We should only hit this if the has() hook returned true matches the v8
1849
+ // ReferenceError message "Uncaught ReferenceError: xyz is not defined"
1850
+ throw new ReferenceError( `${String(prop)} is not defined`);
1851
+ },
1685
1852
 
1686
- // Special treatment for eval. The very first lookup of 'eval' gets the
1687
- // unsafe (real direct) eval, so it will get the lexical scope that uses
1688
- // the 'with' context.
1689
- if( prop=== 'eval') {
1690
- // test that it is true rather than merely truthy
1691
- if( scopeController.allowNextEvalToBeUnsafe=== true) {
1692
- // revoke before use
1693
- scopeController.allowNextEvalToBeUnsafe= false;
1694
- return FERAL_EVAL;
1695
- }
1696
- // fall through
1697
- }
1853
+ has(_shadow, prop) {
1854
+ // we must at least return true for all properties on the realm globalThis
1855
+ return prop in globalThis;
1856
+ },
1698
1857
 
1699
- // Properties of the globalLexicals.
1700
- if( prop in globalLexicals) {
1701
- // Use reflect to defeat accessors that could be present on the
1702
- // globalLexicals object itself as `this`.
1703
- // This is done out of an overabundance of caution, as the SES shim
1704
- // only use the globalLexicals carry globalLexicals and live binding
1705
- // traps.
1706
- // The globalLexicals are captured as a snapshot of what's passed to
1707
- // the Compartment constructor, wherein all accessors and setters are
1708
- // eliminated and the result frozen.
1709
- // The live binding traps do use accessors, and none of those accessors
1710
- // make use of their receiver.
1711
- // Live binding traps provide no avenue for user code to observe the
1712
- // receiver.
1713
- return reflectGet(globalLexicals, prop, globalObject);
1714
- }
1858
+ // note: this is likely a bug of safari
1859
+ // https://bugs.webkit.org/show_bug.cgi?id=195534
1860
+ getPrototypeOf() {
1861
+ return null;
1862
+ },
1715
1863
 
1716
- // Properties of the global.
1717
- return reflectGet(globalObject, prop);
1718
- },
1864
+ // Chip has seen this happen single stepping under the Chrome/v8 debugger.
1865
+ // TODO record how to reliably reproduce, and to test if this fix helps.
1866
+ // TODO report as bug to v8 or Chrome, and record issue link here.
1867
+ getOwnPropertyDescriptor(_target, prop) {
1868
+ // Coerce with `String` in case prop is a symbol.
1869
+ const quotedProp= q(String(prop));
1870
+ // eslint-disable-next-line @endo/no-polymorphic-call
1871
+ console.warn(
1872
+ `getOwnPropertyDescriptor trap on scopeTerminatorHandler for ${quotedProp}`,
1873
+ new TypeError().stack);
1719
1874
 
1720
- set(_shadow, prop, value) {
1721
- // Properties of the globalLexicals.
1722
- if( prop in globalLexicals) {
1723
- const desc= getOwnPropertyDescriptor(globalLexicals, prop);
1724
- if( objectHasOwnProperty(desc, 'value')) {
1725
- // Work around a peculiar behavior in the specs, where
1726
- // value properties are defined on the receiver.
1727
- return reflectSet(globalLexicals, prop, value);
1728
- }
1729
- // Ensure that the 'this' value on setters resolves
1730
- // to the safeGlobal, not to the globalLexicals object.
1731
- return reflectSet(globalLexicals, prop, value, globalObject);
1732
- }
1875
+ return undefined;
1876
+ }};
1733
1877
 
1734
- // Properties of the global.
1735
- return reflectSet(globalObject, prop, value);
1736
- },
1737
1878
 
1738
- // we need has() to return false for some names to prevent the lookup from
1739
- // climbing the scope chain and eventually reaching the unsafeGlobal
1740
- // object (globalThis), which is bad.
1741
-
1742
- // todo: we'd like to just have has() return true for everything, and then
1743
- // use get() to raise a ReferenceError for anything not on the safe global.
1744
- // But we want to be compatible with ReferenceError in the normal case and
1745
- // the lack of ReferenceError in the 'typeof' case. Must either reliably
1746
- // distinguish these two cases (the trap behavior might be different), or
1747
- // we rely on a mandatory source-to-source transform to change 'typeof abc'
1748
- // to XXX. We already need a mandatory parse to prevent the 'import',
1749
- // since it's a special form instead of merely being a global variable/
1750
-
1751
- // note: if we make has() return true always, then we must implement a
1752
- // set() trap to avoid subverting the protection of strict mode (it would
1753
- // accept assignments to undefined globals, when it ought to throw
1754
- // ReferenceError for such assignments)
1755
-
1756
- has(_shadow, prop) {
1757
- // unsafeGlobal: hide all properties of the current global
1758
- // at the expense of 'typeof' being wrong for those properties. For
1759
- // example, in the browser, evaluating 'document = 3', will add
1760
- // a property to globalObject instead of throwing a ReferenceError.
1761
-
1762
- // !!!!! WARNING: DANGER ZONE !!!!!!
1763
- // The order of the conditions in the `||` expression below is of the
1764
- // utmost importance. Under no circumstances should `eval` be checked
1765
- // after `globalObject`. The prototype of the global object is under
1766
- // full control of user code and may be replaced by a proxy with a
1767
- // `has` trap. If we allow that trap to trigger while the
1768
- // `allowNextEvalToBeUnsafe` flag is down, it could allow user code
1769
- // to get a hold of `FERAL_EVAL`, resulting in a complete escape of
1770
- // the compartment.
1771
- // !!!!! WARNING: DANGER ZONE !!!!!!
1772
- return(
1773
- sloppyGlobalsMode||
1774
- scopeController.allowNextEvalToBeUnsafe&& prop=== 'eval'||
1775
- prop in globalLexicals||
1776
- prop in globalObject||
1777
- prop in globalThis);
1879
+ // The scope handler's prototype is a proxy that throws if any trap other
1880
+ // than get/set/has are run (like getOwnPropertyDescriptors, apply,
1881
+ // getPrototypeOf).
1882
+ const strictScopeTerminatorHandler= freeze(
1883
+ create(
1884
+ alwaysThrowHandler,
1885
+ getOwnPropertyDescriptors(scopeProxyHandlerProperties)));$h‍_once.strictScopeTerminatorHandler(strictScopeTerminatorHandler);
1778
1886
 
1779
- },
1780
1887
 
1781
- // note: this is likely a bug of safari
1782
- // https://bugs.webkit.org/show_bug.cgi?id=195534
1783
1888
 
1784
- getPrototypeOf() {
1785
- return null;
1786
- },
1889
+ const strictScopeTerminator= new Proxy(
1890
+ immutableObject,
1891
+ strictScopeTerminatorHandler);$h‍_once.strictScopeTerminator(strictScopeTerminator);
1892
+ })
1893
+ ,
1894
+ // === functors[9] ===
1895
+ (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let Proxy,create,freeze,getOwnPropertyDescriptors,immutableObject,reflectSet,strictScopeTerminatorHandler,alwaysThrowHandler;$h‍_imports([["./commons.js", [["Proxy", [$h‍_a => (Proxy = $h‍_a)]],["create", [$h‍_a => (create = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["getOwnPropertyDescriptors", [$h‍_a => (getOwnPropertyDescriptors = $h‍_a)]],["immutableObject", [$h‍_a => (immutableObject = $h‍_a)]],["reflectSet", [$h‍_a => (reflectSet = $h‍_a)]]]],["./strict-scope-terminator.js", [["strictScopeTerminatorHandler", [$h‍_a => (strictScopeTerminatorHandler = $h‍_a)]],["alwaysThrowHandler", [$h‍_a => (alwaysThrowHandler = $h‍_a)]]]]]);
1787
1896
 
1788
- // Chip has seen this happen single stepping under the Chrome/v8 debugger.
1789
- // TODO record how to reliably reproduce, and to test if this fix helps.
1790
- // TODO report as bug to v8 or Chrome, and record issue link here.
1791
1897
 
1792
- getOwnPropertyDescriptor(_target, prop) {
1793
- // Coerce with `String` in case prop is a symbol.
1794
- const quotedProp= q(String(prop));
1795
- // eslint-disable-next-line @endo/no-polymorphic-call
1796
- console.warn(
1797
- `getOwnPropertyDescriptor trap on scopeHandler for ${quotedProp}`,
1798
- new TypeError().stack);
1799
1898
 
1800
- return undefined;
1899
+
1900
+
1901
+
1902
+
1903
+
1904
+
1905
+
1906
+
1907
+
1908
+ /*
1909
+ * createSloppyGlobalsScopeTerminator()
1910
+ * strictScopeTerminatorHandler manages a scopeTerminator Proxy which serves as
1911
+ * the final scope boundary that will always return "undefined" in order
1912
+ * to prevent access to "start compartment globals". When "sloppyGlobalsMode"
1913
+ * is true, the Proxy will perform sets on the "globalObject".
1914
+ */
1915
+ const createSloppyGlobalsScopeTerminator= (globalObject)=>{
1916
+ const scopeProxyHandlerProperties= {
1917
+ // inherit scopeTerminator behavior
1918
+ ...strictScopeTerminatorHandler,
1919
+
1920
+ // Redirect set properties to the globalObject.
1921
+ set(_shadow, prop, value) {
1922
+ return reflectSet(globalObject, prop, value);
1923
+ },
1924
+
1925
+ // Always claim to have a potential property in order to be the recipient of a set
1926
+ has(_shadow, _prop) {
1927
+ return true;
1801
1928
  }};
1802
1929
 
1803
1930
 
1804
1931
  // The scope handler's prototype is a proxy that throws if any trap other
1805
1932
  // than get/set/has are run (like getOwnPropertyDescriptors, apply,
1806
1933
  // getPrototypeOf).
1807
- const scopeHandler= freeze(
1934
+ const sloppyGlobalsScopeTerminatorHandler= freeze(
1808
1935
  create(
1809
1936
  alwaysThrowHandler,
1810
1937
  getOwnPropertyDescriptors(scopeProxyHandlerProperties)));
1811
1938
 
1812
1939
 
1813
1940
 
1814
- return {
1815
- scopeController,
1816
- scopeHandler};
1941
+ const sloppyGlobalsScopeTerminator= new Proxy(
1942
+ immutableObject,
1943
+ sloppyGlobalsScopeTerminatorHandler);
1944
+
1817
1945
 
1818
- };$h‍_once.createScopeHandler(createScopeHandler);
1946
+ return sloppyGlobalsScopeTerminator;
1947
+ };$h‍_once.createSloppyGlobalsScopeTerminator(createSloppyGlobalsScopeTerminator);
1819
1948
  })
1820
1949
  ,
1821
- // === functors[8] ===
1950
+ // === functors[10] ===
1822
1951
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_REG_EXP,regexpExec,stringSlice;$h‍_imports([["./commons.js", [["FERAL_REG_EXP", [$h‍_a => (FERAL_REG_EXP = $h‍_a)]],["regexpExec", [$h‍_a => (regexpExec = $h‍_a)]],["stringSlice", [$h‍_a => (stringSlice = $h‍_a)]]]]]);
1823
1952
 
1824
1953
  // Captures a key and value of the form #key=value or @key=value
@@ -1868,7 +1997,7 @@ const getSourceURL= (src)=>{
1868
1997
  };$h‍_once.getSourceURL(getSourceURL);
1869
1998
  })
1870
1999
  ,
1871
- // === functors[9] ===
2000
+ // === functors[11] ===
1872
2001
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_REG_EXP,SyntaxError,stringReplace,stringSearch,stringSlice,stringSplit,getSourceURL;$h‍_imports([["./commons.js", [["FERAL_REG_EXP", [$h‍_a => (FERAL_REG_EXP = $h‍_a)]],["SyntaxError", [$h‍_a => (SyntaxError = $h‍_a)]],["stringReplace", [$h‍_a => (stringReplace = $h‍_a)]],["stringSearch", [$h‍_a => (stringSearch = $h‍_a)]],["stringSlice", [$h‍_a => (stringSlice = $h‍_a)]],["stringSplit", [$h‍_a => (stringSplit = $h‍_a)]]]],["./get-source-url.js", [["getSourceURL", [$h‍_a => (getSourceURL = $h‍_a)]]]]]);
1873
2002
 
1874
2003
 
@@ -2122,13 +2251,8 @@ const applyTransforms= (source, transforms)=> {
2122
2251
  };$h‍_once.applyTransforms(applyTransforms);
2123
2252
  })
2124
2253
  ,
2125
- // === functors[10] ===
2126
- (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let WeakSet,apply,immutableObject,proxyRevocable,weaksetAdd,getScopeConstants,createScopeHandler,applyTransforms,mandatoryTransforms,makeEvaluateFactory,assert;$h‍_imports([["./commons.js", [["WeakSet", [$h‍_a => (WeakSet = $h‍_a)]],["apply", [$h‍_a => (apply = $h‍_a)]],["immutableObject", [$h‍_a => (immutableObject = $h‍_a)]],["proxyRevocable", [$h‍_a => (proxyRevocable = $h‍_a)]],["weaksetAdd", [$h‍_a => (weaksetAdd = $h‍_a)]]]],["./scope-constants.js", [["getScopeConstants", [$h‍_a => (getScopeConstants = $h‍_a)]]]],["./scope-handler.js", [["createScopeHandler", [$h‍_a => (createScopeHandler = $h‍_a)]]]],["./transforms.js", [["applyTransforms", [$h‍_a => (applyTransforms = $h‍_a)]],["mandatoryTransforms", [$h‍_a => (mandatoryTransforms = $h‍_a)]]]],["./make-evaluate-factory.js", [["makeEvaluateFactory", [$h‍_a => (makeEvaluateFactory = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]]]);
2127
-
2128
-
2129
-
2130
-
2131
-
2254
+ // === functors[12] ===
2255
+ (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let apply,freeze,strictScopeTerminator,createSloppyGlobalsScopeTerminator,makeEvalScopeKit,applyTransforms,mandatoryTransforms,makeEvaluate,assert;$h‍_imports([["./commons.js", [["apply", [$h‍_a => (apply = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]]]],["./strict-scope-terminator.js", [["strictScopeTerminator", [$h‍_a => (strictScopeTerminator = $h‍_a)]]]],["./sloppy-globals-scope-terminator.js", [["createSloppyGlobalsScopeTerminator", [$h‍_a => (createSloppyGlobalsScopeTerminator = $h‍_a)]]]],["./eval-scope.js", [["makeEvalScopeKit", [$h‍_a => (makeEvalScopeKit = $h‍_a)]]]],["./transforms.js", [["applyTransforms", [$h‍_a => (applyTransforms = $h‍_a)]],["mandatoryTransforms", [$h‍_a => (mandatoryTransforms = $h‍_a)]]]],["./make-evaluate.js", [["makeEvaluate", [$h‍_a => (makeEvaluate = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]]]);
2132
2256
 
2133
2257
 
2134
2258
 
@@ -2139,7 +2263,7 @@ const applyTransforms= (source, transforms)=> {
2139
2263
 
2140
2264
 
2141
2265
 
2142
- const { details: d}= assert;
2266
+ const { Fail}= assert;
2143
2267
 
2144
2268
  /**
2145
2269
  * makeSafeEvaluator()
@@ -2148,40 +2272,36 @@ const { details: d}= assert;
2148
2272
  *
2149
2273
  * @param {Object} options
2150
2274
  * @param {Object} options.globalObject
2151
- * @param {Object} [options.globalLexicals]
2275
+ * @param {Object} [options.moduleLexicals]
2152
2276
  * @param {Array<Transform>} [options.globalTransforms]
2153
2277
  * @param {bool} [options.sloppyGlobalsMode]
2154
- * @param {WeakSet} [options.knownScopeProxies]
2155
2278
  */
2156
2279
  const makeSafeEvaluator= ({
2157
2280
  globalObject,
2158
- globalLexicals= {},
2281
+ moduleLexicals= {},
2159
2282
  globalTransforms= [],
2160
- sloppyGlobalsMode= false,
2161
- knownScopeProxies= new WeakSet()}=
2283
+ sloppyGlobalsMode= false}=
2162
2284
  {})=> {
2163
- const { scopeHandler, scopeController}= createScopeHandler(
2285
+ const scopeTerminator= sloppyGlobalsMode?
2286
+ createSloppyGlobalsScopeTerminator(globalObject):
2287
+ strictScopeTerminator;
2288
+ const evalScopeKit= makeEvalScopeKit();
2289
+ const { evalScope}= evalScopeKit;
2290
+
2291
+ const evaluateContext= freeze({
2292
+ evalScope,
2293
+ moduleLexicals,
2164
2294
  globalObject,
2165
- globalLexicals,
2166
- {
2167
- sloppyGlobalsMode});
2295
+ scopeTerminator});
2168
2296
 
2169
2297
 
2170
- const { proxy: scopeProxy, revoke: revokeScopeProxy}= proxyRevocable(
2171
- immutableObject,
2172
- scopeHandler);
2173
-
2174
- weaksetAdd(knownScopeProxies, scopeProxy);
2175
-
2176
2298
  // Defer creating the actual evaluator to first use.
2177
2299
  // Creating a compartment should be possible in no-eval environments
2178
2300
  // It also allows more global constants to be captured by the optimizer
2179
2301
  let evaluate;
2180
- const makeEvaluate= ()=> {
2302
+ const provideEvaluate= ()=> {
2181
2303
  if( !evaluate) {
2182
- const constants= getScopeConstants(globalObject, globalLexicals);
2183
- const evaluateFactory= makeEvaluateFactory(constants);
2184
- evaluate= apply(evaluateFactory, scopeProxy, []);
2304
+ evaluate= makeEvaluate(evaluateContext);
2185
2305
  }
2186
2306
  };
2187
2307
 
@@ -2191,7 +2311,7 @@ const makeSafeEvaluator= ({
2191
2311
  * @param {Array<Transform>} [options.localTransforms]
2192
2312
  */
2193
2313
  const safeEvaluate= (source, { localTransforms= []}= {})=> {
2194
- makeEvaluate();
2314
+ provideEvaluate();
2195
2315
 
2196
2316
  // Execute the mandatory transforms last to ensure that any rewritten code
2197
2317
  // meets those mandatory requirements.
@@ -2201,9 +2321,12 @@ const makeSafeEvaluator= ({
2201
2321
  mandatoryTransforms]);
2202
2322
 
2203
2323
 
2204
- scopeController.allowNextEvalToBeUnsafe= true;
2205
2324
  let err;
2206
2325
  try {
2326
+ // Allow next reference to eval produce the unsafe FERAL_EVAL.
2327
+ // eslint-disable-next-line @endo/no-polymorphic-call
2328
+ evalScopeKit.allowNextEvalToBeUnsafe();
2329
+
2207
2330
  // Ensure that "this" resolves to the safe global.
2208
2331
  return apply(evaluate, globalObject, [source]);
2209
2332
  }catch( e) {
@@ -2211,15 +2334,14 @@ const makeSafeEvaluator= ({
2211
2334
  err= e;
2212
2335
  throw e;
2213
2336
  }finally {
2214
- const unsafeEvalWasStillExposed= scopeController.allowNextEvalToBeUnsafe;
2215
- scopeController.allowNextEvalToBeUnsafe= false;
2337
+ const unsafeEvalWasStillExposed=( 'eval'in evalScope);
2338
+ delete evalScope.eval;
2216
2339
  if( unsafeEvalWasStillExposed) {
2217
- // Barring a defect in the SES shim, the scope proxy should allow the
2340
+ // Barring a defect in the SES shim, the evalScope should allow the
2218
2341
  // powerful, unsafe `eval` to be used by `evaluate` exactly once, as the
2219
2342
  // very first name that it attempts to access from the lexical scope.
2220
2343
  // A defect in the SES shim could throw an exception after we set
2221
- // `scopeController.allowNextEvalToBeUnsafe` and before `evaluate`
2222
- // calls `eval` internally.
2344
+ // `evalScope.eval` and before `evaluate` calls `eval` internally.
2223
2345
  // If we get here, SES is very broken.
2224
2346
  // This condition is one where this vat is now hopelessly confused, and
2225
2347
  // the vat as a whole should be aborted.
@@ -2229,11 +2351,10 @@ const makeSafeEvaluator= ({
2229
2351
  // variable resolution via the scopeHandler, and throw an error with
2230
2352
  // diagnostic info including the thrown error if any from evaluating the
2231
2353
  // source code.
2232
- revokeScopeProxy();
2354
+ evalScopeKit.revoked= { err};
2233
2355
  // TODO A GOOD PLACE TO PANIC(), i.e., kill the vat incarnation.
2234
2356
  // See https://github.com/Agoric/SES-shim/issues/490
2235
- // eslint-disable-next-line @endo/no-polymorphic-call
2236
- assert.fail(d `handler did not reset allowNextEvalToBeUnsafe ${err}`);
2357
+ Fail `handler did not reset allowNextEvalToBeUnsafe ${err}`;
2237
2358
  }
2238
2359
  }
2239
2360
  };
@@ -2242,9 +2363,8 @@ const makeSafeEvaluator= ({
2242
2363
  };$h‍_once.makeSafeEvaluator(makeSafeEvaluator);
2243
2364
  })
2244
2365
  ,
2245
- // === functors[11] ===
2246
- (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let TypeError,arrayPush,create,defineProperties,getOwnPropertyDescriptors,evadeHtmlCommentTest,evadeImportExpressionTest,rejectSomeDirectEvalExpressions,makeSafeEvaluator;$h‍_imports([["./commons.js", [["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["arrayPush", [$h‍_a => (arrayPush = $h‍_a)]],["create", [$h‍_a => (create = $h‍_a)]],["defineProperties", [$h‍_a => (defineProperties = $h‍_a)]],["getOwnPropertyDescriptors", [$h‍_a => (getOwnPropertyDescriptors = $h‍_a)]]]],["./transforms.js", [["evadeHtmlCommentTest", [$h‍_a => (evadeHtmlCommentTest = $h‍_a)]],["evadeImportExpressionTest", [$h‍_a => (evadeImportExpressionTest = $h‍_a)]],["rejectSomeDirectEvalExpressions", [$h‍_a => (rejectSomeDirectEvalExpressions = $h‍_a)]]]],["./make-safe-evaluator.js", [["makeSafeEvaluator", [$h‍_a => (makeSafeEvaluator = $h‍_a)]]]]]);
2247
-
2366
+ // === functors[13] ===
2367
+ (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let TypeError,arrayPush,create,getOwnPropertyDescriptors,evadeHtmlCommentTest,evadeImportExpressionTest,rejectSomeDirectEvalExpressions,makeSafeEvaluator;$h‍_imports([["./commons.js", [["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["arrayPush", [$h‍_a => (arrayPush = $h‍_a)]],["create", [$h‍_a => (create = $h‍_a)]],["getOwnPropertyDescriptors", [$h‍_a => (getOwnPropertyDescriptors = $h‍_a)]]]],["./transforms.js", [["evadeHtmlCommentTest", [$h‍_a => (evadeHtmlCommentTest = $h‍_a)]],["evadeImportExpressionTest", [$h‍_a => (evadeImportExpressionTest = $h‍_a)]],["rejectSomeDirectEvalExpressions", [$h‍_a => (rejectSomeDirectEvalExpressions = $h‍_a)]]]],["./make-safe-evaluator.js", [["makeSafeEvaluator", [$h‍_a => (makeSafeEvaluator = $h‍_a)]]]]]);
2248
2368
 
2249
2369
 
2250
2370
 
@@ -2273,13 +2393,9 @@ const provideCompartmentEvaluator= (compartmentFields, options)=> {
2273
2393
  // shared evaluator so we need to build a new one
2274
2394
 
2275
2395
  let { globalTransforms}= compartmentFields;
2276
- const {
2277
- globalObject,
2278
- globalLexicals,
2279
- knownScopeProxies}=
2280
- compartmentFields;
2396
+ const { globalObject}= compartmentFields;
2281
2397
 
2282
- let localObject= globalLexicals;
2398
+ let moduleLexicals;
2283
2399
  if( __moduleShimLexicals__!== undefined) {
2284
2400
  // When using `evaluate` for ESM modules, as should only occur from the
2285
2401
  // module-shim's module-instance.js, we do not reveal the SES-shim's
@@ -2291,19 +2407,17 @@ const provideCompartmentEvaluator= (compartmentFields, options)=> {
2291
2407
  // and `import`, at the expense of being tightly coupled to SES-shim.
2292
2408
  globalTransforms= undefined;
2293
2409
 
2294
- localObject= create(null, getOwnPropertyDescriptors(globalLexicals));
2295
- defineProperties(
2296
- localObject,
2410
+ moduleLexicals= create(
2411
+ null,
2297
2412
  getOwnPropertyDescriptors(__moduleShimLexicals__));
2298
2413
 
2299
2414
  }
2300
2415
 
2301
2416
  ({ safeEvaluate}= makeSafeEvaluator({
2302
2417
  globalObject,
2303
- globalLexicals: localObject,
2418
+ moduleLexicals,
2304
2419
  globalTransforms,
2305
- sloppyGlobalsMode,
2306
- knownScopeProxies}));
2420
+ sloppyGlobalsMode}));
2307
2421
 
2308
2422
  }
2309
2423
 
@@ -2311,7 +2425,7 @@ const provideCompartmentEvaluator= (compartmentFields, options)=> {
2311
2425
  };$h‍_once.provideCompartmentEvaluator(provideCompartmentEvaluator);
2312
2426
 
2313
2427
  const compartmentEvaluate= (compartmentFields, source, options)=> {
2314
- // Perform this check first to avoid unecessary sanitizing.
2428
+ // Perform this check first to avoid unnecessary sanitizing.
2315
2429
  // TODO Maybe relax string check and coerce instead:
2316
2430
  // https://github.com/tc39/proposal-dynamic-code-brand-checks
2317
2431
  if( typeof source!== 'string') {
@@ -2347,7 +2461,7 @@ const compartmentEvaluate= (compartmentFields, source, options)=> {
2347
2461
  };$h‍_once.compartmentEvaluate(compartmentEvaluate);
2348
2462
  })
2349
2463
  ,
2350
- // === functors[12] ===
2464
+ // === functors[14] ===
2351
2465
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { $h‍_imports([]); /**
2352
2466
  * makeEvalFunction()
2353
2467
  * A safe version of the native eval function which relies on
@@ -2377,7 +2491,7 @@ const makeEvalFunction= (safeEvaluate)=>{
2377
2491
  };$h‍_once.makeEvalFunction(makeEvalFunction);
2378
2492
  })
2379
2493
  ,
2380
- // === functors[13] ===
2494
+ // === functors[15] ===
2381
2495
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_FUNCTION,arrayJoin,arrayPop,defineProperties,getPrototypeOf,assert;$h‍_imports([["./commons.js", [["FERAL_FUNCTION", [$h‍_a => (FERAL_FUNCTION = $h‍_a)]],["arrayJoin", [$h‍_a => (arrayJoin = $h‍_a)]],["arrayPop", [$h‍_a => (arrayPop = $h‍_a)]],["defineProperties", [$h‍_a => (defineProperties = $h‍_a)]],["getPrototypeOf", [$h‍_a => (getPrototypeOf = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]]]);
2382
2496
 
2383
2497
 
@@ -2387,6 +2501,8 @@ const makeEvalFunction= (safeEvaluate)=>{
2387
2501
 
2388
2502
 
2389
2503
 
2504
+ const { Fail}= assert;
2505
+
2390
2506
  /*
2391
2507
  * makeFunctionConstructor()
2392
2508
  * A safe version of the native Function which relies on
@@ -2447,20 +2563,16 @@ const makeFunctionConstructor= (safeEvaluate)=>{
2447
2563
 
2448
2564
 
2449
2565
  // Assert identity of Function.__proto__ accross all compartments
2450
- assert(
2451
- getPrototypeOf(FERAL_FUNCTION)=== FERAL_FUNCTION.prototype,
2452
- 'Function prototype is the same accross compartments');
2453
-
2454
- assert(
2455
- getPrototypeOf(newFunction)=== FERAL_FUNCTION.prototype,
2456
- 'Function constructor prototype is the same accross compartments');
2457
-
2566
+ getPrototypeOf(FERAL_FUNCTION)=== FERAL_FUNCTION.prototype||
2567
+ Fail `Function prototype is the same accross compartments`;
2568
+ getPrototypeOf(newFunction)=== FERAL_FUNCTION.prototype||
2569
+ Fail `Function constructor prototype is the same accross compartments`;
2458
2570
 
2459
2571
  return newFunction;
2460
2572
  };$h‍_once.makeFunctionConstructor(makeFunctionConstructor);
2461
2573
  })
2462
2574
  ,
2463
- // === functors[14] ===
2575
+ // === functors[16] ===
2464
2576
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { $h‍_imports([]); /* eslint-disable no-restricted-globals */
2465
2577
  /**
2466
2578
  * @file Exports {@code whitelist}, a recursively defined
@@ -3824,7 +3936,6 @@ const whitelist= {
3824
3936
  name: getter,
3825
3937
  // Should this be proposed?
3826
3938
  toString: fn,
3827
- __isKnownScopeProxy__: fn,
3828
3939
  import: asyncFn,
3829
3940
  load: asyncFn,
3830
3941
  importNow: fn,
@@ -3837,12 +3948,51 @@ const whitelist= {
3837
3948
  '%InitialGetStackString%': fn};$h‍_once.whitelist(whitelist);
3838
3949
  })
3839
3950
  ,
3840
- // === functors[15] ===
3841
- (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let defineProperty,objectHasOwnProperty,entries,makeEvalFunction,makeFunctionConstructor,constantProperties,universalPropertyNames;$h‍_imports([["./commons.js", [["defineProperty", [$h‍_a => (defineProperty = $h‍_a)]],["objectHasOwnProperty", [$h‍_a => (objectHasOwnProperty = $h‍_a)]],["entries", [$h‍_a => (entries = $h‍_a)]]]],["./make-eval-function.js", [["makeEvalFunction", [$h‍_a => (makeEvalFunction = $h‍_a)]]]],["./make-function-constructor.js", [["makeFunctionConstructor", [$h‍_a => (makeFunctionConstructor = $h‍_a)]]]],["./whitelist.js", [["constantProperties", [$h‍_a => (constantProperties = $h‍_a)]],["universalPropertyNames", [$h‍_a => (universalPropertyNames = $h‍_a)]]]]]);
3951
+ // === functors[17] ===
3952
+ (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let TypeError,assign,create,defineProperty,entries,freeze,objectHasOwnProperty,unscopablesSymbol,makeEvalFunction,makeFunctionConstructor,constantProperties,universalPropertyNames;$h‍_imports([["./commons.js", [["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["assign", [$h‍_a => (assign = $h‍_a)]],["create", [$h‍_a => (create = $h‍_a)]],["defineProperty", [$h‍_a => (defineProperty = $h‍_a)]],["entries", [$h‍_a => (entries = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["objectHasOwnProperty", [$h‍_a => (objectHasOwnProperty = $h‍_a)]],["unscopablesSymbol", [$h‍_a => (unscopablesSymbol = $h‍_a)]]]],["./make-eval-function.js", [["makeEvalFunction", [$h‍_a => (makeEvalFunction = $h‍_a)]]]],["./make-function-constructor.js", [["makeFunctionConstructor", [$h‍_a => (makeFunctionConstructor = $h‍_a)]]]],["./whitelist.js", [["constantProperties", [$h‍_a => (constantProperties = $h‍_a)]],["universalPropertyNames", [$h‍_a => (universalPropertyNames = $h‍_a)]]]]]);
3953
+
3954
+
3955
+
3956
+
3957
+
3958
+
3959
+
3960
+
3961
+
3842
3962
 
3843
3963
 
3844
3964
 
3845
3965
 
3966
+ /**
3967
+ * The host's ordinary global object is not provided by a `with` block, so
3968
+ * assigning to Symbol.unscopables has no effect.
3969
+ * Since this shim uses `with` blocks to create a confined lexical scope for
3970
+ * guest programs, we cannot emulate the proper behavior.
3971
+ * With this shim, assigning Symbol.unscopables causes the given lexical
3972
+ * names to fall through to the terminal scope proxy.
3973
+ * But, we can install this setter to prevent a program from proceding on
3974
+ * this false assumption.
3975
+ *
3976
+ * @param {Object} globalObject
3977
+ */
3978
+ const setGlobalObjectSymbolUnscopables= (globalObject)=>{
3979
+ defineProperty(
3980
+ globalObject,
3981
+ unscopablesSymbol,
3982
+ freeze(
3983
+ assign(create(null), {
3984
+ set: freeze(()=> {
3985
+ throw new TypeError(
3986
+ `Cannot set Symbol.unscopables of a Compartment's globalThis`);
3987
+
3988
+ }),
3989
+ enumerable: false,
3990
+ configurable: false})));
3991
+
3992
+
3993
+
3994
+ };
3995
+
3846
3996
  /**
3847
3997
  * setGlobalObjectConstantProperties()
3848
3998
  * Initializes a new global object using a process similar to ECMA specifications
@@ -3850,7 +4000,7 @@ const whitelist= {
3850
4000
  * `setGlobalObjectMutableProperties`.
3851
4001
  *
3852
4002
  * @param {Object} globalObject
3853
- */
4003
+ */$h‍_once.setGlobalObjectSymbolUnscopables(setGlobalObjectSymbolUnscopables);
3854
4004
  const setGlobalObjectConstantProperties= (globalObject)=>{
3855
4005
  for( const [name, constant]of entries(constantProperties)) {
3856
4006
  defineProperty(globalObject, name, {
@@ -3968,7 +4118,7 @@ const setGlobalObjectEvaluators= (
3968
4118
  };$h‍_once.setGlobalObjectEvaluators(setGlobalObjectEvaluators);
3969
4119
  })
3970
4120
  ,
3971
- // === functors[16] ===
4121
+ // === functors[18] ===
3972
4122
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let ReferenceError,TypeError,Map,Set,arrayJoin,arrayMap,arrayPush,create,freeze,mapGet,mapHas,mapSet,setAdd,promiseCatch,promiseThen,values,weakmapGet,assert;$h‍_imports([["./commons.js", [["ReferenceError", [$h‍_a => (ReferenceError = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["Map", [$h‍_a => (Map = $h‍_a)]],["Set", [$h‍_a => (Set = $h‍_a)]],["arrayJoin", [$h‍_a => (arrayJoin = $h‍_a)]],["arrayMap", [$h‍_a => (arrayMap = $h‍_a)]],["arrayPush", [$h‍_a => (arrayPush = $h‍_a)]],["create", [$h‍_a => (create = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["mapGet", [$h‍_a => (mapGet = $h‍_a)]],["mapHas", [$h‍_a => (mapHas = $h‍_a)]],["mapSet", [$h‍_a => (mapSet = $h‍_a)]],["setAdd", [$h‍_a => (setAdd = $h‍_a)]],["promiseCatch", [$h‍_a => (promiseCatch = $h‍_a)]],["promiseThen", [$h‍_a => (promiseThen = $h‍_a)]],["values", [$h‍_a => (values = $h‍_a)]],["weakmapGet", [$h‍_a => (weakmapGet = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]]]);
3973
4123
 
3974
4124
 
@@ -3998,7 +4148,7 @@ const setGlobalObjectEvaluators= (
3998
4148
 
3999
4149
 
4000
4150
 
4001
- const { details: d, quote: q}= assert;
4151
+ const { Fail, details: d, quote: q}= assert;
4002
4152
 
4003
4153
  const noop= ()=> { };
4004
4154
 
@@ -4141,12 +4291,9 @@ const loadWithoutErrorAnnotation= async(
4141
4291
  const staticModuleRecord= await importHook(moduleSpecifier);
4142
4292
 
4143
4293
  if( staticModuleRecord=== null|| typeof staticModuleRecord!== 'object') {
4144
- // eslint-disable-next-line @endo/no-polymorphic-call
4145
- assert.fail(
4146
- d `importHook must return a promise for an object, for module ${q(
4147
- moduleSpecifier)
4148
- } in compartment ${q(compartment.name)}`);
4149
-
4294
+ Fail `importHook must return a promise for an object, for module ${q(
4295
+ moduleSpecifier)
4296
+ } in compartment ${q(compartment.name)}`;
4150
4297
  }
4151
4298
 
4152
4299
  if( staticModuleRecord.record!== undefined) {
@@ -4300,7 +4447,7 @@ const load= async(
4300
4447
  };$h‍_once.load(load);
4301
4448
  })
4302
4449
  ,
4303
- // === functors[17] ===
4450
+ // === functors[19] ===
4304
4451
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let makeAlias,Proxy,TypeError,create,freeze,mapGet,mapHas,mapSet,ownKeys,reflectGet,reflectGetOwnPropertyDescriptor,reflectHas,reflectIsExtensible,reflectPreventExtensions,weakmapSet,assert;$h‍_imports([["./module-load.js", [["makeAlias", [$h‍_a => (makeAlias = $h‍_a)]]]],["./commons.js", [["Proxy", [$h‍_a => (Proxy = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["create", [$h‍_a => (create = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["mapGet", [$h‍_a => (mapGet = $h‍_a)]],["mapHas", [$h‍_a => (mapHas = $h‍_a)]],["mapSet", [$h‍_a => (mapSet = $h‍_a)]],["ownKeys", [$h‍_a => (ownKeys = $h‍_a)]],["reflectGet", [$h‍_a => (reflectGet = $h‍_a)]],["reflectGetOwnPropertyDescriptor", [$h‍_a => (reflectGetOwnPropertyDescriptor = $h‍_a)]],["reflectHas", [$h‍_a => (reflectHas = $h‍_a)]],["reflectIsExtensible", [$h‍_a => (reflectIsExtensible = $h‍_a)]],["reflectPreventExtensions", [$h‍_a => (reflectPreventExtensions = $h‍_a)]],["weakmapSet", [$h‍_a => (weakmapSet = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]]]);
4305
4452
 
4306
4453
 
@@ -4475,7 +4622,7 @@ $h‍_once.deferExports(deferExports);const getDeferredExports=(
4475
4622
  };$h‍_once.getDeferredExports(getDeferredExports);
4476
4623
  })
4477
4624
  ,
4478
- // === functors[18] ===
4625
+ // === functors[20] ===
4479
4626
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let assert,getDeferredExports,ReferenceError,SyntaxError,TypeError,arrayForEach,arrayIncludes,arrayPush,arraySome,arraySort,create,defineProperty,entries,freeze,isArray,keys,mapGet,weakmapGet,reflectHas,assign,compartmentEvaluate;$h‍_imports([["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]],["./module-proxy.js", [["getDeferredExports", [$h‍_a => (getDeferredExports = $h‍_a)]]]],["./commons.js", [["ReferenceError", [$h‍_a => (ReferenceError = $h‍_a)]],["SyntaxError", [$h‍_a => (SyntaxError = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["arrayForEach", [$h‍_a => (arrayForEach = $h‍_a)]],["arrayIncludes", [$h‍_a => (arrayIncludes = $h‍_a)]],["arrayPush", [$h‍_a => (arrayPush = $h‍_a)]],["arraySome", [$h‍_a => (arraySome = $h‍_a)]],["arraySort", [$h‍_a => (arraySort = $h‍_a)]],["create", [$h‍_a => (create = $h‍_a)]],["defineProperty", [$h‍_a => (defineProperty = $h‍_a)]],["entries", [$h‍_a => (entries = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["isArray", [$h‍_a => (isArray = $h‍_a)]],["keys", [$h‍_a => (keys = $h‍_a)]],["mapGet", [$h‍_a => (mapGet = $h‍_a)]],["weakmapGet", [$h‍_a => (weakmapGet = $h‍_a)]],["reflectHas", [$h‍_a => (reflectHas = $h‍_a)]],["assign", [$h‍_a => (assign = $h‍_a)]]]],["./compartment-evaluate.js", [["compartmentEvaluate", [$h‍_a => (compartmentEvaluate = $h‍_a)]]]]]);
4480
4627
 
4481
4628
 
@@ -4630,10 +4777,10 @@ $h‍_once.makeThirdPartyModuleInstance(makeThirdPartyModuleInstance);const make
4630
4777
  // object (eventually proxied).
4631
4778
  const exportsProps= create(null);
4632
4779
 
4633
- // {_localName_: accessor} proxy traps for globalLexicals and live bindings.
4634
- // The globalLexicals object is frozen and the corresponding properties of
4635
- // localLexicals must be immutable, so we copy the descriptors.
4636
- const localLexicals= create(null);
4780
+ // {_localName_: accessor} proxy traps for moduleLexicals and live bindings.
4781
+ // The moduleLexicals object is frozen and the corresponding properties of
4782
+ // moduleLexicals must be immutable, so we copy the descriptors.
4783
+ const moduleLexicals= create(null);
4637
4784
 
4638
4785
  // {_localName_: init(initValue) -> initValue} used by the
4639
4786
  // rewritten code to initialize exported fixed bindings.
@@ -4799,7 +4946,7 @@ $h‍_once.makeThirdPartyModuleInstance(makeThirdPartyModuleInstance);const make
4799
4946
 
4800
4947
  localGetNotify[localName]= liveGetNotify;
4801
4948
  if( setProxyTrap) {
4802
- defineProperty(localLexicals, localName, {
4949
+ defineProperty(moduleLexicals, localName, {
4803
4950
  get,
4804
4951
  set,
4805
4952
  enumerable: true,
@@ -4915,7 +5062,7 @@ $h‍_once.makeThirdPartyModuleInstance(makeThirdPartyModuleInstance);const make
4915
5062
  let optFunctor= compartmentEvaluate(compartmentFields, functorSource, {
4916
5063
  globalObject: compartment.globalThis,
4917
5064
  transforms: __shimTransforms__,
4918
- __moduleShimLexicals__: localLexicals});
5065
+ __moduleShimLexicals__: moduleLexicals});
4919
5066
 
4920
5067
  let didThrow= false;
4921
5068
  let thrownError;
@@ -4953,7 +5100,7 @@ $h‍_once.makeThirdPartyModuleInstance(makeThirdPartyModuleInstance);const make
4953
5100
  };$h‍_once.makeModuleInstance(makeModuleInstance);
4954
5101
  })
4955
5102
  ,
4956
- // === functors[19] ===
5103
+ // === functors[21] ===
4957
5104
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let assert,makeModuleInstance,makeThirdPartyModuleInstance,Map,ReferenceError,TypeError,entries,isArray,isObject,mapGet,mapHas,mapSet,weakmapGet;$h‍_imports([["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]],["./module-instance.js", [["makeModuleInstance", [$h‍_a => (makeModuleInstance = $h‍_a)]],["makeThirdPartyModuleInstance", [$h‍_a => (makeThirdPartyModuleInstance = $h‍_a)]]]],["./commons.js", [["Map", [$h‍_a => (Map = $h‍_a)]],["ReferenceError", [$h‍_a => (ReferenceError = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["entries", [$h‍_a => (entries = $h‍_a)]],["isArray", [$h‍_a => (isArray = $h‍_a)]],["isObject", [$h‍_a => (isObject = $h‍_a)]],["mapGet", [$h‍_a => (mapGet = $h‍_a)]],["mapHas", [$h‍_a => (mapHas = $h‍_a)]],["mapSet", [$h‍_a => (mapSet = $h‍_a)]],["weakmapGet", [$h‍_a => (weakmapGet = $h‍_a)]]]]]);
4958
5105
 
4959
5106
 
@@ -4982,7 +5129,7 @@ $h‍_once.makeThirdPartyModuleInstance(makeThirdPartyModuleInstance);const make
4982
5129
 
4983
5130
 
4984
5131
 
4985
- const { quote: q}= assert;
5132
+ const { Fail, quote: q}= assert;
4986
5133
 
4987
5134
  // `link` creates `ModuleInstances` and `ModuleNamespaces` for a module and its
4988
5135
  // transitive dependencies and connects their imports and exports.
@@ -5026,18 +5173,14 @@ function validatePrecompiledStaticModuleRecord(
5026
5173
  moduleSpecifier)
5027
5174
  {
5028
5175
  const { __fixedExportMap__, __liveExportMap__}= staticModuleRecord;
5029
- assert(
5030
- isObject(__fixedExportMap__),
5031
- `Property '__fixedExportMap__' of a precompiled module record must be an object, got ${q(
5176
+ isObject(__fixedExportMap__)||
5177
+ Fail `Property '__fixedExportMap__' of a precompiled module record must be an object, got ${q(
5032
5178
  __fixedExportMap__)
5033
- }, for module ${q(moduleSpecifier)}`);
5034
-
5035
- assert(
5036
- isObject(__liveExportMap__),
5037
- `Property '__liveExportMap__' of a precompiled module record must be an object, got ${q(
5179
+ }, for module ${q(moduleSpecifier)}`;
5180
+ isObject(__liveExportMap__)||
5181
+ Fail `Property '__liveExportMap__' of a precompiled module record must be an object, got ${q(
5038
5182
  __liveExportMap__)
5039
- }, for module ${q(moduleSpecifier)}`);
5040
-
5183
+ }, for module ${q(moduleSpecifier)}`;
5041
5184
  }
5042
5185
 
5043
5186
  function isThirdParty(staticModuleRecord) {
@@ -5049,40 +5192,30 @@ function validateThirdPartyStaticModuleRecord(
5049
5192
  moduleSpecifier)
5050
5193
  {
5051
5194
  const { exports}= staticModuleRecord;
5052
- assert(
5053
- isArray(exports),
5054
- `Property 'exports' of a third-party static module record must be an array, got ${q(
5195
+ isArray(exports)||
5196
+ Fail `Property 'exports' of a third-party static module record must be an array, got ${q(
5055
5197
  exports)
5056
- }, for module ${q(moduleSpecifier)}`);
5057
-
5198
+ }, for module ${q(moduleSpecifier)}`;
5058
5199
  }
5059
5200
 
5060
5201
  function validateStaticModuleRecord(staticModuleRecord, moduleSpecifier) {
5061
- assert(
5062
- isObject(staticModuleRecord),
5063
- `Static module records must be of type object, got ${q(
5202
+ isObject(staticModuleRecord)||
5203
+ Fail `Static module records must be of type object, got ${q(
5064
5204
  staticModuleRecord)
5065
- }, for module ${q(moduleSpecifier)}`);
5066
-
5205
+ }, for module ${q(moduleSpecifier)}`;
5067
5206
  const { imports, exports, reexports= []}= staticModuleRecord;
5068
- assert(
5069
- isArray(imports),
5070
- `Property 'imports' of a static module record must be an array, got ${q(
5207
+ isArray(imports)||
5208
+ Fail `Property 'imports' of a static module record must be an array, got ${q(
5071
5209
  imports)
5072
- }, for module ${q(moduleSpecifier)}`);
5073
-
5074
- assert(
5075
- isArray(exports),
5076
- `Property 'exports' of a precompiled module record must be an array, got ${q(
5210
+ }, for module ${q(moduleSpecifier)}`;
5211
+ isArray(exports)||
5212
+ Fail `Property 'exports' of a precompiled module record must be an array, got ${q(
5077
5213
  exports)
5078
- }, for module ${q(moduleSpecifier)}`);
5079
-
5080
- assert(
5081
- isArray(reexports),
5082
- `Property 'reexports' of a precompiled module record must be an array if present, got ${q(
5214
+ }, for module ${q(moduleSpecifier)}`;
5215
+ isArray(reexports)||
5216
+ Fail `Property 'reexports' of a precompiled module record must be an array if present, got ${q(
5083
5217
  reexports)
5084
- }, for module ${q(moduleSpecifier)}`);
5085
-
5218
+ }, for module ${q(moduleSpecifier)}`;
5086
5219
  }
5087
5220
 
5088
5221
  const instantiate= (
@@ -5151,14 +5284,8 @@ const instantiate= (
5151
5284
  };$h‍_once.instantiate(instantiate);
5152
5285
  })
5153
5286
  ,
5154
- // === functors[20] ===
5155
- (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let Map,ReferenceError,TypeError,WeakMap,WeakSet,arrayFilter,arrayJoin,assign,defineProperties,entries,freeze,getOwnPropertyNames,promiseThen,weakmapGet,weakmapSet,weaksetHas,setGlobalObjectConstantProperties,setGlobalObjectMutableProperties,setGlobalObjectEvaluators,isValidIdentifierName,sharedGlobalPropertyNames,load,link,getDeferredExports,assert,compartmentEvaluate,makeSafeEvaluator;$h‍_imports([["./commons.js", [["Map", [$h‍_a => (Map = $h‍_a)]],["ReferenceError", [$h‍_a => (ReferenceError = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["WeakMap", [$h‍_a => (WeakMap = $h‍_a)]],["WeakSet", [$h‍_a => (WeakSet = $h‍_a)]],["arrayFilter", [$h‍_a => (arrayFilter = $h‍_a)]],["arrayJoin", [$h‍_a => (arrayJoin = $h‍_a)]],["assign", [$h‍_a => (assign = $h‍_a)]],["defineProperties", [$h‍_a => (defineProperties = $h‍_a)]],["entries", [$h‍_a => (entries = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["getOwnPropertyNames", [$h‍_a => (getOwnPropertyNames = $h‍_a)]],["promiseThen", [$h‍_a => (promiseThen = $h‍_a)]],["weakmapGet", [$h‍_a => (weakmapGet = $h‍_a)]],["weakmapSet", [$h‍_a => (weakmapSet = $h‍_a)]],["weaksetHas", [$h‍_a => (weaksetHas = $h‍_a)]]]],["./global-object.js", [["setGlobalObjectConstantProperties", [$h‍_a => (setGlobalObjectConstantProperties = $h‍_a)]],["setGlobalObjectMutableProperties", [$h‍_a => (setGlobalObjectMutableProperties = $h‍_a)]],["setGlobalObjectEvaluators", [$h‍_a => (setGlobalObjectEvaluators = $h‍_a)]]]],["./scope-constants.js", [["isValidIdentifierName", [$h‍_a => (isValidIdentifierName = $h‍_a)]]]],["./whitelist.js", [["sharedGlobalPropertyNames", [$h‍_a => (sharedGlobalPropertyNames = $h‍_a)]]]],["./module-load.js", [["load", [$h‍_a => (load = $h‍_a)]]]],["./module-link.js", [["link", [$h‍_a => (link = $h‍_a)]]]],["./module-proxy.js", [["getDeferredExports", [$h‍_a => (getDeferredExports = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]],["./compartment-evaluate.js", [["compartmentEvaluate", [$h‍_a => (compartmentEvaluate = $h‍_a)]]]],["./make-safe-evaluator.js", [["makeSafeEvaluator", [$h‍_a => (makeSafeEvaluator = $h‍_a)]]]]]);
5156
-
5157
-
5158
-
5159
-
5160
-
5161
-
5287
+ // === functors[22] ===
5288
+ (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let Map,ReferenceError,TypeError,WeakMap,assign,defineProperties,entries,promiseThen,weakmapGet,weakmapSet,setGlobalObjectSymbolUnscopables,setGlobalObjectConstantProperties,setGlobalObjectMutableProperties,setGlobalObjectEvaluators,sharedGlobalPropertyNames,load,link,getDeferredExports,assert,compartmentEvaluate,makeSafeEvaluator;$h‍_imports([["./commons.js", [["Map", [$h‍_a => (Map = $h‍_a)]],["ReferenceError", [$h‍_a => (ReferenceError = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["WeakMap", [$h‍_a => (WeakMap = $h‍_a)]],["assign", [$h‍_a => (assign = $h‍_a)]],["defineProperties", [$h‍_a => (defineProperties = $h‍_a)]],["entries", [$h‍_a => (entries = $h‍_a)]],["promiseThen", [$h‍_a => (promiseThen = $h‍_a)]],["weakmapGet", [$h‍_a => (weakmapGet = $h‍_a)]],["weakmapSet", [$h‍_a => (weakmapSet = $h‍_a)]]]],["./global-object.js", [["setGlobalObjectSymbolUnscopables", [$h‍_a => (setGlobalObjectSymbolUnscopables = $h‍_a)]],["setGlobalObjectConstantProperties", [$h‍_a => (setGlobalObjectConstantProperties = $h‍_a)]],["setGlobalObjectMutableProperties", [$h‍_a => (setGlobalObjectMutableProperties = $h‍_a)]],["setGlobalObjectEvaluators", [$h‍_a => (setGlobalObjectEvaluators = $h‍_a)]]]],["./whitelist.js", [["sharedGlobalPropertyNames", [$h‍_a => (sharedGlobalPropertyNames = $h‍_a)]]]],["./module-load.js", [["load", [$h‍_a => (load = $h‍_a)]]]],["./module-link.js", [["link", [$h‍_a => (link = $h‍_a)]]]],["./module-proxy.js", [["getDeferredExports", [$h‍_a => (getDeferredExports = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]],["./compartment-evaluate.js", [["compartmentEvaluate", [$h‍_a => (compartmentEvaluate = $h‍_a)]]]],["./make-safe-evaluator.js", [["makeSafeEvaluator", [$h‍_a => (makeSafeEvaluator = $h‍_a)]]]]]);
5162
5289
 
5163
5290
 
5164
5291
 
@@ -5273,12 +5400,6 @@ const CompartmentPrototype= {
5273
5400
  return '[object Compartment]';
5274
5401
  },
5275
5402
 
5276
- /* eslint-disable-next-line no-underscore-dangle */
5277
- __isKnownScopeProxy__(value) {
5278
- const { knownScopeProxies}= weakmapGet(privateFields, this);
5279
- return weaksetHas(knownScopeProxies, value);
5280
- },
5281
-
5282
5403
  module(specifier) {
5283
5404
  if( typeof specifier!== 'string') {
5284
5405
  throw new TypeError('first argument of module() must be a string');
@@ -5368,7 +5489,6 @@ const makeCompartmentConstructor= (
5368
5489
  name= '<unknown>',
5369
5490
  transforms= [],
5370
5491
  __shimTransforms__= [],
5371
- globalLexicals: globalLexicalsOption= {},
5372
5492
  resolveHook,
5373
5493
  importHook,
5374
5494
  moduleMapHook,
@@ -5407,30 +5527,10 @@ const makeCompartmentConstructor= (
5407
5527
  }
5408
5528
  }
5409
5529
 
5410
- const invalidNames= arrayFilter(
5411
- getOwnPropertyNames(globalLexicalsOption),
5412
- (identifier)=>!isValidIdentifierName(identifier));
5413
-
5414
- if( invalidNames.length) {
5415
- throw new TypeError(
5416
- `Cannot create compartment with invalid names for global lexicals: ${arrayJoin(
5417
- invalidNames,
5418
- ', ')
5419
- }; these names would not be lexically mentionable`);
5420
-
5421
- }
5422
- // The caller continues to own the globalLexicals object they passed to
5423
- // the compartment constructor, but the compartment only respects the
5424
- // original values and they are constants in the scope of evaluated
5425
- // programs and executed modules.
5426
- // This shallow copy captures only the values of enumerable own
5427
- // properties, erasing accessors.
5428
- // The snapshot is frozen to ensure that the properties are immutable
5429
- // when transferred-by-property-descriptor onto local scope objects.
5430
- const globalLexicals= freeze({ ...globalLexicalsOption});
5431
-
5432
5530
  const globalObject= {};
5433
5531
 
5532
+ setGlobalObjectSymbolUnscopables(globalObject);
5533
+
5434
5534
  // We must initialize all constant properties first because
5435
5535
  // `makeSafeEvaluator` may use them to create optimized bindings
5436
5536
  // in the evaluator.
@@ -5438,13 +5538,10 @@ const makeCompartmentConstructor= (
5438
5538
  // evaluator is no longer eagerly created
5439
5539
  setGlobalObjectConstantProperties(globalObject);
5440
5540
 
5441
- const knownScopeProxies= new WeakSet();
5442
5541
  const { safeEvaluate}= makeSafeEvaluator({
5443
5542
  globalObject,
5444
- globalLexicals,
5445
5543
  globalTransforms,
5446
- sloppyGlobalsMode: false,
5447
- knownScopeProxies});
5544
+ sloppyGlobalsMode: false});
5448
5545
 
5449
5546
 
5450
5547
  setGlobalObjectMutableProperties(globalObject, {
@@ -5467,8 +5564,6 @@ const makeCompartmentConstructor= (
5467
5564
  name: `${name}`,
5468
5565
  globalTransforms,
5469
5566
  globalObject,
5470
- knownScopeProxies,
5471
- globalLexicals,
5472
5567
  safeEvaluate,
5473
5568
  resolveHook,
5474
5569
  importHook,
@@ -5488,7 +5583,7 @@ const makeCompartmentConstructor= (
5488
5583
  };$h‍_once.makeCompartmentConstructor(makeCompartmentConstructor);
5489
5584
  })
5490
5585
  ,
5491
- // === functors[21] ===
5586
+ // === functors[23] ===
5492
5587
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let TypeError,WeakSet,arrayFilter,defineProperty,entries,freeze,getOwnPropertyDescriptor,getOwnPropertyDescriptors,globalThis,is,isObject,objectHasOwnProperty,values,weaksetHas,constantProperties,sharedGlobalPropertyNames,universalPropertyNames,whitelist;$h‍_imports([["./commons.js", [["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["WeakSet", [$h‍_a => (WeakSet = $h‍_a)]],["arrayFilter", [$h‍_a => (arrayFilter = $h‍_a)]],["defineProperty", [$h‍_a => (defineProperty = $h‍_a)]],["entries", [$h‍_a => (entries = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["getOwnPropertyDescriptor", [$h‍_a => (getOwnPropertyDescriptor = $h‍_a)]],["getOwnPropertyDescriptors", [$h‍_a => (getOwnPropertyDescriptors = $h‍_a)]],["globalThis", [$h‍_a => (globalThis = $h‍_a)]],["is", [$h‍_a => (is = $h‍_a)]],["isObject", [$h‍_a => (isObject = $h‍_a)]],["objectHasOwnProperty", [$h‍_a => (objectHasOwnProperty = $h‍_a)]],["values", [$h‍_a => (values = $h‍_a)]],["weaksetHas", [$h‍_a => (weaksetHas = $h‍_a)]]]],["./whitelist.js", [["constantProperties", [$h‍_a => (constantProperties = $h‍_a)]],["sharedGlobalPropertyNames", [$h‍_a => (sharedGlobalPropertyNames = $h‍_a)]],["universalPropertyNames", [$h‍_a => (universalPropertyNames = $h‍_a)]],["whitelist", [$h‍_a => (whitelist = $h‍_a)]]]]]);
5493
5588
 
5494
5589
 
@@ -5662,7 +5757,7 @@ const getGlobalIntrinsics= (globalObject)=>{
5662
5757
  };$h‍_once.getGlobalIntrinsics(getGlobalIntrinsics);
5663
5758
  })
5664
5759
  ,
5665
- // === functors[22] ===
5760
+ // === functors[24] ===
5666
5761
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { $h‍_imports([]); /**
5667
5762
  * @file Exports {@code enablements}, a recursively defined
5668
5763
  * JSON record defining the optimum set of intrinsics properties
@@ -5873,7 +5968,7 @@ const severeEnablements= {
5873
5968
  '%TypedArrayPrototype%': '*'};$h‍_once.severeEnablements(severeEnablements);
5874
5969
  })
5875
5970
  ,
5876
- // === functors[23] ===
5971
+ // === functors[25] ===
5877
5972
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let Set,String,TypeError,arrayForEach,defineProperty,getOwnPropertyDescriptor,getOwnPropertyDescriptors,getOwnPropertyNames,isObject,objectHasOwnProperty,ownKeys,setHas,minEnablements,moderateEnablements,severeEnablements;$h‍_imports([["./commons.js", [["Set", [$h‍_a => (Set = $h‍_a)]],["String", [$h‍_a => (String = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["arrayForEach", [$h‍_a => (arrayForEach = $h‍_a)]],["defineProperty", [$h‍_a => (defineProperty = $h‍_a)]],["getOwnPropertyDescriptor", [$h‍_a => (getOwnPropertyDescriptor = $h‍_a)]],["getOwnPropertyDescriptors", [$h‍_a => (getOwnPropertyDescriptors = $h‍_a)]],["getOwnPropertyNames", [$h‍_a => (getOwnPropertyNames = $h‍_a)]],["isObject", [$h‍_a => (isObject = $h‍_a)]],["objectHasOwnProperty", [$h‍_a => (objectHasOwnProperty = $h‍_a)]],["ownKeys", [$h‍_a => (ownKeys = $h‍_a)]],["setHas", [$h‍_a => (setHas = $h‍_a)]]]],["./enablements.js", [["minEnablements", [$h‍_a => (minEnablements = $h‍_a)]],["moderateEnablements", [$h‍_a => (moderateEnablements = $h‍_a)]],["severeEnablements", [$h‍_a => (severeEnablements = $h‍_a)]]]]]);
5878
5973
 
5879
5974
 
@@ -6080,7 +6175,7 @@ function enablePropertyOverrides(
6080
6175
  }$h‍_once.default( enablePropertyOverrides);
6081
6176
  })
6082
6177
  ,
6083
- // === functors[24] ===
6178
+ // === functors[26] ===
6084
6179
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let arrayPush,freeze,assert;$h‍_imports([["./commons.js", [["arrayPush", [$h‍_a => (arrayPush = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]]]);
6085
6180
 
6086
6181
 
@@ -6088,7 +6183,7 @@ function enablePropertyOverrides(
6088
6183
 
6089
6184
 
6090
6185
 
6091
- const { details: X, quote: q}= assert;
6186
+ const { details: X, Fail, quote: q}= assert;
6092
6187
 
6093
6188
  /**
6094
6189
  * JavaScript module semantics resists attempts to parameterize a module's
@@ -6192,12 +6287,9 @@ const makeEnvironmentCaptor= (aGlobal)=>{
6192
6287
  }
6193
6288
  setting=== undefined||
6194
6289
  typeof setting=== 'string'||
6195
- // eslint-disable-next-line @endo/no-polymorphic-call
6196
- assert.fail(
6197
- X `Environment option value ${q(
6198
- setting)
6199
- }, if present, must be a string.`);
6200
-
6290
+ Fail `Environment option value ${q(
6291
+ setting)
6292
+ }, if present, must be a string.`;
6201
6293
  return setting;
6202
6294
  };
6203
6295
  freeze(getEnvironmentOption);
@@ -6212,7 +6304,7 @@ const makeEnvironmentCaptor= (aGlobal)=>{
6212
6304
  freeze(makeEnvironmentCaptor);
6213
6305
  })
6214
6306
  ,
6215
- // === functors[25] ===
6307
+ // === functors[27] ===
6216
6308
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let WeakSet,arrayFilter,arrayMap,arrayPush,defineProperty,freeze,fromEntries,isError,stringEndsWith,weaksetAdd,weaksetHas;$h‍_imports([["../commons.js", [["WeakSet", [$h‍_a => (WeakSet = $h‍_a)]],["arrayFilter", [$h‍_a => (arrayFilter = $h‍_a)]],["arrayMap", [$h‍_a => (arrayMap = $h‍_a)]],["arrayPush", [$h‍_a => (arrayPush = $h‍_a)]],["defineProperty", [$h‍_a => (defineProperty = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["fromEntries", [$h‍_a => (fromEntries = $h‍_a)]],["isError", [$h‍_a => (isError = $h‍_a)]],["stringEndsWith", [$h‍_a => (stringEndsWith = $h‍_a)]],["weaksetAdd", [$h‍_a => (weaksetAdd = $h‍_a)]],["weaksetHas", [$h‍_a => (weaksetHas = $h‍_a)]]]],["./types.js", []],["./internal-types.js", []]]);
6217
6309
 
6218
6310
 
@@ -6598,7 +6690,7 @@ const filterConsole= (baseConsole, filter, _topic= undefined)=> {
6598
6690
  freeze(filterConsole);
6599
6691
  })
6600
6692
  ,
6601
- // === functors[26] ===
6693
+ // === functors[28] ===
6602
6694
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FinalizationRegistry,Map,mapGet,mapDelete,WeakMap,mapSet,finalizationRegistryRegister,weakmapSet,weakmapGet,mapEntries,mapHas;$h‍_imports([["../commons.js", [["FinalizationRegistry", [$h‍_a => (FinalizationRegistry = $h‍_a)]],["Map", [$h‍_a => (Map = $h‍_a)]],["mapGet", [$h‍_a => (mapGet = $h‍_a)]],["mapDelete", [$h‍_a => (mapDelete = $h‍_a)]],["WeakMap", [$h‍_a => (WeakMap = $h‍_a)]],["mapSet", [$h‍_a => (mapSet = $h‍_a)]],["finalizationRegistryRegister", [$h‍_a => (finalizationRegistryRegister = $h‍_a)]],["weakmapSet", [$h‍_a => (weakmapSet = $h‍_a)]],["weakmapGet", [$h‍_a => (weakmapGet = $h‍_a)]],["mapEntries", [$h‍_a => (mapEntries = $h‍_a)]],["mapHas", [$h‍_a => (mapHas = $h‍_a)]]]]]);
6603
6695
 
6604
6696
 
@@ -6723,7 +6815,7 @@ const makeRejectionHandlers= (reportReason)=>{
6723
6815
  };$h‍_once.makeRejectionHandlers(makeRejectionHandlers);
6724
6816
  })
6725
6817
  ,
6726
- // === functors[27] ===
6818
+ // === functors[29] ===
6727
6819
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let TypeError,globalThis,defaultHandler,makeCausalConsole,makeRejectionHandlers;$h‍_imports([["../commons.js", [["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["globalThis", [$h‍_a => (globalThis = $h‍_a)]]]],["./assert.js", [["loggedErrorHandler", [$h‍_a => (defaultHandler = $h‍_a)]]]],["./console.js", [["makeCausalConsole", [$h‍_a => (makeCausalConsole = $h‍_a)]]]],["./unhandled-rejection.js", [["makeRejectionHandlers", [$h‍_a => (makeRejectionHandlers = $h‍_a)]]]],["./types.js", []],["./internal-types.js", []]]);
6728
6820
 
6729
6821
 
@@ -6866,7 +6958,7 @@ const tameConsole= (
6866
6958
  };$h‍_once.tameConsole(tameConsole);
6867
6959
  })
6868
6960
  ,
6869
- // === functors[28] ===
6961
+ // === functors[30] ===
6870
6962
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let WeakMap,WeakSet,apply,arrayFilter,arrayJoin,arrayMap,arraySlice,create,defineProperties,fromEntries,reflectSet,regexpExec,regexpTest,weakmapGet,weakmapSet,weaksetAdd,weaksetHas;$h‍_imports([["../commons.js", [["WeakMap", [$h‍_a => (WeakMap = $h‍_a)]],["WeakSet", [$h‍_a => (WeakSet = $h‍_a)]],["apply", [$h‍_a => (apply = $h‍_a)]],["arrayFilter", [$h‍_a => (arrayFilter = $h‍_a)]],["arrayJoin", [$h‍_a => (arrayJoin = $h‍_a)]],["arrayMap", [$h‍_a => (arrayMap = $h‍_a)]],["arraySlice", [$h‍_a => (arraySlice = $h‍_a)]],["create", [$h‍_a => (create = $h‍_a)]],["defineProperties", [$h‍_a => (defineProperties = $h‍_a)]],["fromEntries", [$h‍_a => (fromEntries = $h‍_a)]],["reflectSet", [$h‍_a => (reflectSet = $h‍_a)]],["regexpExec", [$h‍_a => (regexpExec = $h‍_a)]],["regexpTest", [$h‍_a => (regexpTest = $h‍_a)]],["weakmapGet", [$h‍_a => (weakmapGet = $h‍_a)]],["weakmapSet", [$h‍_a => (weakmapSet = $h‍_a)]],["weaksetAdd", [$h‍_a => (weaksetAdd = $h‍_a)]],["weaksetHas", [$h‍_a => (weaksetHas = $h‍_a)]]]]]);
6871
6963
 
6872
6964
 
@@ -7206,7 +7298,7 @@ const tameV8ErrorConstructor= (
7206
7298
  };$h‍_once.tameV8ErrorConstructor(tameV8ErrorConstructor);
7207
7299
  })
7208
7300
  ,
7209
- // === functors[29] ===
7301
+ // === functors[31] ===
7210
7302
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_ERROR,TypeError,apply,construct,defineProperties,setPrototypeOf,getOwnPropertyDescriptor,defineProperty,NativeErrors,tameV8ErrorConstructor;$h‍_imports([["../commons.js", [["FERAL_ERROR", [$h‍_a => (FERAL_ERROR = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["apply", [$h‍_a => (apply = $h‍_a)]],["construct", [$h‍_a => (construct = $h‍_a)]],["defineProperties", [$h‍_a => (defineProperties = $h‍_a)]],["setPrototypeOf", [$h‍_a => (setPrototypeOf = $h‍_a)]],["getOwnPropertyDescriptor", [$h‍_a => (getOwnPropertyDescriptor = $h‍_a)]],["defineProperty", [$h‍_a => (defineProperty = $h‍_a)]]]],["../whitelist.js", [["NativeErrors", [$h‍_a => (NativeErrors = $h‍_a)]]]],["./tame-v8-error-constructor.js", [["tameV8ErrorConstructor", [$h‍_a => (tameV8ErrorConstructor = $h‍_a)]]]]]);
7211
7303
 
7212
7304
 
@@ -7460,7 +7552,7 @@ function tameErrorConstructor(
7460
7552
  }$h‍_once.default( tameErrorConstructor);
7461
7553
  })
7462
7554
  ,
7463
- // === functors[30] ===
7555
+ // === functors[32] ===
7464
7556
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_FUNCTION,Float32Array,Map,Set,String,getOwnPropertyDescriptor,getPrototypeOf,iterateArray,iterateMap,iterateSet,iterateString,matchAllRegExp,matchAllSymbol,regexpPrototype,InertCompartment;$h‍_imports([["./commons.js", [["FERAL_FUNCTION", [$h‍_a => (FERAL_FUNCTION = $h‍_a)]],["Float32Array", [$h‍_a => (Float32Array = $h‍_a)]],["Map", [$h‍_a => (Map = $h‍_a)]],["Set", [$h‍_a => (Set = $h‍_a)]],["String", [$h‍_a => (String = $h‍_a)]],["getOwnPropertyDescriptor", [$h‍_a => (getOwnPropertyDescriptor = $h‍_a)]],["getPrototypeOf", [$h‍_a => (getPrototypeOf = $h‍_a)]],["iterateArray", [$h‍_a => (iterateArray = $h‍_a)]],["iterateMap", [$h‍_a => (iterateMap = $h‍_a)]],["iterateSet", [$h‍_a => (iterateSet = $h‍_a)]],["iterateString", [$h‍_a => (iterateString = $h‍_a)]],["matchAllRegExp", [$h‍_a => (matchAllRegExp = $h‍_a)]],["matchAllSymbol", [$h‍_a => (matchAllSymbol = $h‍_a)]],["regexpPrototype", [$h‍_a => (regexpPrototype = $h‍_a)]]]],["./compartment-shim.js", [["InertCompartment", [$h‍_a => (InertCompartment = $h‍_a)]]]]]);
7465
7557
 
7466
7558
 
@@ -7601,7 +7693,7 @@ const getAnonymousIntrinsics= ()=> {
7601
7693
  };$h‍_once.getAnonymousIntrinsics(getAnonymousIntrinsics);
7602
7694
  })
7603
7695
  ,
7604
- // === functors[31] ===
7696
+ // === functors[33] ===
7605
7697
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let Set,String,TypeError,WeakMap,WeakSet,apply,arrayForEach,defineProperty,freeze,getOwnPropertyDescriptor,getOwnPropertyDescriptors,getPrototypeOf,isInteger,isObject,objectHasOwnProperty,ownKeys,preventExtensions,setAdd,setForEach,setHas,toStringTagSymbol,typedArrayPrototype,weakmapGet,weakmapSet,weaksetAdd,weaksetHas,assert;$h‍_imports([["./commons.js", [["Set", [$h‍_a => (Set = $h‍_a)]],["String", [$h‍_a => (String = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["WeakMap", [$h‍_a => (WeakMap = $h‍_a)]],["WeakSet", [$h‍_a => (WeakSet = $h‍_a)]],["apply", [$h‍_a => (apply = $h‍_a)]],["arrayForEach", [$h‍_a => (arrayForEach = $h‍_a)]],["defineProperty", [$h‍_a => (defineProperty = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["getOwnPropertyDescriptor", [$h‍_a => (getOwnPropertyDescriptor = $h‍_a)]],["getOwnPropertyDescriptors", [$h‍_a => (getOwnPropertyDescriptors = $h‍_a)]],["getPrototypeOf", [$h‍_a => (getPrototypeOf = $h‍_a)]],["isInteger", [$h‍_a => (isInteger = $h‍_a)]],["isObject", [$h‍_a => (isObject = $h‍_a)]],["objectHasOwnProperty", [$h‍_a => (objectHasOwnProperty = $h‍_a)]],["ownKeys", [$h‍_a => (ownKeys = $h‍_a)]],["preventExtensions", [$h‍_a => (preventExtensions = $h‍_a)]],["setAdd", [$h‍_a => (setAdd = $h‍_a)]],["setForEach", [$h‍_a => (setForEach = $h‍_a)]],["setHas", [$h‍_a => (setHas = $h‍_a)]],["toStringTagSymbol", [$h‍_a => (toStringTagSymbol = $h‍_a)]],["typedArrayPrototype", [$h‍_a => (typedArrayPrototype = $h‍_a)]],["weakmapGet", [$h‍_a => (weakmapGet = $h‍_a)]],["weakmapSet", [$h‍_a => (weakmapSet = $h‍_a)]],["weaksetAdd", [$h‍_a => (weaksetAdd = $h‍_a)]],["weaksetHas", [$h‍_a => (weaksetHas = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]]]);
7606
7698
 
7607
7699
 
@@ -7844,7 +7936,7 @@ const makeHardener= ()=> {
7844
7936
  };$h‍_once.makeHardener(makeHardener);
7845
7937
  })
7846
7938
  ,
7847
- // === functors[32] ===
7939
+ // === functors[34] ===
7848
7940
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let Date,TypeError,apply,construct,defineProperties;$h‍_imports([["./commons.js", [["Date", [$h‍_a => (Date = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["apply", [$h‍_a => (apply = $h‍_a)]],["construct", [$h‍_a => (construct = $h‍_a)]],["defineProperties", [$h‍_a => (defineProperties = $h‍_a)]]]]]);
7849
7941
 
7850
7942
 
@@ -7961,7 +8053,7 @@ function tameDateConstructor(dateTaming= 'safe') {
7961
8053
  }$h‍_once.default( tameDateConstructor);
7962
8054
  })
7963
8055
  ,
7964
- // === functors[33] ===
8056
+ // === functors[35] ===
7965
8057
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let TypeError,globalThis,getOwnPropertyDescriptor,defineProperty;$h‍_imports([["./commons.js", [["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["globalThis", [$h‍_a => (globalThis = $h‍_a)]],["getOwnPropertyDescriptor", [$h‍_a => (getOwnPropertyDescriptor = $h‍_a)]],["defineProperty", [$h‍_a => (defineProperty = $h‍_a)]]]]]);Object.defineProperty(tameDomains, 'name', {value: "tameDomains"});$h‍_once.tameDomains(tameDomains);
7966
8058
 
7967
8059
 
@@ -8010,7 +8102,7 @@ function tameDomains(domainTaming= 'safe') {
8010
8102
  }
8011
8103
  })
8012
8104
  ,
8013
- // === functors[34] ===
8105
+ // === functors[36] ===
8014
8106
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_FUNCTION,SyntaxError,TypeError,defineProperties,getPrototypeOf,setPrototypeOf;$h‍_imports([["./commons.js", [["FERAL_FUNCTION", [$h‍_a => (FERAL_FUNCTION = $h‍_a)]],["SyntaxError", [$h‍_a => (SyntaxError = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["defineProperties", [$h‍_a => (defineProperties = $h‍_a)]],["getPrototypeOf", [$h‍_a => (getPrototypeOf = $h‍_a)]],["setPrototypeOf", [$h‍_a => (setPrototypeOf = $h‍_a)]]]]]);
8015
8107
 
8016
8108
 
@@ -8148,7 +8240,7 @@ function tameFunctionConstructors() {
8148
8240
  }$h‍_once.default( tameFunctionConstructors);
8149
8241
  })
8150
8242
  ,
8151
- // === functors[35] ===
8243
+ // === functors[37] ===
8152
8244
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let WeakSet,defineProperty,freeze,functionPrototype,functionToString,stringEndsWith,weaksetAdd,weaksetHas;$h‍_imports([["./commons.js", [["WeakSet", [$h‍_a => (WeakSet = $h‍_a)]],["defineProperty", [$h‍_a => (defineProperty = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["functionPrototype", [$h‍_a => (functionPrototype = $h‍_a)]],["functionToString", [$h‍_a => (functionToString = $h‍_a)]],["stringEndsWith", [$h‍_a => (stringEndsWith = $h‍_a)]],["weaksetAdd", [$h‍_a => (weaksetAdd = $h‍_a)]],["weaksetHas", [$h‍_a => (weaksetHas = $h‍_a)]]]]]);
8153
8245
 
8154
8246
 
@@ -8201,7 +8293,7 @@ const tameFunctionToString= ()=> {
8201
8293
  };$h‍_once.tameFunctionToString(tameFunctionToString);
8202
8294
  })
8203
8295
  ,
8204
- // === functors[36] ===
8296
+ // === functors[38] ===
8205
8297
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let Number,String,TypeError,defineProperty,getOwnPropertyNames,isObject,regexpExec,assert;$h‍_imports([["./commons.js", [["Number", [$h‍_a => (Number = $h‍_a)]],["String", [$h‍_a => (String = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["defineProperty", [$h‍_a => (defineProperty = $h‍_a)]],["getOwnPropertyNames", [$h‍_a => (getOwnPropertyNames = $h‍_a)]],["isObject", [$h‍_a => (isObject = $h‍_a)]],["regexpExec", [$h‍_a => (regexpExec = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]]]);
8206
8298
 
8207
8299
 
@@ -8213,7 +8305,7 @@ const tameFunctionToString= ()=> {
8213
8305
 
8214
8306
 
8215
8307
 
8216
- const { details: d, quote: q}= assert;
8308
+ const { Fail, quote: q}= assert;
8217
8309
 
8218
8310
  const localePattern= /^(\w*[a-z])Locale([A-Z]\w*)$/;
8219
8311
 
@@ -8235,7 +8327,7 @@ const tamedMethods= {
8235
8327
  if( s> that) {
8236
8328
  return 1;
8237
8329
  }
8238
- assert(s=== that, d `expected ${q(s)} and ${q(that)} to compare`);
8330
+ s=== that|| Fail `expected ${q(s)} and ${q(that)} to compare`;
8239
8331
  return 0;
8240
8332
  },
8241
8333
 
@@ -8265,16 +8357,12 @@ function tameLocaleMethods(intrinsics, localeTaming= 'safe') {
8265
8357
  for( const methodName of getOwnPropertyNames(intrinsic)) {
8266
8358
  const match= regexpExec(localePattern, methodName);
8267
8359
  if( match) {
8268
- assert(
8269
- typeof intrinsic[methodName]=== 'function',
8270
- d `expected ${q(methodName)} to be a function`);
8271
-
8360
+ typeof intrinsic[methodName]=== 'function'||
8361
+ Fail `expected ${q(methodName)} to be a function`;
8272
8362
  const nonLocaleMethodName= `${match[1]}${match[2]}`;
8273
8363
  const method= intrinsic[nonLocaleMethodName];
8274
- assert(
8275
- typeof method=== 'function',
8276
- d `function ${q(nonLocaleMethodName)} not found`);
8277
-
8364
+ typeof method=== 'function'||
8365
+ Fail `function ${q(nonLocaleMethodName)} not found`;
8278
8366
  defineProperty(intrinsic, methodName, { value: method});
8279
8367
  }
8280
8368
  }
@@ -8289,7 +8377,7 @@ function tameLocaleMethods(intrinsics, localeTaming= 'safe') {
8289
8377
  }$h‍_once.default( tameLocaleMethods);
8290
8378
  })
8291
8379
  ,
8292
- // === functors[37] ===
8380
+ // === functors[39] ===
8293
8381
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let Math,TypeError,create,getOwnPropertyDescriptors,objectPrototype;$h‍_imports([["./commons.js", [["Math", [$h‍_a => (Math = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["create", [$h‍_a => (create = $h‍_a)]],["getOwnPropertyDescriptors", [$h‍_a => (getOwnPropertyDescriptors = $h‍_a)]],["objectPrototype", [$h‍_a => (objectPrototype = $h‍_a)]]]]]);
8294
8382
 
8295
8383
 
@@ -8318,7 +8406,7 @@ function tameMathObject(mathTaming= 'safe') {
8318
8406
  }$h‍_once.default( tameMathObject);
8319
8407
  })
8320
8408
  ,
8321
- // === functors[38] ===
8409
+ // === functors[40] ===
8322
8410
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_REG_EXP,TypeError,construct,defineProperties,getOwnPropertyDescriptor,speciesSymbol;$h‍_imports([["./commons.js", [["FERAL_REG_EXP", [$h‍_a => (FERAL_REG_EXP = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["construct", [$h‍_a => (construct = $h‍_a)]],["defineProperties", [$h‍_a => (defineProperties = $h‍_a)]],["getOwnPropertyDescriptor", [$h‍_a => (getOwnPropertyDescriptor = $h‍_a)]],["speciesSymbol", [$h‍_a => (speciesSymbol = $h‍_a)]]]]]);
8323
8411
 
8324
8412
 
@@ -8373,7 +8461,7 @@ function tameRegExpConstructor(regExpTaming= 'safe') {
8373
8461
  }$h‍_once.default( tameRegExpConstructor);
8374
8462
  })
8375
8463
  ,
8376
- // === functors[39] ===
8464
+ // === functors[41] ===
8377
8465
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let whitelist,FunctionInstance,isAccessorPermit,Map,String,TypeError,arrayFilter,arrayIncludes,arrayMap,entries,getOwnPropertyDescriptor,getPrototypeOf,isObject,mapGet,objectHasOwnProperty,ownKeys,symbolKeyFor;$h‍_imports([["./whitelist.js", [["whitelist", [$h‍_a => (whitelist = $h‍_a)]],["FunctionInstance", [$h‍_a => (FunctionInstance = $h‍_a)]],["isAccessorPermit", [$h‍_a => (isAccessorPermit = $h‍_a)]]]],["./commons.js", [["Map", [$h‍_a => (Map = $h‍_a)]],["String", [$h‍_a => (String = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["arrayFilter", [$h‍_a => (arrayFilter = $h‍_a)]],["arrayIncludes", [$h‍_a => (arrayIncludes = $h‍_a)]],["arrayMap", [$h‍_a => (arrayMap = $h‍_a)]],["entries", [$h‍_a => (entries = $h‍_a)]],["getOwnPropertyDescriptor", [$h‍_a => (getOwnPropertyDescriptor = $h‍_a)]],["getPrototypeOf", [$h‍_a => (getPrototypeOf = $h‍_a)]],["isObject", [$h‍_a => (isObject = $h‍_a)]],["mapGet", [$h‍_a => (mapGet = $h‍_a)]],["objectHasOwnProperty", [$h‍_a => (objectHasOwnProperty = $h‍_a)]],["ownKeys", [$h‍_a => (ownKeys = $h‍_a)]],["symbolKeyFor", [$h‍_a => (symbolKeyFor = $h‍_a)]]]]]);
8378
8466
 
8379
8467
 
@@ -8688,7 +8776,7 @@ function whitelistIntrinsics(
8688
8776
  }$h‍_once.default( whitelistIntrinsics);
8689
8777
  })
8690
8778
  ,
8691
- // === functors[40] ===
8779
+ // === functors[42] ===
8692
8780
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_FUNCTION,FERAL_EVAL,TypeError,arrayFilter,arrayMap,globalThis,is,ownKeys,stringSplit,noEvalEvaluate,enJoin,makeHardener,makeIntrinsicsCollector,whitelistIntrinsics,tameFunctionConstructors,tameDateConstructor,tameMathObject,tameRegExpConstructor,enablePropertyOverrides,tameLocaleMethods,setGlobalObjectConstantProperties,setGlobalObjectMutableProperties,setGlobalObjectEvaluators,makeSafeEvaluator,initialGlobalPropertyNames,tameFunctionToString,tameDomains,tameConsole,tameErrorConstructor,assert,makeAssert,makeEnvironmentCaptor,getAnonymousIntrinsics,makeCompartmentConstructor;$h‍_imports([["./commons.js", [["FERAL_FUNCTION", [$h‍_a => (FERAL_FUNCTION = $h‍_a)]],["FERAL_EVAL", [$h‍_a => (FERAL_EVAL = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["arrayFilter", [$h‍_a => (arrayFilter = $h‍_a)]],["arrayMap", [$h‍_a => (arrayMap = $h‍_a)]],["globalThis", [$h‍_a => (globalThis = $h‍_a)]],["is", [$h‍_a => (is = $h‍_a)]],["ownKeys", [$h‍_a => (ownKeys = $h‍_a)]],["stringSplit", [$h‍_a => (stringSplit = $h‍_a)]],["noEvalEvaluate", [$h‍_a => (noEvalEvaluate = $h‍_a)]]]],["./error/stringify-utils.js", [["enJoin", [$h‍_a => (enJoin = $h‍_a)]]]],["./make-hardener.js", [["makeHardener", [$h‍_a => (makeHardener = $h‍_a)]]]],["./intrinsics.js", [["makeIntrinsicsCollector", [$h‍_a => (makeIntrinsicsCollector = $h‍_a)]]]],["./whitelist-intrinsics.js", [["default", [$h‍_a => (whitelistIntrinsics = $h‍_a)]]]],["./tame-function-constructors.js", [["default", [$h‍_a => (tameFunctionConstructors = $h‍_a)]]]],["./tame-date-constructor.js", [["default", [$h‍_a => (tameDateConstructor = $h‍_a)]]]],["./tame-math-object.js", [["default", [$h‍_a => (tameMathObject = $h‍_a)]]]],["./tame-regexp-constructor.js", [["default", [$h‍_a => (tameRegExpConstructor = $h‍_a)]]]],["./enable-property-overrides.js", [["default", [$h‍_a => (enablePropertyOverrides = $h‍_a)]]]],["./tame-locale-methods.js", [["default", [$h‍_a => (tameLocaleMethods = $h‍_a)]]]],["./global-object.js", [["setGlobalObjectConstantProperties", [$h‍_a => (setGlobalObjectConstantProperties = $h‍_a)]],["setGlobalObjectMutableProperties", [$h‍_a => (setGlobalObjectMutableProperties = $h‍_a)]],["setGlobalObjectEvaluators", [$h‍_a => (setGlobalObjectEvaluators = $h‍_a)]]]],["./make-safe-evaluator.js", [["makeSafeEvaluator", [$h‍_a => (makeSafeEvaluator = $h‍_a)]]]],["./whitelist.js", [["initialGlobalPropertyNames", [$h‍_a => (initialGlobalPropertyNames = $h‍_a)]]]],["./tame-function-tostring.js", [["tameFunctionToString", [$h‍_a => (tameFunctionToString = $h‍_a)]]]],["./tame-domains.js", [["tameDomains", [$h‍_a => (tameDomains = $h‍_a)]]]],["./error/tame-console.js", [["tameConsole", [$h‍_a => (tameConsole = $h‍_a)]]]],["./error/tame-error-constructor.js", [["default", [$h‍_a => (tameErrorConstructor = $h‍_a)]]]],["./error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]],["makeAssert", [$h‍_a => (makeAssert = $h‍_a)]]]],["./environment-options.js", [["makeEnvironmentCaptor", [$h‍_a => (makeEnvironmentCaptor = $h‍_a)]]]],["./get-anonymous-intrinsics.js", [["getAnonymousIntrinsics", [$h‍_a => (getAnonymousIntrinsics = $h‍_a)]]]],["./compartment-shim.js", [["makeCompartmentConstructor", [$h‍_a => (makeCompartmentConstructor = $h‍_a)]]]]]);
8693
8781
 
8694
8782
 
@@ -8746,7 +8834,7 @@ function whitelistIntrinsics(
8746
8834
 
8747
8835
  /** @typedef {import('../index.js').LockdownOptions} LockdownOptions */
8748
8836
 
8749
- const { details: d, quote: q}= assert;
8837
+ const { Fail, details: d, quote: q}= assert;
8750
8838
 
8751
8839
  /** @type {Error=} */
8752
8840
  let priorLockdown;
@@ -8773,7 +8861,6 @@ const harden= makeHardener();
8773
8861
  * @param {Object} [options]
8774
8862
  * @param {Array<Transform>} [options.transforms]
8775
8863
  * @param {Array<Transform>} [options.__shimTransforms__]
8776
- * @param {Object} [options.globalLexicals]
8777
8864
  */
8778
8865
 
8779
8866
  // TODO https://github.com/endojs/endo/issues/814
@@ -8883,25 +8970,22 @@ const repairIntrinsics= (options= {})=> {
8883
8970
 
8884
8971
  }
8885
8972
 
8886
- assert(
8887
- evalTaming=== 'unsafeEval'||
8888
- evalTaming=== 'safeEval'||
8889
- evalTaming=== 'noEval',
8890
- d `lockdown(): non supported option evalTaming: ${q(evalTaming)}`);
8891
-
8973
+ evalTaming=== 'unsafeEval'||
8974
+ evalTaming=== 'safeEval'||
8975
+ evalTaming=== 'noEval'||
8976
+ Fail `lockdown(): non supported option evalTaming: ${q(evalTaming)}`;
8892
8977
 
8893
8978
  // Assert that only supported options were passed.
8894
8979
  // Use Reflect.ownKeys to reject symbol-named properties as well.
8895
8980
  const extraOptionsNames= ownKeys(extraOptions);
8896
- assert(
8897
- extraOptionsNames.length=== 0,
8898
- d `lockdown(): non supported option ${q(extraOptionsNames)}`);
8981
+ extraOptionsNames.length=== 0||
8982
+ Fail `lockdown(): non supported option ${q(extraOptionsNames)}`;
8899
8983
 
8900
-
8901
- assert(
8902
- priorLockdown=== undefined,
8903
- `Already locked down at ${priorLockdown} (SES_ALREADY_LOCKED_DOWN)`,
8904
- TypeError);
8984
+ priorLockdown=== undefined||
8985
+ // eslint-disable-next-line @endo/no-polymorphic-call
8986
+ assert.fail(
8987
+ d `Already locked down at ${priorLockdown} (SES_ALREADY_LOCKED_DOWN)`,
8988
+ TypeError);
8905
8989
 
8906
8990
  priorLockdown= new TypeError('Prior lockdown (SES_ALREADY_LOCKED_DOWN)');
8907
8991
  // Tease V8 to generate the stack string and release the closures the stack
@@ -8944,7 +9028,6 @@ const repairIntrinsics= (options= {})=> {
8944
9028
  };
8945
9029
 
8946
9030
  if( seemsToBeLockedDown()) {
8947
- // eslint-disable-next-line @endo/no-polymorphic-call
8948
9031
  throw new TypeError(
8949
9032
  `Already locked down but not by this SES instance (SES_MULTIPLE_INSTANCES)`);
8950
9033
 
@@ -9103,7 +9186,7 @@ const lockdown= (options= {})=> {
9103
9186
  };$h‍_once.lockdown(lockdown);
9104
9187
  })
9105
9188
  ,
9106
- // === functors[41] ===
9189
+ // === functors[43] ===
9107
9190
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let globalThis,TypeError,assign,tameFunctionToString,getGlobalIntrinsics,lockdown,makeCompartmentConstructor,assert;$h‍_imports([["./src/commons.js", [["globalThis", [$h‍_a => (globalThis = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["assign", [$h‍_a => (assign = $h‍_a)]]]],["./src/tame-function-tostring.js", [["tameFunctionToString", [$h‍_a => (tameFunctionToString = $h‍_a)]]]],["./src/intrinsics.js", [["getGlobalIntrinsics", [$h‍_a => (getGlobalIntrinsics = $h‍_a)]]]],["./src/lockdown-shim.js", [["lockdown", [$h‍_a => (lockdown = $h‍_a)]]]],["./src/compartment-shim.js", [["makeCompartmentConstructor", [$h‍_a => (makeCompartmentConstructor = $h‍_a)]]]],["./src/error/assert.js", [["assert", [$h‍_a => (assert = $h‍_a)]]]]]);
9108
9191
 
9109
9192
 
@@ -9216,6 +9299,7 @@ assign(globalThis, {
9216
9299
  toStringTagSymbol: cell("toStringTagSymbol"),
9217
9300
  iteratorSymbol: cell("iteratorSymbol"),
9218
9301
  matchAllSymbol: cell("matchAllSymbol"),
9302
+ unscopablesSymbol: cell("unscopablesSymbol"),
9219
9303
  symbolKeyFor: cell("symbolKeyFor"),
9220
9304
  symbolFor: cell("symbolFor"),
9221
9305
  isInteger: cell("isInteger"),
@@ -9316,14 +9400,22 @@ assign(globalThis, {
9316
9400
  assert: cell("assert"),
9317
9401
  },
9318
9402
  {
9319
- makeEvaluateFactory: cell("makeEvaluateFactory"),
9403
+ makeEvalScopeKit: cell("makeEvalScopeKit"),
9320
9404
  },
9321
9405
  {
9322
9406
  isValidIdentifierName: cell("isValidIdentifierName"),
9323
9407
  getScopeConstants: cell("getScopeConstants"),
9324
9408
  },
9325
9409
  {
9326
- createScopeHandler: cell("createScopeHandler"),
9410
+ makeEvaluate: cell("makeEvaluate"),
9411
+ },
9412
+ {
9413
+ alwaysThrowHandler: cell("alwaysThrowHandler"),
9414
+ strictScopeTerminatorHandler: cell("strictScopeTerminatorHandler"),
9415
+ strictScopeTerminator: cell("strictScopeTerminator"),
9416
+ },
9417
+ {
9418
+ createSloppyGlobalsScopeTerminator: cell("createSloppyGlobalsScopeTerminator"),
9327
9419
  },
9328
9420
  {
9329
9421
  getSourceURL: cell("getSourceURL"),
@@ -9362,6 +9454,7 @@ assign(globalThis, {
9362
9454
  whitelist: cell("whitelist"),
9363
9455
  },
9364
9456
  {
9457
+ setGlobalObjectSymbolUnscopables: cell("setGlobalObjectSymbolUnscopables"),
9365
9458
  setGlobalObjectConstantProperties: cell("setGlobalObjectConstantProperties"),
9366
9459
  setGlobalObjectMutableProperties: cell("setGlobalObjectMutableProperties"),
9367
9460
  setGlobalObjectEvaluators: cell("setGlobalObjectEvaluators"),
@@ -9532,6 +9625,7 @@ assign(globalThis, {
9532
9625
  toStringTagSymbol: cells[0].toStringTagSymbol.set,
9533
9626
  iteratorSymbol: cells[0].iteratorSymbol.set,
9534
9627
  matchAllSymbol: cells[0].matchAllSymbol.set,
9628
+ unscopablesSymbol: cells[0].unscopablesSymbol.set,
9535
9629
  symbolKeyFor: cells[0].symbolKeyFor.set,
9536
9630
  symbolFor: cells[0].symbolFor.set,
9537
9631
  isInteger: cells[0].isInteger.set,
@@ -9674,11 +9768,12 @@ assign(globalThis, {
9674
9768
  imports(entries) {
9675
9769
  const map = new Map(entries);
9676
9770
  observeImports(map, "./commons.js", 0);
9771
+ observeImports(map, "./error/assert.js", 4);
9677
9772
  },
9678
9773
  liveVar: {
9679
9774
  },
9680
9775
  onceVar: {
9681
- makeEvaluateFactory: cells[5].makeEvaluateFactory.set,
9776
+ makeEvalScopeKit: cells[5].makeEvalScopeKit.set,
9682
9777
  },
9683
9778
  importMeta: {},
9684
9779
  });
@@ -9699,12 +9794,12 @@ assign(globalThis, {
9699
9794
  imports(entries) {
9700
9795
  const map = new Map(entries);
9701
9796
  observeImports(map, "./commons.js", 0);
9702
- observeImports(map, "./error/assert.js", 4);
9797
+ observeImports(map, "./scope-constants.js", 6);
9703
9798
  },
9704
9799
  liveVar: {
9705
9800
  },
9706
9801
  onceVar: {
9707
- createScopeHandler: cells[7].createScopeHandler.set,
9802
+ makeEvaluate: cells[7].makeEvaluate.set,
9708
9803
  },
9709
9804
  importMeta: {},
9710
9805
  });
@@ -9712,11 +9807,14 @@ assign(globalThis, {
9712
9807
  imports(entries) {
9713
9808
  const map = new Map(entries);
9714
9809
  observeImports(map, "./commons.js", 0);
9810
+ observeImports(map, "./error/assert.js", 4);
9715
9811
  },
9716
9812
  liveVar: {
9717
9813
  },
9718
9814
  onceVar: {
9719
- getSourceURL: cells[8].getSourceURL.set,
9815
+ alwaysThrowHandler: cells[8].alwaysThrowHandler.set,
9816
+ strictScopeTerminatorHandler: cells[8].strictScopeTerminatorHandler.set,
9817
+ strictScopeTerminator: cells[8].strictScopeTerminator.set,
9720
9818
  },
9721
9819
  importMeta: {},
9722
9820
  });
@@ -9724,18 +9822,12 @@ assign(globalThis, {
9724
9822
  imports(entries) {
9725
9823
  const map = new Map(entries);
9726
9824
  observeImports(map, "./commons.js", 0);
9727
- observeImports(map, "./get-source-url.js", 8);
9825
+ observeImports(map, "./strict-scope-terminator.js", 8);
9728
9826
  },
9729
9827
  liveVar: {
9730
9828
  },
9731
9829
  onceVar: {
9732
- rejectHtmlComments: cells[9].rejectHtmlComments.set,
9733
- evadeHtmlCommentTest: cells[9].evadeHtmlCommentTest.set,
9734
- rejectImportExpressions: cells[9].rejectImportExpressions.set,
9735
- evadeImportExpressionTest: cells[9].evadeImportExpressionTest.set,
9736
- rejectSomeDirectEvalExpressions: cells[9].rejectSomeDirectEvalExpressions.set,
9737
- mandatoryTransforms: cells[9].mandatoryTransforms.set,
9738
- applyTransforms: cells[9].applyTransforms.set,
9830
+ createSloppyGlobalsScopeTerminator: cells[9].createSloppyGlobalsScopeTerminator.set,
9739
9831
  },
9740
9832
  importMeta: {},
9741
9833
  });
@@ -9743,16 +9835,11 @@ assign(globalThis, {
9743
9835
  imports(entries) {
9744
9836
  const map = new Map(entries);
9745
9837
  observeImports(map, "./commons.js", 0);
9746
- observeImports(map, "./error/assert.js", 4);
9747
- observeImports(map, "./make-evaluate-factory.js", 5);
9748
- observeImports(map, "./scope-constants.js", 6);
9749
- observeImports(map, "./scope-handler.js", 7);
9750
- observeImports(map, "./transforms.js", 9);
9751
9838
  },
9752
9839
  liveVar: {
9753
9840
  },
9754
9841
  onceVar: {
9755
- makeSafeEvaluator: cells[10].makeSafeEvaluator.set,
9842
+ getSourceURL: cells[10].getSourceURL.set,
9756
9843
  },
9757
9844
  importMeta: {},
9758
9845
  });
@@ -9760,25 +9847,36 @@ assign(globalThis, {
9760
9847
  imports(entries) {
9761
9848
  const map = new Map(entries);
9762
9849
  observeImports(map, "./commons.js", 0);
9763
- observeImports(map, "./make-safe-evaluator.js", 10);
9764
- observeImports(map, "./transforms.js", 9);
9850
+ observeImports(map, "./get-source-url.js", 10);
9765
9851
  },
9766
9852
  liveVar: {
9767
9853
  },
9768
9854
  onceVar: {
9769
- provideCompartmentEvaluator: cells[11].provideCompartmentEvaluator.set,
9770
- compartmentEvaluate: cells[11].compartmentEvaluate.set,
9855
+ rejectHtmlComments: cells[11].rejectHtmlComments.set,
9856
+ evadeHtmlCommentTest: cells[11].evadeHtmlCommentTest.set,
9857
+ rejectImportExpressions: cells[11].rejectImportExpressions.set,
9858
+ evadeImportExpressionTest: cells[11].evadeImportExpressionTest.set,
9859
+ rejectSomeDirectEvalExpressions: cells[11].rejectSomeDirectEvalExpressions.set,
9860
+ mandatoryTransforms: cells[11].mandatoryTransforms.set,
9861
+ applyTransforms: cells[11].applyTransforms.set,
9771
9862
  },
9772
9863
  importMeta: {},
9773
9864
  });
9774
9865
  functors[12]({
9775
9866
  imports(entries) {
9776
9867
  const map = new Map(entries);
9868
+ observeImports(map, "./commons.js", 0);
9869
+ observeImports(map, "./error/assert.js", 4);
9870
+ observeImports(map, "./eval-scope.js", 5);
9871
+ observeImports(map, "./make-evaluate.js", 7);
9872
+ observeImports(map, "./sloppy-globals-scope-terminator.js", 9);
9873
+ observeImports(map, "./strict-scope-terminator.js", 8);
9874
+ observeImports(map, "./transforms.js", 11);
9777
9875
  },
9778
9876
  liveVar: {
9779
9877
  },
9780
9878
  onceVar: {
9781
- makeEvalFunction: cells[12].makeEvalFunction.set,
9879
+ makeSafeEvaluator: cells[12].makeSafeEvaluator.set,
9782
9880
  },
9783
9881
  importMeta: {},
9784
9882
  });
@@ -9786,12 +9884,14 @@ assign(globalThis, {
9786
9884
  imports(entries) {
9787
9885
  const map = new Map(entries);
9788
9886
  observeImports(map, "./commons.js", 0);
9789
- observeImports(map, "./error/assert.js", 4);
9887
+ observeImports(map, "./make-safe-evaluator.js", 12);
9888
+ observeImports(map, "./transforms.js", 11);
9790
9889
  },
9791
9890
  liveVar: {
9792
9891
  },
9793
9892
  onceVar: {
9794
- makeFunctionConstructor: cells[13].makeFunctionConstructor.set,
9893
+ provideCompartmentEvaluator: cells[13].provideCompartmentEvaluator.set,
9894
+ compartmentEvaluate: cells[13].compartmentEvaluate.set,
9795
9895
  },
9796
9896
  importMeta: {},
9797
9897
  });
@@ -9802,15 +9902,7 @@ assign(globalThis, {
9802
9902
  liveVar: {
9803
9903
  },
9804
9904
  onceVar: {
9805
- constantProperties: cells[14].constantProperties.set,
9806
- universalPropertyNames: cells[14].universalPropertyNames.set,
9807
- initialGlobalPropertyNames: cells[14].initialGlobalPropertyNames.set,
9808
- sharedGlobalPropertyNames: cells[14].sharedGlobalPropertyNames.set,
9809
- uniqueGlobalPropertyNames: cells[14].uniqueGlobalPropertyNames.set,
9810
- NativeErrors: cells[14].NativeErrors.set,
9811
- FunctionInstance: cells[14].FunctionInstance.set,
9812
- isAccessorPermit: cells[14].isAccessorPermit.set,
9813
- whitelist: cells[14].whitelist.set,
9905
+ makeEvalFunction: cells[14].makeEvalFunction.set,
9814
9906
  },
9815
9907
  importMeta: {},
9816
9908
  });
@@ -9818,30 +9910,31 @@ assign(globalThis, {
9818
9910
  imports(entries) {
9819
9911
  const map = new Map(entries);
9820
9912
  observeImports(map, "./commons.js", 0);
9821
- observeImports(map, "./make-eval-function.js", 12);
9822
- observeImports(map, "./make-function-constructor.js", 13);
9823
- observeImports(map, "./whitelist.js", 14);
9913
+ observeImports(map, "./error/assert.js", 4);
9824
9914
  },
9825
9915
  liveVar: {
9826
9916
  },
9827
9917
  onceVar: {
9828
- setGlobalObjectConstantProperties: cells[15].setGlobalObjectConstantProperties.set,
9829
- setGlobalObjectMutableProperties: cells[15].setGlobalObjectMutableProperties.set,
9830
- setGlobalObjectEvaluators: cells[15].setGlobalObjectEvaluators.set,
9918
+ makeFunctionConstructor: cells[15].makeFunctionConstructor.set,
9831
9919
  },
9832
9920
  importMeta: {},
9833
9921
  });
9834
9922
  functors[16]({
9835
9923
  imports(entries) {
9836
9924
  const map = new Map(entries);
9837
- observeImports(map, "./commons.js", 0);
9838
- observeImports(map, "./error/assert.js", 4);
9839
9925
  },
9840
9926
  liveVar: {
9841
9927
  },
9842
9928
  onceVar: {
9843
- makeAlias: cells[16].makeAlias.set,
9844
- load: cells[16].load.set,
9929
+ constantProperties: cells[16].constantProperties.set,
9930
+ universalPropertyNames: cells[16].universalPropertyNames.set,
9931
+ initialGlobalPropertyNames: cells[16].initialGlobalPropertyNames.set,
9932
+ sharedGlobalPropertyNames: cells[16].sharedGlobalPropertyNames.set,
9933
+ uniqueGlobalPropertyNames: cells[16].uniqueGlobalPropertyNames.set,
9934
+ NativeErrors: cells[16].NativeErrors.set,
9935
+ FunctionInstance: cells[16].FunctionInstance.set,
9936
+ isAccessorPermit: cells[16].isAccessorPermit.set,
9937
+ whitelist: cells[16].whitelist.set,
9845
9938
  },
9846
9939
  importMeta: {},
9847
9940
  });
@@ -9849,14 +9942,17 @@ assign(globalThis, {
9849
9942
  imports(entries) {
9850
9943
  const map = new Map(entries);
9851
9944
  observeImports(map, "./commons.js", 0);
9852
- observeImports(map, "./error/assert.js", 4);
9853
- observeImports(map, "./module-load.js", 16);
9945
+ observeImports(map, "./make-eval-function.js", 14);
9946
+ observeImports(map, "./make-function-constructor.js", 15);
9947
+ observeImports(map, "./whitelist.js", 16);
9854
9948
  },
9855
9949
  liveVar: {
9856
9950
  },
9857
9951
  onceVar: {
9858
- deferExports: cells[17].deferExports.set,
9859
- getDeferredExports: cells[17].getDeferredExports.set,
9952
+ setGlobalObjectSymbolUnscopables: cells[17].setGlobalObjectSymbolUnscopables.set,
9953
+ setGlobalObjectConstantProperties: cells[17].setGlobalObjectConstantProperties.set,
9954
+ setGlobalObjectMutableProperties: cells[17].setGlobalObjectMutableProperties.set,
9955
+ setGlobalObjectEvaluators: cells[17].setGlobalObjectEvaluators.set,
9860
9956
  },
9861
9957
  importMeta: {},
9862
9958
  });
@@ -9864,15 +9960,13 @@ assign(globalThis, {
9864
9960
  imports(entries) {
9865
9961
  const map = new Map(entries);
9866
9962
  observeImports(map, "./commons.js", 0);
9867
- observeImports(map, "./compartment-evaluate.js", 11);
9868
9963
  observeImports(map, "./error/assert.js", 4);
9869
- observeImports(map, "./module-proxy.js", 17);
9870
9964
  },
9871
9965
  liveVar: {
9872
9966
  },
9873
9967
  onceVar: {
9874
- makeThirdPartyModuleInstance: cells[18].makeThirdPartyModuleInstance.set,
9875
- makeModuleInstance: cells[18].makeModuleInstance.set,
9968
+ makeAlias: cells[18].makeAlias.set,
9969
+ load: cells[18].load.set,
9876
9970
  },
9877
9971
  importMeta: {},
9878
9972
  });
@@ -9881,13 +9975,13 @@ assign(globalThis, {
9881
9975
  const map = new Map(entries);
9882
9976
  observeImports(map, "./commons.js", 0);
9883
9977
  observeImports(map, "./error/assert.js", 4);
9884
- observeImports(map, "./module-instance.js", 18);
9978
+ observeImports(map, "./module-load.js", 18);
9885
9979
  },
9886
9980
  liveVar: {
9887
9981
  },
9888
9982
  onceVar: {
9889
- link: cells[19].link.set,
9890
- instantiate: cells[19].instantiate.set,
9983
+ deferExports: cells[19].deferExports.set,
9984
+ getDeferredExports: cells[19].getDeferredExports.set,
9891
9985
  },
9892
9986
  importMeta: {},
9893
9987
  });
@@ -9895,22 +9989,15 @@ assign(globalThis, {
9895
9989
  imports(entries) {
9896
9990
  const map = new Map(entries);
9897
9991
  observeImports(map, "./commons.js", 0);
9898
- observeImports(map, "./compartment-evaluate.js", 11);
9992
+ observeImports(map, "./compartment-evaluate.js", 13);
9899
9993
  observeImports(map, "./error/assert.js", 4);
9900
- observeImports(map, "./global-object.js", 15);
9901
- observeImports(map, "./make-safe-evaluator.js", 10);
9902
- observeImports(map, "./module-link.js", 19);
9903
- observeImports(map, "./module-load.js", 16);
9904
- observeImports(map, "./module-proxy.js", 17);
9905
- observeImports(map, "./scope-constants.js", 6);
9906
- observeImports(map, "./whitelist.js", 14);
9994
+ observeImports(map, "./module-proxy.js", 19);
9907
9995
  },
9908
9996
  liveVar: {
9909
9997
  },
9910
9998
  onceVar: {
9911
- InertCompartment: cells[20].InertCompartment.set,
9912
- CompartmentPrototype: cells[20].CompartmentPrototype.set,
9913
- makeCompartmentConstructor: cells[20].makeCompartmentConstructor.set,
9999
+ makeThirdPartyModuleInstance: cells[20].makeThirdPartyModuleInstance.set,
10000
+ makeModuleInstance: cells[20].makeModuleInstance.set,
9914
10001
  },
9915
10002
  importMeta: {},
9916
10003
  });
@@ -9918,26 +10005,36 @@ assign(globalThis, {
9918
10005
  imports(entries) {
9919
10006
  const map = new Map(entries);
9920
10007
  observeImports(map, "./commons.js", 0);
9921
- observeImports(map, "./whitelist.js", 14);
10008
+ observeImports(map, "./error/assert.js", 4);
10009
+ observeImports(map, "./module-instance.js", 20);
9922
10010
  },
9923
10011
  liveVar: {
9924
10012
  },
9925
10013
  onceVar: {
9926
- makeIntrinsicsCollector: cells[21].makeIntrinsicsCollector.set,
9927
- getGlobalIntrinsics: cells[21].getGlobalIntrinsics.set,
10014
+ link: cells[21].link.set,
10015
+ instantiate: cells[21].instantiate.set,
9928
10016
  },
9929
10017
  importMeta: {},
9930
10018
  });
9931
10019
  functors[22]({
9932
10020
  imports(entries) {
9933
10021
  const map = new Map(entries);
10022
+ observeImports(map, "./commons.js", 0);
10023
+ observeImports(map, "./compartment-evaluate.js", 13);
10024
+ observeImports(map, "./error/assert.js", 4);
10025
+ observeImports(map, "./global-object.js", 17);
10026
+ observeImports(map, "./make-safe-evaluator.js", 12);
10027
+ observeImports(map, "./module-link.js", 21);
10028
+ observeImports(map, "./module-load.js", 18);
10029
+ observeImports(map, "./module-proxy.js", 19);
10030
+ observeImports(map, "./whitelist.js", 16);
9934
10031
  },
9935
10032
  liveVar: {
9936
10033
  },
9937
10034
  onceVar: {
9938
- minEnablements: cells[22].minEnablements.set,
9939
- moderateEnablements: cells[22].moderateEnablements.set,
9940
- severeEnablements: cells[22].severeEnablements.set,
10035
+ InertCompartment: cells[22].InertCompartment.set,
10036
+ CompartmentPrototype: cells[22].CompartmentPrototype.set,
10037
+ makeCompartmentConstructor: cells[22].makeCompartmentConstructor.set,
9941
10038
  },
9942
10039
  importMeta: {},
9943
10040
  });
@@ -9945,54 +10042,52 @@ assign(globalThis, {
9945
10042
  imports(entries) {
9946
10043
  const map = new Map(entries);
9947
10044
  observeImports(map, "./commons.js", 0);
9948
- observeImports(map, "./enablements.js", 22);
10045
+ observeImports(map, "./whitelist.js", 16);
9949
10046
  },
9950
10047
  liveVar: {
9951
10048
  },
9952
10049
  onceVar: {
9953
- default: cells[23].default.set,
10050
+ makeIntrinsicsCollector: cells[23].makeIntrinsicsCollector.set,
10051
+ getGlobalIntrinsics: cells[23].getGlobalIntrinsics.set,
9954
10052
  },
9955
10053
  importMeta: {},
9956
10054
  });
9957
10055
  functors[24]({
9958
10056
  imports(entries) {
9959
10057
  const map = new Map(entries);
9960
- observeImports(map, "./commons.js", 0);
9961
- observeImports(map, "./error/assert.js", 4);
9962
10058
  },
9963
10059
  liveVar: {
9964
10060
  },
9965
10061
  onceVar: {
9966
- makeEnvironmentCaptor: cells[24].makeEnvironmentCaptor.set,
10062
+ minEnablements: cells[24].minEnablements.set,
10063
+ moderateEnablements: cells[24].moderateEnablements.set,
10064
+ severeEnablements: cells[24].severeEnablements.set,
9967
10065
  },
9968
10066
  importMeta: {},
9969
10067
  });
9970
10068
  functors[25]({
9971
10069
  imports(entries) {
9972
10070
  const map = new Map(entries);
9973
- observeImports(map, "../commons.js", 0);
9974
- observeImports(map, "./internal-types.js", 1);
9975
- observeImports(map, "./types.js", 3);
10071
+ observeImports(map, "./commons.js", 0);
10072
+ observeImports(map, "./enablements.js", 24);
9976
10073
  },
9977
10074
  liveVar: {
9978
10075
  },
9979
10076
  onceVar: {
9980
- makeLoggingConsoleKit: cells[25].makeLoggingConsoleKit.set,
9981
- makeCausalConsole: cells[25].makeCausalConsole.set,
9982
- filterConsole: cells[25].filterConsole.set,
9983
- consoleWhitelist: cells[25].consoleWhitelist.set,
10077
+ default: cells[25].default.set,
9984
10078
  },
9985
10079
  importMeta: {},
9986
10080
  });
9987
10081
  functors[26]({
9988
10082
  imports(entries) {
9989
10083
  const map = new Map(entries);
9990
- observeImports(map, "../commons.js", 0);
10084
+ observeImports(map, "./commons.js", 0);
10085
+ observeImports(map, "./error/assert.js", 4);
9991
10086
  },
9992
10087
  liveVar: {
9993
10088
  },
9994
10089
  onceVar: {
9995
- makeRejectionHandlers: cells[26].makeRejectionHandlers.set,
10090
+ makeEnvironmentCaptor: cells[26].makeEnvironmentCaptor.set,
9996
10091
  },
9997
10092
  importMeta: {},
9998
10093
  });
@@ -10000,16 +10095,16 @@ assign(globalThis, {
10000
10095
  imports(entries) {
10001
10096
  const map = new Map(entries);
10002
10097
  observeImports(map, "../commons.js", 0);
10003
- observeImports(map, "./assert.js", 4);
10004
- observeImports(map, "./console.js", 25);
10005
10098
  observeImports(map, "./internal-types.js", 1);
10006
10099
  observeImports(map, "./types.js", 3);
10007
- observeImports(map, "./unhandled-rejection.js", 26);
10008
10100
  },
10009
10101
  liveVar: {
10010
10102
  },
10011
10103
  onceVar: {
10012
- tameConsole: cells[27].tameConsole.set,
10104
+ makeLoggingConsoleKit: cells[27].makeLoggingConsoleKit.set,
10105
+ makeCausalConsole: cells[27].makeCausalConsole.set,
10106
+ filterConsole: cells[27].filterConsole.set,
10107
+ consoleWhitelist: cells[27].consoleWhitelist.set,
10013
10108
  },
10014
10109
  importMeta: {},
10015
10110
  });
@@ -10021,9 +10116,7 @@ assign(globalThis, {
10021
10116
  liveVar: {
10022
10117
  },
10023
10118
  onceVar: {
10024
- filterFileName: cells[28].filterFileName.set,
10025
- shortenCallSiteString: cells[28].shortenCallSiteString.set,
10026
- tameV8ErrorConstructor: cells[28].tameV8ErrorConstructor.set,
10119
+ makeRejectionHandlers: cells[28].makeRejectionHandlers.set,
10027
10120
  },
10028
10121
  importMeta: {},
10029
10122
  });
@@ -10031,40 +10124,44 @@ assign(globalThis, {
10031
10124
  imports(entries) {
10032
10125
  const map = new Map(entries);
10033
10126
  observeImports(map, "../commons.js", 0);
10034
- observeImports(map, "../whitelist.js", 14);
10035
- observeImports(map, "./tame-v8-error-constructor.js", 28);
10127
+ observeImports(map, "./assert.js", 4);
10128
+ observeImports(map, "./console.js", 27);
10129
+ observeImports(map, "./internal-types.js", 1);
10130
+ observeImports(map, "./types.js", 3);
10131
+ observeImports(map, "./unhandled-rejection.js", 28);
10036
10132
  },
10037
10133
  liveVar: {
10038
10134
  },
10039
10135
  onceVar: {
10040
- default: cells[29].default.set,
10136
+ tameConsole: cells[29].tameConsole.set,
10041
10137
  },
10042
10138
  importMeta: {},
10043
10139
  });
10044
10140
  functors[30]({
10045
10141
  imports(entries) {
10046
10142
  const map = new Map(entries);
10047
- observeImports(map, "./commons.js", 0);
10048
- observeImports(map, "./compartment-shim.js", 20);
10143
+ observeImports(map, "../commons.js", 0);
10049
10144
  },
10050
10145
  liveVar: {
10051
10146
  },
10052
10147
  onceVar: {
10053
- getAnonymousIntrinsics: cells[30].getAnonymousIntrinsics.set,
10148
+ filterFileName: cells[30].filterFileName.set,
10149
+ shortenCallSiteString: cells[30].shortenCallSiteString.set,
10150
+ tameV8ErrorConstructor: cells[30].tameV8ErrorConstructor.set,
10054
10151
  },
10055
10152
  importMeta: {},
10056
10153
  });
10057
10154
  functors[31]({
10058
10155
  imports(entries) {
10059
10156
  const map = new Map(entries);
10060
- observeImports(map, "./commons.js", 0);
10061
- observeImports(map, "./error/assert.js", 4);
10157
+ observeImports(map, "../commons.js", 0);
10158
+ observeImports(map, "../whitelist.js", 16);
10159
+ observeImports(map, "./tame-v8-error-constructor.js", 30);
10062
10160
  },
10063
10161
  liveVar: {
10064
10162
  },
10065
10163
  onceVar: {
10066
- isTypedArray: cells[31].isTypedArray.set,
10067
- makeHardener: cells[31].makeHardener.set,
10164
+ default: cells[31].default.set,
10068
10165
  },
10069
10166
  importMeta: {},
10070
10167
  });
@@ -10072,11 +10169,12 @@ assign(globalThis, {
10072
10169
  imports(entries) {
10073
10170
  const map = new Map(entries);
10074
10171
  observeImports(map, "./commons.js", 0);
10172
+ observeImports(map, "./compartment-shim.js", 22);
10075
10173
  },
10076
10174
  liveVar: {
10077
10175
  },
10078
10176
  onceVar: {
10079
- default: cells[32].default.set,
10177
+ getAnonymousIntrinsics: cells[32].getAnonymousIntrinsics.set,
10080
10178
  },
10081
10179
  importMeta: {},
10082
10180
  });
@@ -10084,11 +10182,13 @@ assign(globalThis, {
10084
10182
  imports(entries) {
10085
10183
  const map = new Map(entries);
10086
10184
  observeImports(map, "./commons.js", 0);
10185
+ observeImports(map, "./error/assert.js", 4);
10087
10186
  },
10088
10187
  liveVar: {
10089
10188
  },
10090
10189
  onceVar: {
10091
- tameDomains: cells[33].tameDomains.set,
10190
+ isTypedArray: cells[33].isTypedArray.set,
10191
+ makeHardener: cells[33].makeHardener.set,
10092
10192
  },
10093
10193
  importMeta: {},
10094
10194
  });
@@ -10112,7 +10212,7 @@ assign(globalThis, {
10112
10212
  liveVar: {
10113
10213
  },
10114
10214
  onceVar: {
10115
- tameFunctionToString: cells[35].tameFunctionToString.set,
10215
+ tameDomains: cells[35].tameDomains.set,
10116
10216
  },
10117
10217
  importMeta: {},
10118
10218
  });
@@ -10120,7 +10220,6 @@ assign(globalThis, {
10120
10220
  imports(entries) {
10121
10221
  const map = new Map(entries);
10122
10222
  observeImports(map, "./commons.js", 0);
10123
- observeImports(map, "./error/assert.js", 4);
10124
10223
  },
10125
10224
  liveVar: {
10126
10225
  },
@@ -10137,7 +10236,7 @@ assign(globalThis, {
10137
10236
  liveVar: {
10138
10237
  },
10139
10238
  onceVar: {
10140
- default: cells[37].default.set,
10239
+ tameFunctionToString: cells[37].tameFunctionToString.set,
10141
10240
  },
10142
10241
  importMeta: {},
10143
10242
  });
@@ -10145,6 +10244,7 @@ assign(globalThis, {
10145
10244
  imports(entries) {
10146
10245
  const map = new Map(entries);
10147
10246
  observeImports(map, "./commons.js", 0);
10247
+ observeImports(map, "./error/assert.js", 4);
10148
10248
  },
10149
10249
  liveVar: {
10150
10250
  },
@@ -10157,7 +10257,6 @@ assign(globalThis, {
10157
10257
  imports(entries) {
10158
10258
  const map = new Map(entries);
10159
10259
  observeImports(map, "./commons.js", 0);
10160
- observeImports(map, "./whitelist.js", 14);
10161
10260
  },
10162
10261
  liveVar: {
10163
10262
  },
@@ -10170,45 +10269,70 @@ assign(globalThis, {
10170
10269
  imports(entries) {
10171
10270
  const map = new Map(entries);
10172
10271
  observeImports(map, "./commons.js", 0);
10173
- observeImports(map, "./compartment-shim.js", 20);
10174
- observeImports(map, "./enable-property-overrides.js", 23);
10175
- observeImports(map, "./environment-options.js", 24);
10272
+ },
10273
+ liveVar: {
10274
+ },
10275
+ onceVar: {
10276
+ default: cells[40].default.set,
10277
+ },
10278
+ importMeta: {},
10279
+ });
10280
+ functors[41]({
10281
+ imports(entries) {
10282
+ const map = new Map(entries);
10283
+ observeImports(map, "./commons.js", 0);
10284
+ observeImports(map, "./whitelist.js", 16);
10285
+ },
10286
+ liveVar: {
10287
+ },
10288
+ onceVar: {
10289
+ default: cells[41].default.set,
10290
+ },
10291
+ importMeta: {},
10292
+ });
10293
+ functors[42]({
10294
+ imports(entries) {
10295
+ const map = new Map(entries);
10296
+ observeImports(map, "./commons.js", 0);
10297
+ observeImports(map, "./compartment-shim.js", 22);
10298
+ observeImports(map, "./enable-property-overrides.js", 25);
10299
+ observeImports(map, "./environment-options.js", 26);
10176
10300
  observeImports(map, "./error/assert.js", 4);
10177
10301
  observeImports(map, "./error/stringify-utils.js", 2);
10178
- observeImports(map, "./error/tame-console.js", 27);
10179
- observeImports(map, "./error/tame-error-constructor.js", 29);
10180
- observeImports(map, "./get-anonymous-intrinsics.js", 30);
10181
- observeImports(map, "./global-object.js", 15);
10182
- observeImports(map, "./intrinsics.js", 21);
10183
- observeImports(map, "./make-hardener.js", 31);
10184
- observeImports(map, "./make-safe-evaluator.js", 10);
10185
- observeImports(map, "./tame-date-constructor.js", 32);
10186
- observeImports(map, "./tame-domains.js", 33);
10187
- observeImports(map, "./tame-function-constructors.js", 34);
10188
- observeImports(map, "./tame-function-tostring.js", 35);
10189
- observeImports(map, "./tame-locale-methods.js", 36);
10190
- observeImports(map, "./tame-math-object.js", 37);
10191
- observeImports(map, "./tame-regexp-constructor.js", 38);
10192
- observeImports(map, "./whitelist-intrinsics.js", 39);
10193
- observeImports(map, "./whitelist.js", 14);
10302
+ observeImports(map, "./error/tame-console.js", 29);
10303
+ observeImports(map, "./error/tame-error-constructor.js", 31);
10304
+ observeImports(map, "./get-anonymous-intrinsics.js", 32);
10305
+ observeImports(map, "./global-object.js", 17);
10306
+ observeImports(map, "./intrinsics.js", 23);
10307
+ observeImports(map, "./make-hardener.js", 33);
10308
+ observeImports(map, "./make-safe-evaluator.js", 12);
10309
+ observeImports(map, "./tame-date-constructor.js", 34);
10310
+ observeImports(map, "./tame-domains.js", 35);
10311
+ observeImports(map, "./tame-function-constructors.js", 36);
10312
+ observeImports(map, "./tame-function-tostring.js", 37);
10313
+ observeImports(map, "./tame-locale-methods.js", 38);
10314
+ observeImports(map, "./tame-math-object.js", 39);
10315
+ observeImports(map, "./tame-regexp-constructor.js", 40);
10316
+ observeImports(map, "./whitelist-intrinsics.js", 41);
10317
+ observeImports(map, "./whitelist.js", 16);
10194
10318
  },
10195
10319
  liveVar: {
10196
10320
  },
10197
10321
  onceVar: {
10198
- repairIntrinsics: cells[40].repairIntrinsics.set,
10199
- lockdown: cells[40].lockdown.set,
10322
+ repairIntrinsics: cells[42].repairIntrinsics.set,
10323
+ lockdown: cells[42].lockdown.set,
10200
10324
  },
10201
10325
  importMeta: {},
10202
10326
  });
10203
- functors[41]({
10327
+ functors[43]({
10204
10328
  imports(entries) {
10205
10329
  const map = new Map(entries);
10206
10330
  observeImports(map, "./src/commons.js", 0);
10207
- observeImports(map, "./src/compartment-shim.js", 20);
10331
+ observeImports(map, "./src/compartment-shim.js", 22);
10208
10332
  observeImports(map, "./src/error/assert.js", 4);
10209
- observeImports(map, "./src/intrinsics.js", 21);
10210
- observeImports(map, "./src/lockdown-shim.js", 40);
10211
- observeImports(map, "./src/tame-function-tostring.js", 35);
10333
+ observeImports(map, "./src/intrinsics.js", 23);
10334
+ observeImports(map, "./src/lockdown-shim.js", 42);
10335
+ observeImports(map, "./src/tame-function-tostring.js", 37);
10212
10336
  },
10213
10337
  liveVar: {
10214
10338
  },
@@ -10216,4 +10340,6 @@ assign(globalThis, {
10216
10340
  },
10217
10341
  importMeta: {},
10218
10342
  });
10343
+
10344
+ return cells[cells.length - 1]['*'].get();
10219
10345
  })();