ses 0.18.1 → 0.18.3

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.cjs CHANGED
@@ -63,6 +63,8 @@ const {
63
63
  getOwnPropertyNames,
64
64
  getPrototypeOf,
65
65
  is,
66
+ isFrozen,
67
+ isSealed,
66
68
  isExtensible,
67
69
  keys,
68
70
  prototype: objectPrototype,
@@ -71,7 +73,7 @@ const {
71
73
  setPrototypeOf,
72
74
  values,
73
75
  fromEntries}=
74
- Object;$h‍_once.assign(assign);$h‍_once.create(create);$h‍_once.defineProperties(defineProperties);$h‍_once.entries(entries);$h‍_once.freeze(freeze);$h‍_once.getOwnPropertyDescriptor(getOwnPropertyDescriptor);$h‍_once.getOwnPropertyDescriptors(getOwnPropertyDescriptors);$h‍_once.getOwnPropertyNames(getOwnPropertyNames);$h‍_once.getPrototypeOf(getPrototypeOf);$h‍_once.is(is);$h‍_once.isExtensible(isExtensible);$h‍_once.keys(keys);$h‍_once.objectPrototype(objectPrototype);$h‍_once.seal(seal);$h‍_once.preventExtensions(preventExtensions);$h‍_once.setPrototypeOf(setPrototypeOf);$h‍_once.values(values);$h‍_once.fromEntries(fromEntries);
76
+ Object;$h‍_once.assign(assign);$h‍_once.create(create);$h‍_once.defineProperties(defineProperties);$h‍_once.entries(entries);$h‍_once.freeze(freeze);$h‍_once.getOwnPropertyDescriptor(getOwnPropertyDescriptor);$h‍_once.getOwnPropertyDescriptors(getOwnPropertyDescriptors);$h‍_once.getOwnPropertyNames(getOwnPropertyNames);$h‍_once.getPrototypeOf(getPrototypeOf);$h‍_once.is(is);$h‍_once.isFrozen(isFrozen);$h‍_once.isSealed(isSealed);$h‍_once.isExtensible(isExtensible);$h‍_once.keys(keys);$h‍_once.objectPrototype(objectPrototype);$h‍_once.seal(seal);$h‍_once.preventExtensions(preventExtensions);$h‍_once.setPrototypeOf(setPrototypeOf);$h‍_once.values(values);$h‍_once.fromEntries(fromEntries);
75
77
 
76
78
  const {
77
79
  species: speciesSymbol,
@@ -101,6 +103,7 @@ const defineProperty= (object, prop, descriptor)=> {
101
103
  // Instead, to workaround the Safari bug
102
104
  const result= originalDefineProperty(object, prop, descriptor);
103
105
  if( result!== object) {
106
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_DEFINE_PROPERTY_FAILED_SILENTLY.md
104
107
  throw TypeError(
105
108
  `Please report that the original defineProperty silently failed to set ${stringifyJson(
106
109
  String(prop))
@@ -283,6 +286,7 @@ $h‍_once.isError(isError);const FERAL_EVAL=eval;
283
286
  $h‍_once.FERAL_EVAL(FERAL_EVAL);const FERAL_FUNCTION=Function;$h‍_once.FERAL_FUNCTION(FERAL_FUNCTION);
284
287
 
285
288
  const noEvalEvaluate= ()=> {
289
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_NO_EVAL.md
286
290
  throw new TypeError(
287
291
  'Cannot eval with evalTaming set to "noEval" (SES_NO_EVAL)');
288
292
 
@@ -317,7 +321,7 @@ const noEvalEvaluate= ()=> {
317
321
  */
318
322
 
319
323
  /**
320
- * @typedef {Object} LoggedErrorHandler
324
+ * @typedef {object} LoggedErrorHandler
321
325
  *
322
326
  * Used to parameterize `makeCausalConsole` to give it access to potentially
323
327
  * hidden information to augment the logging of errors.
@@ -337,13 +341,13 @@ const noEvalEvaluate= ()=> {
337
341
  */
338
342
 
339
343
  /**
340
- * @typedef {Object} LoggingConsoleKit
344
+ * @typedef {object} LoggingConsoleKit
341
345
  * @property {VirtualConsole} loggingConsole
342
346
  * @property {() => readonly LogRecord[]} takeLog
343
347
  */
344
348
 
345
349
  /**
346
- * @typedef {Object} MakeLoggingConsoleKitOptions
350
+ * @typedef {object} MakeLoggingConsoleKitOptions
347
351
  * @property {boolean=} shouldResetForDebugging
348
352
  */
349
353
 
@@ -382,6 +386,289 @@ const noEvalEvaluate= ()=> {
382
386
  })
383
387
  ,
384
388
  // === functors[2] ===
389
+ (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { $h‍_imports([["./internal-types.js", []]]);
390
+
391
+
392
+
393
+
394
+
395
+ const { freeze}= Object;
396
+ const { isSafeInteger}= Number;
397
+
398
+ /**
399
+ * @template Data
400
+ * @typedef {object} DoublyLinkedCell
401
+ * A cell of a doubly-linked ring, i.e., a doubly-linked circular list.
402
+ * DoublyLinkedCells are not frozen, and so should be closely encapsulated by
403
+ * any abstraction that uses them.
404
+ * @property {DoublyLinkedCell<Data>} next
405
+ * @property {DoublyLinkedCell<Data>} prev
406
+ * @property {Data} data
407
+ */
408
+
409
+ /**
410
+ * Makes a new self-linked cell. There are two reasons to do so:
411
+ * * To make the head sigil of a new initially-empty doubly-linked ring.
412
+ * * To make a non-sigil cell to be `spliceAfter`ed.
413
+ *
414
+ * @template Data
415
+ * @param {Data} data
416
+ * @returns {DoublyLinkedCell<Data>}
417
+ */
418
+ const makeSelfCell= (data)=>{
419
+ /** @type {Partial<DoublyLinkedCell<Data>>} */
420
+ const incompleteCell= {
421
+ next: undefined,
422
+ prev: undefined,
423
+ data};
424
+
425
+ const selfCell= /** @type {DoublyLinkedCell<Data>} */ incompleteCell;
426
+ selfCell.next= selfCell;
427
+ selfCell.prev= selfCell;
428
+ // Not frozen!
429
+ return selfCell;
430
+ };
431
+
432
+ /**
433
+ * Splices a self-linked non-sigil cell into a ring after `prev`.
434
+ * `prev` could be the head sigil, or it could be some other non-sigil
435
+ * cell within a ring.
436
+ *
437
+ * @template Data
438
+ * @param {DoublyLinkedCell<Data>} prev
439
+ * @param {DoublyLinkedCell<Data>} selfCell
440
+ */
441
+ const spliceAfter= (prev, selfCell)=> {
442
+ if( prev=== selfCell) {
443
+ throw TypeError('Cannot splice a cell into itself');
444
+ }
445
+ if( selfCell.next!== selfCell|| selfCell.prev!== selfCell) {
446
+ throw TypeError('Expected self-linked cell');
447
+ }
448
+ const cell= selfCell;
449
+ // rename variable cause it isn't self-linked after this point.
450
+
451
+ const next= prev.next;
452
+ cell.prev= prev;
453
+ cell.next= next;
454
+ prev.next= cell;
455
+ next.prev= cell;
456
+ // Not frozen!
457
+ return cell;
458
+ };
459
+
460
+ /**
461
+ * @template Data
462
+ * @param {DoublyLinkedCell<Data>} cell
463
+ * No-op if the cell is self-linked.
464
+ */
465
+ const spliceOut= (cell)=>{
466
+ const { prev, next}= cell;
467
+ prev.next= next;
468
+ next.prev= prev;
469
+ cell.prev= cell;
470
+ cell.next= cell;
471
+ };
472
+
473
+ /**
474
+ * The LRUCacheMap is used within the implementation of `assert` and so
475
+ * at a layer below SES or harden. Thus, we give it a `WeakMap`-like interface
476
+ * rather than a `WeakMapStore`-like interface. To work before `lockdown`,
477
+ * the implementation must use `freeze` manually, but still exhaustively.
478
+ *
479
+ * It implements the WeakMap interface, and holds its keys weakly. Cached
480
+ * values are only held while the key is held by the user and the key/value
481
+ * bookkeeping cell has not been pushed off the end of the cache by `budget`
482
+ * number of more recently referenced cells. If the key is dropped by the user,
483
+ * the value will no longer be held by the cache, but the bookkeeping cell
484
+ * itself will stay in memory.
485
+ *
486
+ * @template {{}} K
487
+ * @template {unknown} V
488
+ * @param {number} keysBudget
489
+ * @returns {WeakMap<K,V>}
490
+ */
491
+ const makeLRUCacheMap= (keysBudget)=>{
492
+ if( !isSafeInteger(keysBudget)|| keysBudget< 0) {
493
+ throw new TypeError(
494
+ 'keysBudget must be a safe non-negative integer number');
495
+
496
+ }
497
+ /** @typedef {DoublyLinkedCell<WeakMap<K, V> | undefined>} LRUCacheCell */
498
+ /** @type {WeakMap<K, LRUCacheCell>} */
499
+ const keyToCell= new WeakMap();
500
+ let size= 0; // `size` must remain <= `keysBudget`
501
+ // As a sigil, `head` uniquely is not in the `keyToCell` map.
502
+ /** @type {LRUCacheCell} */
503
+ const head= makeSelfCell(undefined);
504
+
505
+ const touchCell= (key)=>{
506
+ const cell= keyToCell.get(key);
507
+ if( cell=== undefined|| cell.data=== undefined) {
508
+ // Either the key was GCed, or the cell was condemned.
509
+ return undefined;
510
+ }
511
+ // Becomes most recently used
512
+ spliceOut(cell);
513
+ spliceAfter(head, cell);
514
+ return cell;
515
+ };
516
+
517
+ /**
518
+ * @param {K} key
519
+ */
520
+ const has= (key)=>touchCell(key)!== undefined;
521
+ freeze(has);
522
+
523
+ /**
524
+ * @param {K} key
525
+ */
526
+ // TODO Change to the following line, once our tools don't choke on `?.`.
527
+ // See https://github.com/endojs/endo/issues/1514
528
+ // const get = key => touchCell(key)?.data?.get(key);
529
+ const get= (key)=>{
530
+ const cell= touchCell(key);
531
+ return cell&& cell.data&& cell.data.get(key);
532
+ };
533
+ freeze(get);
534
+
535
+ /**
536
+ * @param {K} key
537
+ * @param {V} value
538
+ */
539
+ const set= (key, value)=> {
540
+ if( keysBudget< 1) {
541
+ // eslint-disable-next-line no-use-before-define
542
+ return lruCacheMap; // Implements WeakMap.set
543
+ }
544
+
545
+ let cell= touchCell(key);
546
+ if( cell=== undefined) {
547
+ cell= makeSelfCell(undefined);
548
+ spliceAfter(head, cell); // start most recently used
549
+ }
550
+ if( !cell.data) {
551
+ // Either a fresh cell or a reused condemned cell.
552
+ size+= 1;
553
+ // Add its data.
554
+ cell.data= new WeakMap();
555
+ // Advertise the cell for this key.
556
+ keyToCell.set(key, cell);
557
+ while( size> keysBudget) {
558
+ const condemned= head.prev;
559
+ spliceOut(condemned); // Drop least recently used
560
+ condemned.data= undefined;
561
+ size-= 1;
562
+ }
563
+ }
564
+
565
+ // Update the data.
566
+ cell.data.set(key, value);
567
+
568
+ // eslint-disable-next-line no-use-before-define
569
+ return lruCacheMap; // Implements WeakMap.set
570
+ };
571
+ freeze(set);
572
+
573
+ // "delete" is a keyword.
574
+ /**
575
+ * @param {K} key
576
+ */
577
+ const deleteIt= (key)=>{
578
+ const cell= keyToCell.get(key);
579
+ if( cell=== undefined) {
580
+ return false;
581
+ }
582
+ spliceOut(cell);
583
+ keyToCell.delete(key);
584
+ if( cell.data=== undefined) {
585
+ // Already condemned.
586
+ return false;
587
+ }
588
+
589
+ cell.data= undefined;
590
+ size-= 1;
591
+ return true;
592
+ };
593
+ freeze(deleteIt);
594
+
595
+ const lruCacheMap= freeze({
596
+ has,
597
+ get,
598
+ set,
599
+ delete: deleteIt,
600
+ [Symbol.toStringTag]: 'LRUCacheMap'});
601
+
602
+ return lruCacheMap;
603
+ };$h‍_once.makeLRUCacheMap(makeLRUCacheMap);
604
+ freeze(makeLRUCacheMap);
605
+
606
+ const defaultLoggedErrorsBudget= 1000;
607
+ const defaultArgsPerErrorBudget= 100;
608
+
609
+ /**
610
+ * @param {number} [errorsBudget]
611
+ * @param {number} [argsPerErrorBudget]
612
+ */
613
+ const makeNoteLogArgsArrayKit= (
614
+ errorsBudget= defaultLoggedErrorsBudget,
615
+ argsPerErrorBudget= defaultArgsPerErrorBudget)=>
616
+ {
617
+ if( !isSafeInteger(argsPerErrorBudget)|| argsPerErrorBudget< 1) {
618
+ throw new TypeError(
619
+ 'argsPerErrorBudget must be a safe positive integer number');
620
+
621
+ }
622
+
623
+ /**
624
+ * @type {WeakMap<Error, LogArgs[]>}
625
+ *
626
+ * Maps from an error to an array of log args, where each log args is
627
+ * remembered as an annotation on that error. This can be used, for example,
628
+ * to keep track of additional causes of the error. The elements of any
629
+ * log args may include errors which are associated with further annotations.
630
+ * An augmented console, like the causal console of `console.js`, could
631
+ * then retrieve the graph of such annotations.
632
+ */
633
+ const noteLogArgsArrayMap= makeLRUCacheMap(errorsBudget);
634
+
635
+ /**
636
+ * @param {Error} error
637
+ * @param {LogArgs} logArgs
638
+ */
639
+ const addLogArgs= (error, logArgs)=> {
640
+ const logArgsArray= noteLogArgsArrayMap.get(error);
641
+ if( logArgsArray!== undefined) {
642
+ if( logArgsArray.length>= argsPerErrorBudget) {
643
+ logArgsArray.shift();
644
+ }
645
+ logArgsArray.push(logArgs);
646
+ }else {
647
+ noteLogArgsArrayMap.set(error, [logArgs]);
648
+ }
649
+ };
650
+ freeze(addLogArgs);
651
+
652
+ /**
653
+ * @param {Error} error
654
+ * @returns {LogArgs[] | undefined}
655
+ */
656
+ const takeLogArgsArray= (error)=>{
657
+ const result= noteLogArgsArrayMap.get(error);
658
+ noteLogArgsArrayMap.delete(error);
659
+ return result;
660
+ };
661
+ freeze(takeLogArgsArray);
662
+
663
+ return freeze({
664
+ addLogArgs,
665
+ takeLogArgsArray});
666
+
667
+ };$h‍_once.makeNoteLogArgsArrayKit(makeNoteLogArgsArrayKit);
668
+ freeze(makeNoteLogArgsArrayKit);
669
+ })
670
+ ,
671
+ // === functors[3] ===
385
672
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let Set,String,arrayJoin,arraySlice,freeze,is,isError,setAdd,setHas,stringIncludes,stringStartsWith,stringifyJson,toStringTagSymbol;$h‍_imports([["../commons.js", [["Set", [$h‍_a => (Set = $h‍_a)]],["String", [$h‍_a => (String = $h‍_a)]],["arrayJoin", [$h‍_a => (arrayJoin = $h‍_a)]],["arraySlice", [$h‍_a => (arraySlice = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["is", [$h‍_a => (is = $h‍_a)]],["isError", [$h‍_a => (isError = $h‍_a)]],["setAdd", [$h‍_a => (setAdd = $h‍_a)]],["setHas", [$h‍_a => (setHas = $h‍_a)]],["stringIncludes", [$h‍_a => (stringIncludes = $h‍_a)]],["stringStartsWith", [$h‍_a => (stringStartsWith = $h‍_a)]],["stringifyJson", [$h‍_a => (stringifyJson = $h‍_a)]],["toStringTagSymbol", [$h‍_a => (toStringTagSymbol = $h‍_a)]]]]]);
386
673
 
387
674
 
@@ -552,7 +839,7 @@ const bestEffortStringify= (payload, spaces= undefined)=> {
552
839
  freeze(bestEffortStringify);
553
840
  })
554
841
  ,
555
- // === functors[3] ===
842
+ // === functors[4] ===
556
843
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { $h‍_imports([]); // @ts-check
557
844
 
558
845
  /**
@@ -589,8 +876,9 @@ freeze(bestEffortStringify);
589
876
  *
590
877
  * The `assert.fail` method.
591
878
  *
592
- * Fail an assertion, recording details to the console and
593
- * raising an exception with just type information.
879
+ * Fail an assertion, recording full details to the console and
880
+ * raising an exception with a message in which `details` substitution values
881
+ * have been redacted.
594
882
  *
595
883
  * The optional `optDetails` can be a string for backwards compatibility
596
884
  * with the nodejs assertion library.
@@ -696,14 +984,15 @@ freeze(bestEffortStringify);
696
984
  * Assert an expected typeof result.
697
985
  * @param {any} specimen The value to get the typeof
698
986
  * @param {Details=} optDetails The details to throw
987
+ * @returns {asserts specimen is string}
699
988
  */
700
989
 
701
990
  /**
702
991
  * @callback AssertNote
703
992
  * The `assert.note` method.
704
993
  *
705
- * Annotate this error with these details, potentially to be used by an
706
- * augmented console, like the causal console of `console.js`, to
994
+ * Annotate an error with details, potentially to be used by an
995
+ * augmented console such as the causal console of `console.js`, to
707
996
  * provide extra information associated with logged errors.
708
997
  *
709
998
  * @param {Error} error
@@ -733,38 +1022,24 @@ freeze(bestEffortStringify);
733
1022
 
734
1023
  /**
735
1024
  * To "declassify" and quote a substitution value used in a
736
- * details`...` template literal, enclose that substitution expression
737
- * in a call to `quote`. This states that the argument should appear quoted
738
- * (as if with `JSON.stringify`), in the error message of the thrown error. The
1025
+ * ``` details`...` ``` template literal, enclose that substitution expression
1026
+ * in a call to `quote`. This makes the value appear quoted
1027
+ * (as if with `JSON.stringify`) in the message of the thrown error. The
739
1028
  * payload itself is still passed unquoted to the console as it would be
740
1029
  * without `quote`.
741
1030
  *
742
- * Starting from the example in the `details` comment, say instead that the
743
- * color the sky is supposed to be is also computed. Say that we still don't
744
- * want to reveal the sky's actual color, but we do want the thrown error's
745
- * message to reveal what color the sky was supposed to be:
1031
+ * For example, the following will reveal the expected sky color, but not the
1032
+ * actual incorrect sky color, in the thrown error's message:
746
1033
  * ```js
747
- * assert.equal(
748
- * sky.color,
749
- * color,
750
- * details`${sky.color} should be ${quote(color)}`,
751
- * );
1034
+ * sky.color === expectedColor || Fail`${sky.color} should be ${quote(expectedColor)}`;
752
1035
  * ```
753
1036
  *
754
1037
  * // TODO Update SES-shim to new convention, where `details` is
755
1038
  * // renamed to `X` rather than `d`.
756
- * The normal convention is to locally rename `quote` to `q` and
757
- * `details` to `d`
1039
+ * The normal convention is to locally rename `details` to `d` and `quote` to `q`
1040
+ * like `const { details: d, quote: q } = assert;`, so the above example would then be
758
1041
  * ```js
759
- * const { details: d, quote: q } = assert;
760
- * ```
761
- * so the above example would then be
762
- * ```js
763
- * assert.equal(
764
- * sky.color,
765
- * color,
766
- * d`${sky.color} should be ${q(color)}`,
767
- * );
1042
+ * sky.color === expectedColor || Fail`${sky.color} should be ${q(expectedColor)}`;
768
1043
  * ```
769
1044
  *
770
1045
  * @callback AssertQuote
@@ -816,75 +1091,68 @@ freeze(bestEffortStringify);
816
1091
  * ```js
817
1092
  * assert(sky.isBlue(), details`${sky.color} should be "blue"`);
818
1093
  * ```
1094
+ * // TODO Update SES-shim to new convention, where `details` is
1095
+ * // renamed to `X` rather than `d`.
1096
+ * or following the normal convention to locally rename `details` to `d`
1097
+ * and `quote` to `q` like `const { details: d, quote: q } = assert;`:
1098
+ * ```js
1099
+ * assert(sky.isBlue(), d`${sky.color} should be "blue"`);
1100
+ * ```
1101
+ * However, note that in most cases it is preferable to instead use the `Fail`
1102
+ * template literal tag (which has the same input signature as `details`
1103
+ * but automatically creates and throws an error):
1104
+ * ```js
1105
+ * sky.isBlue() || Fail`${sky.color} should be "blue"`;
1106
+ * ```
1107
+ *
819
1108
  * The details template tag returns a `DetailsToken` object that can print
820
1109
  * itself with the formatted message in two ways.
821
- * It will report the real details to
822
- * the console but include only the typeof information in the thrown error
1110
+ * It will report full details to the console, but
1111
+ * mask embedded substitution values with their typeof information in the thrown error
823
1112
  * to prevent revealing secrets up the exceptional path. In the example
824
1113
  * above, the thrown error may reveal only that `sky.color` is a string,
825
1114
  * whereas the same diagnostic printed to the console reveals that the
826
- * sky was green.
1115
+ * sky was green. This masking can be disabled for an individual substitution value
1116
+ * using `quote`.
827
1117
  *
828
- * The `raw` member of a `template` is ignored, so a simple
829
- * `string[]` can also be used as a template.
1118
+ * The `raw` property of an input template array is ignored, so a simple
1119
+ * array of strings may be provided directly.
830
1120
  */
831
1121
 
832
1122
  /**
833
1123
  * @typedef {(template: TemplateStringsArray | string[], ...args: any) => never} FailTag
834
- * The `Fail` tamplate tag supports replacing patterns like
835
- * ```js
836
- * assert(cond, X`...complaint...`);
837
- * ```
838
- * or
839
- * ```js
840
- * cond || assert.fail(X`...complaint...`);
841
- * ```
842
- * with patterns like
843
- * ```js
844
- * cond || Fail`...complaint...`;
845
- * ```
846
1124
  *
847
- * However, due to [weakness in current
848
- * TypeScript](https://github.com/microsoft/TypeScript/issues/51426), the `||`
849
- * patterns are not as powerful as the `assert(...)` call at enabling static
850
- * reasoning. Of the `||`, again due to weaknesses in current TypeScript,
851
- * the
852
- * ```js
853
- * cond || Fail`...complaint...`
854
- * ```
855
- * pattern is not as powerful as the
1125
+ * Use the `Fail` function as a template literal tag to efficiently
1126
+ * create and throw a `details`-style error only when a condition is not satisfied.
856
1127
  * ```js
857
- * cond || assert.fail(X`...complaint...`);
1128
+ * condition || Fail`...complaint...`;
858
1129
  * ```
859
- * at enabling static resoning. Despite these problems, we do not want to
860
- * return to the
1130
+ * This avoids the overhead of creating usually-unnecessary errors like
861
1131
  * ```js
862
- * assert(cond, X`...complaint...`)
1132
+ * assert(condition, details`...complaint...`);
863
1133
  * ```
864
- * style because of the substantial overhead in
865
- * evaluating the `X` template in the typical `true` case where it is not
866
- * needed. And we do not want to return to the
1134
+ * while improving readability over alternatives like
867
1135
  * ```js
868
- * assert.fail(X`...complaint...`)`
1136
+ * condition || assert.fail(details`...complaint...`);
869
1137
  * ```
870
- * because of the verbosity and loss of readability. Instead, until/unless
871
- * https://github.com/microsoft/TypeScript/issues/51426 is fixed, for those
872
- * new-style assertions where this loss of static reasoning is a problem,
1138
+ *
1139
+ * However, due to current weakness in TypeScript, static reasoning
1140
+ * is less powerful with the `||` patterns than with an `assert` call.
1141
+ * Until/unless https://github.com/microsoft/TypeScript/issues/51426 is fixed,
1142
+ * for `||`-style assertions where this loss of static reasoning is a problem,
873
1143
  * instead express the assertion as
874
1144
  * ```js
875
- * if (!cond) {
1145
+ * if (!condition) {
876
1146
  * Fail`...complaint...`;
877
1147
  * }
878
1148
  * ```
879
1149
  * or, if needed,
880
1150
  * ```js
881
- * if (!cond) {
882
- * // `throw` is noop since `Fail` throws. But linter confused
1151
+ * if (!condition) {
1152
+ * // `throw` is noop since `Fail` throws, but it improves static analysis
883
1153
  * throw Fail`...complaint...`;
884
1154
  * }
885
1155
  * ```
886
- * This avoid the TypeScript bugs that cause the loss of static reasoning,
887
- * but with no loss of efficiency and little loss of readability.
888
1156
  */
889
1157
 
890
1158
  /**
@@ -922,7 +1190,7 @@ freeze(bestEffortStringify);
922
1190
  // /////////////////////////////////////////////////////////////////////////////
923
1191
 
924
1192
  /**
925
- * @typedef {Object} VirtualConsole
1193
+ * @typedef {object} VirtualConsole
926
1194
  * @property {Console['debug']} debug
927
1195
  * @property {Console['log']} log
928
1196
  * @property {Console['info']} info
@@ -978,8 +1246,9 @@ freeze(bestEffortStringify);
978
1246
  */
979
1247
  })
980
1248
  ,
981
- // === functors[4] ===
982
- (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let RangeError,TypeError,WeakMap,arrayJoin,arrayMap,arrayPop,arrayPush,assign,freeze,globalThis,is,isError,stringIndexOf,stringReplace,stringSlice,stringStartsWith,weakmapDelete,weakmapGet,weakmapHas,weakmapSet,an,bestEffortStringify;$h‍_imports([["../commons.js", [["RangeError", [$h‍_a => (RangeError = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["WeakMap", [$h‍_a => (WeakMap = $h‍_a)]],["arrayJoin", [$h‍_a => (arrayJoin = $h‍_a)]],["arrayMap", [$h‍_a => (arrayMap = $h‍_a)]],["arrayPop", [$h‍_a => (arrayPop = $h‍_a)]],["arrayPush", [$h‍_a => (arrayPush = $h‍_a)]],["assign", [$h‍_a => (assign = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["globalThis", [$h‍_a => (globalThis = $h‍_a)]],["is", [$h‍_a => (is = $h‍_a)]],["isError", [$h‍_a => (isError = $h‍_a)]],["stringIndexOf", [$h‍_a => (stringIndexOf = $h‍_a)]],["stringReplace", [$h‍_a => (stringReplace = $h‍_a)]],["stringSlice", [$h‍_a => (stringSlice = $h‍_a)]],["stringStartsWith", [$h‍_a => (stringStartsWith = $h‍_a)]],["weakmapDelete", [$h‍_a => (weakmapDelete = $h‍_a)]],["weakmapGet", [$h‍_a => (weakmapGet = $h‍_a)]],["weakmapHas", [$h‍_a => (weakmapHas = $h‍_a)]],["weakmapSet", [$h‍_a => (weakmapSet = $h‍_a)]]]],["./stringify-utils.js", [["an", [$h‍_a => (an = $h‍_a)]],["bestEffortStringify", [$h‍_a => (bestEffortStringify = $h‍_a)]]]],["./types.js", []],["./internal-types.js", []]]);
1249
+ // === functors[5] ===
1250
+ (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let RangeError,TypeError,WeakMap,arrayJoin,arrayMap,arrayPop,arrayPush,assign,freeze,globalThis,is,isError,stringIndexOf,stringReplace,stringSlice,stringStartsWith,weakmapDelete,weakmapGet,weakmapHas,weakmapSet,an,bestEffortStringify,makeNoteLogArgsArrayKit;$h‍_imports([["../commons.js", [["RangeError", [$h‍_a => (RangeError = $h‍_a)]],["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["WeakMap", [$h‍_a => (WeakMap = $h‍_a)]],["arrayJoin", [$h‍_a => (arrayJoin = $h‍_a)]],["arrayMap", [$h‍_a => (arrayMap = $h‍_a)]],["arrayPop", [$h‍_a => (arrayPop = $h‍_a)]],["arrayPush", [$h‍_a => (arrayPush = $h‍_a)]],["assign", [$h‍_a => (assign = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]],["globalThis", [$h‍_a => (globalThis = $h‍_a)]],["is", [$h‍_a => (is = $h‍_a)]],["isError", [$h‍_a => (isError = $h‍_a)]],["stringIndexOf", [$h‍_a => (stringIndexOf = $h‍_a)]],["stringReplace", [$h‍_a => (stringReplace = $h‍_a)]],["stringSlice", [$h‍_a => (stringSlice = $h‍_a)]],["stringStartsWith", [$h‍_a => (stringStartsWith = $h‍_a)]],["weakmapDelete", [$h‍_a => (weakmapDelete = $h‍_a)]],["weakmapGet", [$h‍_a => (weakmapGet = $h‍_a)]],["weakmapHas", [$h‍_a => (weakmapHas = $h‍_a)]],["weakmapSet", [$h‍_a => (weakmapSet = $h‍_a)]]]],["./stringify-utils.js", [["an", [$h‍_a => (an = $h‍_a)]],["bestEffortStringify", [$h‍_a => (bestEffortStringify = $h‍_a)]]]],["./types.js", []],["./internal-types.js", []],["./note-log-args.js", [["makeNoteLogArgsArrayKit", [$h‍_a => (makeNoteLogArgsArrayKit = $h‍_a)]]]]]);
1251
+
983
1252
 
984
1253
 
985
1254
 
@@ -1039,7 +1308,7 @@ freeze(quote);
1039
1308
  // /////////////////////////////////////////////////////////////////////////////
1040
1309
 
1041
1310
  /**
1042
- * @typedef {Object} HiddenDetails
1311
+ * @typedef {object} HiddenDetails
1043
1312
  *
1044
1313
  * Captures the arguments passed to the `details` template string tag.
1045
1314
  *
@@ -1232,17 +1501,7 @@ freeze(makeError);
1232
1501
 
1233
1502
  // /////////////////////////////////////////////////////////////////////////////
1234
1503
 
1235
- /**
1236
- * @type {WeakMap<Error, LogArgs[]>}
1237
- *
1238
- * Maps from an error to an array of log args, where each log args is
1239
- * remembered as an annotation on that error. This can be used, for example,
1240
- * to keep track of additional causes of the error. The elements of any
1241
- * log args may include errors which are associated with further annotations.
1242
- * An augmented console, like the causal console of `console.js`, could
1243
- * then retrieve the graph of such annotations.
1244
- */
1245
- const hiddenNoteLogArgsArrays= new WeakMap();
1504
+ const { addLogArgs, takeLogArgsArray}= makeNoteLogArgsArrayKit();
1246
1505
 
1247
1506
  /**
1248
1507
  * @type {WeakMap<Error, NoteCallback[]>}
@@ -1276,12 +1535,7 @@ const note= (error, detailsNote)=> {
1276
1535
  callback(error, logArgs);
1277
1536
  }
1278
1537
  }else {
1279
- const logArgsArray= weakmapGet(hiddenNoteLogArgsArrays, error);
1280
- if( logArgsArray!== undefined) {
1281
- arrayPush(logArgsArray, logArgs);
1282
- }else {
1283
- weakmapSet(hiddenNoteLogArgsArrays, error, [logArgs]);
1284
- }
1538
+ addLogArgs(error, logArgs);
1285
1539
  }
1286
1540
  };
1287
1541
  freeze(note);
@@ -1320,8 +1574,7 @@ const loggedErrorHandler= {
1320
1574
  return result;
1321
1575
  },
1322
1576
  takeNoteLogArgsArray: (error, callback)=> {
1323
- const result= weakmapGet(hiddenNoteLogArgsArrays, error);
1324
- weakmapDelete(hiddenNoteLogArgsArrays, error);
1577
+ const result= takeLogArgsArray(error);
1325
1578
  if( callback!== undefined) {
1326
1579
  const callbacks= weakmapGet(hiddenNoteCallbackArrays, error);
1327
1580
  if( callbacks) {
@@ -1343,9 +1596,11 @@ freeze(loggedErrorHandler);
1343
1596
  */
1344
1597
  const makeAssert= (optRaise= undefined, unredacted= false)=> {
1345
1598
  const details= unredacted? unredactedDetails: redactedDetails;
1599
+ const assertFailedDetails= details `Check failed`;
1600
+
1346
1601
  /** @type {AssertFail} */
1347
1602
  const fail= (
1348
- optDetails= details `Assert failed`,
1603
+ optDetails= assertFailedDetails,
1349
1604
  ErrorConstructor= globalThis.Error)=>
1350
1605
  {
1351
1606
  const reason= makeError(optDetails, ErrorConstructor);
@@ -1365,30 +1620,36 @@ const makeAssert= (optRaise= undefined, unredacted= false)=> {
1365
1620
  /** @type {BaseAssert} */
1366
1621
  function baseAssert(
1367
1622
  flag,
1368
- optDetails= details `Check failed`,
1369
- ErrorConstructor= globalThis.Error)
1623
+ optDetails= undefined,
1624
+ ErrorConstructor= undefined)
1370
1625
  {
1371
- if( !flag) {
1372
- throw fail(optDetails, ErrorConstructor);
1373
- }
1626
+ flag|| fail(optDetails, ErrorConstructor);
1374
1627
  }
1375
1628
 
1376
1629
  /** @type {AssertEqual} */
1377
1630
  const equal= (
1378
1631
  actual,
1379
1632
  expected,
1380
- optDetails= details `Expected ${actual} is same as ${expected}`,
1381
- ErrorConstructor= RangeError)=>
1633
+ optDetails= undefined,
1634
+ ErrorConstructor= undefined)=>
1382
1635
  {
1383
- baseAssert(is(actual, expected), optDetails, ErrorConstructor);
1636
+ is(actual, expected)||
1637
+ fail(
1638
+ optDetails|| details `Expected ${actual} is same as ${expected}`,
1639
+ ErrorConstructor|| RangeError);
1640
+
1384
1641
  };
1385
1642
  freeze(equal);
1386
1643
 
1387
1644
  /** @type {AssertTypeof} */
1388
1645
  const assertTypeof= (specimen, typename, optDetails)=> {
1389
- baseAssert(
1390
- typeof typename=== 'string',
1391
- details `${quote(typename)} must be a string`);
1646
+ // This will safely fall through if typename is not a string,
1647
+ // which is what we want.
1648
+ // eslint-disable-next-line valid-typeof
1649
+ if( typeof specimen=== typename) {
1650
+ return;
1651
+ }
1652
+ typeof typename=== 'string'|| Fail `${quote(typename)} must be a string`;
1392
1653
 
1393
1654
  if( optDetails=== undefined) {
1394
1655
  // Like
@@ -1399,12 +1660,12 @@ const makeAssert= (optRaise= undefined, unredacted= false)=> {
1399
1660
  // so it doesn't get quoted.
1400
1661
  optDetails= details(['', ` must be ${an(typename)}`],specimen);
1401
1662
  }
1402
- equal(typeof specimen, typename, optDetails, TypeError);
1663
+ fail(optDetails, TypeError);
1403
1664
  };
1404
1665
  freeze(assertTypeof);
1405
1666
 
1406
1667
  /** @type {AssertString} */
1407
- const assertString= (specimen, optDetails)=>
1668
+ const assertString= (specimen, optDetails= undefined)=>
1408
1669
  assertTypeof(specimen, 'string', optDetails);
1409
1670
 
1410
1671
  // Note that "assert === baseAssert"
@@ -1430,7 +1691,7 @@ freeze(makeAssert);
1430
1691
  const assert= makeAssert();$h‍_once.assert(assert);
1431
1692
  })
1432
1693
  ,
1433
- // === functors[5] ===
1694
+ // === functors[6] ===
1434
1695
  (({ 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)]]]]]);
1435
1696
 
1436
1697
 
@@ -1520,7 +1781,7 @@ const makeEvalScopeKit= ()=> {
1520
1781
  };$h‍_once.makeEvalScopeKit(makeEvalScopeKit);
1521
1782
  })
1522
1783
  ,
1523
- // === functors[6] ===
1784
+ // === functors[7] ===
1524
1785
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let arrayFilter,arrayIncludes,getOwnPropertyDescriptor,getOwnPropertyNames,objectHasOwnProperty,regexpTest;$h‍_imports([["./commons.js", [["arrayFilter", [$h‍_a => (arrayFilter = $h‍_a)]],["arrayIncludes", [$h‍_a => (arrayIncludes = $h‍_a)]],["getOwnPropertyDescriptor", [$h‍_a => (getOwnPropertyDescriptor = $h‍_a)]],["getOwnPropertyNames", [$h‍_a => (getOwnPropertyNames = $h‍_a)]],["objectHasOwnProperty", [$h‍_a => (objectHasOwnProperty = $h‍_a)]],["regexpTest", [$h‍_a => (regexpTest = $h‍_a)]]]]]);
1525
1786
 
1526
1787
 
@@ -1666,8 +1927,8 @@ function isImmutableDataProperty(obj, name) {
1666
1927
  * service if any of the names are keywords or keyword-like. This is
1667
1928
  * safe and only prevent performance optimization.
1668
1929
  *
1669
- * @param {Object} globalObject
1670
- * @param {Object} moduleLexicals
1930
+ * @param {object} globalObject
1931
+ * @param {object} moduleLexicals
1671
1932
  */
1672
1933
  const getScopeConstants= (globalObject, moduleLexicals= {})=> {
1673
1934
  // getOwnPropertyNames() does ignore Symbols so we don't need to
@@ -1702,7 +1963,7 @@ const getScopeConstants= (globalObject, moduleLexicals= {})=> {
1702
1963
  };$h‍_once.getScopeConstants(getScopeConstants);
1703
1964
  })
1704
1965
  ,
1705
- // === functors[7] ===
1966
+ // === functors[8] ===
1706
1967
  (({ 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)]]]]]);
1707
1968
 
1708
1969
 
@@ -1815,7 +2076,7 @@ const makeEvaluate= (context)=>{
1815
2076
  };$h‍_once.makeEvaluate(makeEvaluate);
1816
2077
  })
1817
2078
  ,
1818
- // === functors[8] ===
2079
+ // === functors[9] ===
1819
2080
  (({ 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)]]]]]);
1820
2081
 
1821
2082
 
@@ -1875,9 +2136,8 @@ const scopeProxyHandlerProperties= {
1875
2136
  return null;
1876
2137
  },
1877
2138
 
1878
- // Chip has seen this happen single stepping under the Chrome/v8 debugger.
1879
- // TODO record how to reliably reproduce, and to test if this fix helps.
1880
- // TODO report as bug to v8 or Chrome, and record issue link here.
2139
+ // See https://github.com/endojs/endo/issues/1510
2140
+ // TODO: report as bug to v8 or Chrome, and record issue link here.
1881
2141
  getOwnPropertyDescriptor(_target, prop) {
1882
2142
  // Coerce with `String` in case prop is a symbol.
1883
2143
  const quotedProp= q(String(prop));
@@ -1905,7 +2165,7 @@ const strictScopeTerminator= new Proxy(
1905
2165
  strictScopeTerminatorHandler);$h‍_once.strictScopeTerminator(strictScopeTerminator);
1906
2166
  })
1907
2167
  ,
1908
- // === functors[9] ===
2168
+ // === functors[10] ===
1909
2169
  (({ 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)]]]]]);
1910
2170
 
1911
2171
 
@@ -1959,9 +2219,10 @@ const createSloppyGlobalsScopeTerminator= (globalObject)=>{
1959
2219
 
1960
2220
  return sloppyGlobalsScopeTerminator;
1961
2221
  };$h‍_once.createSloppyGlobalsScopeTerminator(createSloppyGlobalsScopeTerminator);
2222
+ freeze(createSloppyGlobalsScopeTerminator);
1962
2223
  })
1963
2224
  ,
1964
- // === functors[10] ===
2225
+ // === functors[11] ===
1965
2226
  (({ 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)]]]]]);
1966
2227
 
1967
2228
  // Captures a key and value of the form #key=value or @key=value
@@ -1977,6 +2238,9 @@ const sourceMetaEntriesRegExp= new FERAL_REG_EXP(
1977
2238
  `(?:\\s*//${sourceMetaEntryRegExp}|/\\*${sourceMetaEntryRegExp}\\s*\\*/)\\s*$`);
1978
2239
 
1979
2240
 
2241
+ /**
2242
+ * @param {string} src
2243
+ */
1980
2244
  const getSourceURL= (src)=>{
1981
2245
  let sourceURL= '<unknown>';
1982
2246
 
@@ -2011,8 +2275,9 @@ const getSourceURL= (src)=>{
2011
2275
  };$h‍_once.getSourceURL(getSourceURL);
2012
2276
  })
2013
2277
  ,
2014
- // === functors[11] ===
2015
- (({ 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)]]]]]);
2278
+ // === functors[12] ===
2279
+ (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_REG_EXP,SyntaxError,stringReplace,stringSearch,stringSlice,stringSplit,freeze,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)]],["freeze", [$h‍_a => (freeze = $h‍_a)]]]],["./get-source-url.js", [["getSourceURL", [$h‍_a => (getSourceURL = $h‍_a)]]]]]);
2280
+
2016
2281
 
2017
2282
 
2018
2283
 
@@ -2083,6 +2348,7 @@ const rejectHtmlComments= (src)=>{
2083
2348
  return src;
2084
2349
  }
2085
2350
  const name= getSourceURL(src);
2351
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_HTML_COMMENT_REJECTED.md
2086
2352
  throw new SyntaxError(
2087
2353
  `Possible HTML comment rejected at ${name}:${lineNumber}. (SES_HTML_COMMENT_REJECTED)`);
2088
2354
 
@@ -2158,6 +2424,7 @@ const rejectImportExpressions= (src)=>{
2158
2424
  return src;
2159
2425
  }
2160
2426
  const name= getSourceURL(src);
2427
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_IMPORT_REJECTED.md
2161
2428
  throw new SyntaxError(
2162
2429
  `Possible import expression rejected at ${name}:${lineNumber}. (SES_IMPORT_REJECTED)`);
2163
2430
 
@@ -2229,6 +2496,7 @@ const rejectSomeDirectEvalExpressions= (src)=>{
2229
2496
  return src;
2230
2497
  }
2231
2498
  const name= getSourceURL(src);
2499
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_EVAL_REJECTED.md
2232
2500
  throw new SyntaxError(
2233
2501
  `Possible direct eval expression rejected at ${name}:${lineNumber}. (SES_EVAL_REJECTED)`);
2234
2502
 
@@ -2262,10 +2530,20 @@ const applyTransforms= (source, transforms)=> {
2262
2530
  source= transform(source);
2263
2531
  }
2264
2532
  return source;
2265
- };$h‍_once.applyTransforms(applyTransforms);
2533
+ };
2534
+
2535
+ // export all as a frozen object
2536
+ $h‍_once.applyTransforms(applyTransforms);const transforms=freeze({
2537
+ rejectHtmlComments: freeze(rejectHtmlComments),
2538
+ evadeHtmlCommentTest: freeze(evadeHtmlCommentTest),
2539
+ rejectImportExpressions: freeze(rejectImportExpressions),
2540
+ evadeImportExpressionTest: freeze(evadeImportExpressionTest),
2541
+ rejectSomeDirectEvalExpressions: freeze(rejectSomeDirectEvalExpressions),
2542
+ mandatoryTransforms: freeze(mandatoryTransforms),
2543
+ applyTransforms: freeze(applyTransforms)});$h‍_once.transforms(transforms);
2266
2544
  })
2267
2545
  ,
2268
- // === functors[12] ===
2546
+ // === functors[13] ===
2269
2547
  (({ 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)]]]]]);
2270
2548
 
2271
2549
 
@@ -2284,9 +2562,9 @@ const { Fail}= assert;
2284
2562
  * Build the low-level operation used by all evaluators:
2285
2563
  * eval(), Function(), Compartment.prototype.evaluate().
2286
2564
  *
2287
- * @param {Object} options
2288
- * @param {Object} options.globalObject
2289
- * @param {Object} [options.moduleLexicals]
2565
+ * @param {object} options
2566
+ * @param {object} options.globalObject
2567
+ * @param {object} [options.moduleLexicals]
2290
2568
  * @param {Array<Transform>} [options.globalTransforms]
2291
2569
  * @param {bool} [options.sloppyGlobalsMode]
2292
2570
  */
@@ -2321,7 +2599,7 @@ const makeSafeEvaluator= ({
2321
2599
 
2322
2600
  /**
2323
2601
  * @param {string} source
2324
- * @param {Object} [options]
2602
+ * @param {object} [options]
2325
2603
  * @param {Array<Transform>} [options.localTransforms]
2326
2604
  */
2327
2605
  const safeEvaluate= (source, { localTransforms= []}= {})=> {
@@ -2377,7 +2655,7 @@ const makeSafeEvaluator= ({
2377
2655
  };$h‍_once.makeSafeEvaluator(makeSafeEvaluator);
2378
2656
  })
2379
2657
  ,
2380
- // === functors[13] ===
2658
+ // === functors[14] ===
2381
2659
  (({ 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)]]]]]);
2382
2660
 
2383
2661
 
@@ -2473,7 +2751,7 @@ const compartmentEvaluate= (compartmentFields, source, options)=> {
2473
2751
  };$h‍_once.compartmentEvaluate(compartmentEvaluate);
2474
2752
  })
2475
2753
  ,
2476
- // === functors[14] ===
2754
+ // === functors[15] ===
2477
2755
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { $h‍_imports([]); /**
2478
2756
  * makeEvalFunction()
2479
2757
  * A safe version of the native eval function which relies on
@@ -2503,7 +2781,7 @@ const makeEvalFunction= (safeEvaluate)=>{
2503
2781
  };$h‍_once.makeEvalFunction(makeEvalFunction);
2504
2782
  })
2505
2783
  ,
2506
- // === functors[15] ===
2784
+ // === functors[16] ===
2507
2785
  (({ 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)]]]]]);
2508
2786
 
2509
2787
 
@@ -2584,7 +2862,7 @@ const makeFunctionConstructor= (safeEvaluate)=>{
2584
2862
  };$h‍_once.makeFunctionConstructor(makeFunctionConstructor);
2585
2863
  })
2586
2864
  ,
2587
- // === functors[16] ===
2865
+ // === functors[17] ===
2588
2866
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { $h‍_imports([]); /* eslint-disable no-restricted-globals */
2589
2867
  /**
2590
2868
  * @file Exports {@code whitelist}, a recursively defined
@@ -3808,6 +4086,10 @@ const whitelist= {
3808
4086
  '[[Proto]]': '%FunctionPrototype%',
3809
4087
  constructor: '%InertAsyncGeneratorFunction%',
3810
4088
  prototype: '%AsyncGeneratorPrototype%',
4089
+ // length prop added here for React Native jsc-android
4090
+ // https://github.com/endojs/endo/issues/660
4091
+ // https://github.com/react-native-community/jsc-android-buildscripts/issues/181
4092
+ length: 'number',
3811
4093
  '@@toStringTag': 'string'},
3812
4094
 
3813
4095
 
@@ -3890,6 +4172,10 @@ const whitelist= {
3890
4172
  // Properties of the AsyncFunction Prototype Object
3891
4173
  '[[Proto]]': '%FunctionPrototype%',
3892
4174
  constructor: '%InertAsyncFunction%',
4175
+ // length prop added here for React Native jsc-android
4176
+ // https://github.com/endojs/endo/issues/660
4177
+ // https://github.com/react-native-community/jsc-android-buildscripts/issues/181
4178
+ length: 'number',
3893
4179
  '@@toStringTag': 'string'},
3894
4180
 
3895
4181
 
@@ -3955,12 +4241,12 @@ const whitelist= {
3955
4241
 
3956
4242
 
3957
4243
  lockdown: fn,
3958
- harden: fn,
4244
+ harden: { ...fn, isFake: 'boolean'},
3959
4245
 
3960
4246
  '%InitialGetStackString%': fn};$h‍_once.whitelist(whitelist);
3961
4247
  })
3962
4248
  ,
3963
- // === functors[17] ===
4249
+ // === functors[18] ===
3964
4250
  (({ 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)]]]]]);
3965
4251
 
3966
4252
 
@@ -3985,7 +4271,7 @@ const whitelist= {
3985
4271
  * But, we can install this setter to prevent a program from proceding on
3986
4272
  * this false assumption.
3987
4273
  *
3988
- * @param {Object} globalObject
4274
+ * @param {object} globalObject
3989
4275
  */
3990
4276
  const setGlobalObjectSymbolUnscopables= (globalObject)=>{
3991
4277
  defineProperty(
@@ -4011,7 +4297,7 @@ const setGlobalObjectSymbolUnscopables= (globalObject)=>{
4011
4297
  * (SetDefaultGlobalBindings). This process is split between this function and
4012
4298
  * `setGlobalObjectMutableProperties`.
4013
4299
  *
4014
- * @param {Object} globalObject
4300
+ * @param {object} globalObject
4015
4301
  */$h‍_once.setGlobalObjectSymbolUnscopables(setGlobalObjectSymbolUnscopables);
4016
4302
  const setGlobalObjectConstantProperties= (globalObject)=>{
4017
4303
  for( const [name, constant]of entries(constantProperties)) {
@@ -4031,12 +4317,12 @@ const setGlobalObjectConstantProperties= (globalObject)=>{
4031
4317
  * `newGlobalPropertyNames` should be either `initialGlobalPropertyNames` or
4032
4318
  * `sharedGlobalPropertyNames`.
4033
4319
  *
4034
- * @param {Object} globalObject
4035
- * @param {Object} param1
4036
- * @param {Object} param1.intrinsics
4037
- * @param {Object} param1.newGlobalPropertyNames
4320
+ * @param {object} globalObject
4321
+ * @param {object} param1
4322
+ * @param {object} param1.intrinsics
4323
+ * @param {object} param1.newGlobalPropertyNames
4038
4324
  * @param {Function} param1.makeCompartmentConstructor
4039
- * @param {(Object) => void} param1.markVirtualizedNativeFunction
4325
+ * @param {(object) => void} param1.markVirtualizedNativeFunction
4040
4326
  */$h‍_once.setGlobalObjectConstantProperties(setGlobalObjectConstantProperties);
4041
4327
  const setGlobalObjectMutableProperties= (
4042
4328
  globalObject,
@@ -4098,9 +4384,9 @@ const setGlobalObjectMutableProperties= (
4098
4384
  * setGlobalObjectEvaluators()
4099
4385
  * Set the eval and the Function evaluator on the global object with given evalTaming policy.
4100
4386
  *
4101
- * @param {Object} globalObject
4387
+ * @param {object} globalObject
4102
4388
  * @param {Function} evaluator
4103
- * @param {(Object) => void} markVirtualizedNativeFunction
4389
+ * @param {(object) => void} markVirtualizedNativeFunction
4104
4390
  */$h‍_once.setGlobalObjectMutableProperties(setGlobalObjectMutableProperties);
4105
4391
  const setGlobalObjectEvaluators= (
4106
4392
  globalObject,
@@ -4130,7 +4416,7 @@ const setGlobalObjectEvaluators= (
4130
4416
  };$h‍_once.setGlobalObjectEvaluators(setGlobalObjectEvaluators);
4131
4417
  })
4132
4418
  ,
4133
- // === functors[18] ===
4419
+ // === functors[19] ===
4134
4420
  (({ 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)]]]]]);
4135
4421
 
4136
4422
 
@@ -4452,7 +4738,7 @@ const load= async(
4452
4738
 
4453
4739
  /** @type {Set<Promise<undefined>>} */
4454
4740
  const pendingJobs= new Set();
4455
- /** @type {Map<Object, Map<string, Promise<Record>>} */
4741
+ /** @type {Map<object, Map<string, Promise<Record>>} */
4456
4742
  const moduleLoads= new Map();
4457
4743
  /** @type {Array<Error>} */
4458
4744
  const errors= [];
@@ -4496,7 +4782,7 @@ const load= async(
4496
4782
  };$h‍_once.load(load);
4497
4783
  })
4498
4784
  ,
4499
- // === functors[19] ===
4785
+ // === functors[20] ===
4500
4786
  (({ 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)]]]]]);
4501
4787
 
4502
4788
 
@@ -4671,7 +4957,7 @@ $h‍_once.deferExports(deferExports);const getDeferredExports=(
4671
4957
  };$h‍_once.getDeferredExports(getDeferredExports);
4672
4958
  })
4673
4959
  ,
4674
- // === functors[20] ===
4960
+ // === functors[21] ===
4675
4961
  (({ 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)]]]]]);
4676
4962
 
4677
4963
 
@@ -4809,7 +5095,8 @@ $h‍_once.makeThirdPartyModuleInstance(makeThirdPartyModuleInstance);const make
4809
5095
  __fixedExportMap__: fixedExportMap= {},
4810
5096
  __liveExportMap__: liveExportMap= {},
4811
5097
  __reexportMap__: reexportMap= {},
4812
- __needsImportMeta__: needsImportMeta= false}=
5098
+ __needsImportMeta__: needsImportMeta= false,
5099
+ __syncModuleFunctor__}=
4813
5100
  staticModuleRecord;
4814
5101
 
4815
5102
  const compartmentFields= weakmapGet(privateFields, compartment);
@@ -5118,11 +5405,16 @@ $h‍_once.makeThirdPartyModuleInstance(makeThirdPartyModuleInstance);const make
5118
5405
  activate();
5119
5406
  }
5120
5407
 
5121
- let optFunctor= compartmentEvaluate(compartmentFields, functorSource, {
5122
- globalObject: compartment.globalThis,
5123
- transforms: __shimTransforms__,
5124
- __moduleShimLexicals__: moduleLexicals});
5408
+ let optFunctor;
5409
+ if( __syncModuleFunctor__!== undefined) {
5410
+ optFunctor= __syncModuleFunctor__;
5411
+ }else {
5412
+ optFunctor= compartmentEvaluate(compartmentFields, functorSource, {
5413
+ globalObject: compartment.globalThis,
5414
+ transforms: __shimTransforms__,
5415
+ __moduleShimLexicals__: moduleLexicals});
5125
5416
 
5417
+ }
5126
5418
  let didThrow= false;
5127
5419
  let thrownError;
5128
5420
  function execute() {
@@ -5159,7 +5451,7 @@ $h‍_once.makeThirdPartyModuleInstance(makeThirdPartyModuleInstance);const make
5159
5451
  };$h‍_once.makeModuleInstance(makeModuleInstance);
5160
5452
  })
5161
5453
  ,
5162
- // === functors[21] ===
5454
+ // === functors[22] ===
5163
5455
  (({ 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)]]]]]);
5164
5456
 
5165
5457
 
@@ -5339,7 +5631,7 @@ const instantiate= (
5339
5631
  };$h‍_once.instantiate(instantiate);
5340
5632
  })
5341
5633
  ,
5342
- // === functors[22] ===
5634
+ // === functors[23] ===
5343
5635
  (({ 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)]]]]]);
5344
5636
 
5345
5637
 
@@ -5438,10 +5730,10 @@ const CompartmentPrototype= {
5438
5730
 
5439
5731
  /**
5440
5732
  * @param {string} source is a JavaScript program grammar construction.
5441
- * @param {Object} [options]
5733
+ * @param {object} [options]
5442
5734
  * @param {Array<Transform>} [options.transforms]
5443
5735
  * @param {boolean} [options.sloppyGlobalsMode]
5444
- * @param {Object} [options.__moduleShimLexicals__]
5736
+ * @param {object} [options.__moduleShimLexicals__]
5445
5737
  * @param {boolean} [options.__evadeHtmlCommentTest__]
5446
5738
  * @param {boolean} [options.__evadeImportExpressionTest__]
5447
5739
  * @param {boolean} [options.__rejectSomeDirectEvalExpressions__]
@@ -5522,7 +5814,7 @@ defineProperties(InertCompartment, {
5522
5814
  * @callback MakeCompartmentConstructor
5523
5815
  * @param {MakeCompartmentConstructor} targetMakeCompartmentConstructor
5524
5816
  * @param {Record<string, any>} intrinsics
5525
- * @param {(object: Object) => void} markVirtualizedNativeFunction
5817
+ * @param {(object: object) => void} markVirtualizedNativeFunction
5526
5818
  * @returns {Compartment['constructor']}
5527
5819
  */
5528
5820
 
@@ -5638,7 +5930,7 @@ const makeCompartmentConstructor= (
5638
5930
  };$h‍_once.makeCompartmentConstructor(makeCompartmentConstructor);
5639
5931
  })
5640
5932
  ,
5641
- // === functors[23] ===
5933
+ // === functors[24] ===
5642
5934
  (({ 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)]]]]]);
5643
5935
 
5644
5936
 
@@ -5801,7 +6093,7 @@ const makeIntrinsicsCollector= ()=> {
5801
6093
  * If run before lockdown, the returned intrinsics record will carry the
5802
6094
  * *original* unsafe (feral, untamed) bindings of these global variables.
5803
6095
  *
5804
- * @param {Object} globalObject
6096
+ * @param {object} globalObject
5805
6097
  */$h‍_once.makeIntrinsicsCollector(makeIntrinsicsCollector);
5806
6098
  const getGlobalIntrinsics= (globalObject)=>{
5807
6099
  const { addIntrinsics, finalIntrinsics}= makeIntrinsicsCollector();
@@ -5812,7 +6104,7 @@ const getGlobalIntrinsics= (globalObject)=>{
5812
6104
  };$h‍_once.getGlobalIntrinsics(getGlobalIntrinsics);
5813
6105
  })
5814
6106
  ,
5815
- // === functors[24] ===
6107
+ // === functors[25] ===
5816
6108
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { $h‍_imports([]); /**
5817
6109
  * @file Exports {@code enablements}, a recursively defined
5818
6110
  * JSON record defining the optimum set of intrinsics properties
@@ -5856,7 +6148,7 @@ const getGlobalIntrinsics= (globalObject)=>{
5856
6148
  * <ul>
5857
6149
  * <li>true, in which case this property is simply repaired. The
5858
6150
  * value associated with that property is not traversed. For
5859
- * example, {@code "Function.prototype.name"} leads to true,
6151
+ * example, {@code "Function.prototype.name"} leads to true,
5860
6152
  * meaning that the {@code "name"} property of {@code
5861
6153
  * "Function.prototype"} should be repaired (which is needed
5862
6154
  * when inheriting from @code{Function} and setting the subclass's
@@ -6020,10 +6312,22 @@ const severeEnablements= {
6020
6312
  * include enough of the `TypeArray` methods that here, the `severe`
6021
6313
  * enablements just enable them all.
6022
6314
  */
6023
- '%TypedArrayPrototype%': '*'};$h‍_once.severeEnablements(severeEnablements);
6315
+ '%TypedArrayPrototype%': '*',
6316
+
6317
+ /**
6318
+ * Needed to work with Immer before https://github.com/immerjs/immer/pull/914
6319
+ * is accepted.
6320
+ */
6321
+ '%MapPrototype%': '*',
6322
+
6323
+ /**
6324
+ * Needed to work with Immer before https://github.com/immerjs/immer/pull/914
6325
+ * is accepted.
6326
+ */
6327
+ '%SetPrototype%': '*'};$h‍_once.severeEnablements(severeEnablements);
6024
6328
  })
6025
6329
  ,
6026
- // === functors[25] ===
6330
+ // === functors[26] ===
6027
6331
  (({ 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)]]]]]);
6028
6332
 
6029
6333
 
@@ -6230,7 +6534,7 @@ function enablePropertyOverrides(
6230
6534
  }$h‍_once.default( enablePropertyOverrides);
6231
6535
  })
6232
6536
  ,
6233
- // === functors[26] ===
6537
+ // === functors[27] ===
6234
6538
  (({ 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)]]]]]);
6235
6539
 
6236
6540
 
@@ -6238,7 +6542,7 @@ function enablePropertyOverrides(
6238
6542
 
6239
6543
 
6240
6544
 
6241
- const { details: X, Fail, quote: q}= assert;
6545
+ const { Fail, quote: q}= assert;
6242
6546
 
6243
6547
  /**
6244
6548
  * JavaScript module semantics resists attempts to parameterize a module's
@@ -6288,7 +6592,7 @@ const { details: X, Fail, quote: q}= assert;
6288
6592
  * variables, if they are needed, and a way to catalog the names of all
6289
6593
  * the environment variables that were captured.
6290
6594
  *
6291
- * @param {Object} aGlobal
6595
+ * @param {object} aGlobal
6292
6596
  */
6293
6597
  const makeEnvironmentCaptor= (aGlobal)=>{
6294
6598
  const capturedEnvironmentOptionNames= [];
@@ -6303,19 +6607,13 @@ const makeEnvironmentCaptor= (aGlobal)=>{
6303
6607
  */
6304
6608
  const getEnvironmentOption= (optionName, defaultSetting)=> {
6305
6609
  // eslint-disable-next-line @endo/no-polymorphic-call
6306
- assert.typeof(
6307
- optionName,
6308
- 'string',
6309
- X `Environment option name ${q(optionName)} must be a string.`);
6310
-
6610
+ typeof optionName=== 'string'||
6611
+ Fail `Environment option name ${q(optionName)} must be a string.`;
6311
6612
  // eslint-disable-next-line @endo/no-polymorphic-call
6312
- assert.typeof(
6313
- defaultSetting,
6314
- 'string',
6315
- X `Environment option default setting ${q(
6613
+ typeof defaultSetting=== 'string'||
6614
+ Fail `Environment option default setting ${q(
6316
6615
  defaultSetting)
6317
- } must be a string.`);
6318
-
6616
+ } must be a string.`;
6319
6617
 
6320
6618
  /** @type {string} */
6321
6619
  let setting= defaultSetting;
@@ -6327,15 +6625,12 @@ const makeEnvironmentCaptor= (aGlobal)=>{
6327
6625
  arrayPush(capturedEnvironmentOptionNames, optionName);
6328
6626
  const optionValue= globalEnv[optionName];
6329
6627
  // eslint-disable-next-line @endo/no-polymorphic-call
6330
- assert.typeof(
6331
- optionValue,
6332
- 'string',
6333
- X `Environment option named ${q(
6628
+ typeof optionValue=== 'string'||
6629
+ Fail `Environment option named ${q(
6334
6630
  optionName)
6335
6631
  }, if present, must have a corresponding string value, got ${q(
6336
6632
  optionValue)
6337
- }`);
6338
-
6633
+ }`;
6339
6634
  setting= optionValue;
6340
6635
  }
6341
6636
  }
@@ -6359,7 +6654,7 @@ const makeEnvironmentCaptor= (aGlobal)=>{
6359
6654
  freeze(makeEnvironmentCaptor);
6360
6655
  })
6361
6656
  ,
6362
- // === functors[27] ===
6657
+ // === functors[28] ===
6363
6658
  (({ 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", []]]);
6364
6659
 
6365
6660
 
@@ -6741,7 +7036,7 @@ const filterConsole= (baseConsole, filter, _topic= undefined)=> {
6741
7036
  freeze(filterConsole);
6742
7037
  })
6743
7038
  ,
6744
- // === functors[28] ===
7039
+ // === functors[29] ===
6745
7040
  (({ 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)]]]]]);
6746
7041
 
6747
7042
 
@@ -6866,7 +7161,7 @@ const makeRejectionHandlers= (reportReason)=>{
6866
7161
  };$h‍_once.makeRejectionHandlers(makeRejectionHandlers);
6867
7162
  })
6868
7163
  ,
6869
- // === functors[29] ===
7164
+ // === functors[30] ===
6870
7165
  (({ 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", []]]);
6871
7166
 
6872
7167
 
@@ -7009,7 +7304,7 @@ const tameConsole= (
7009
7304
  };$h‍_once.tameConsole(tameConsole);
7010
7305
  })
7011
7306
  ,
7012
- // === functors[30] ===
7307
+ // === functors[31] ===
7013
7308
  (({ 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)]]]]]);
7014
7309
 
7015
7310
 
@@ -7349,7 +7644,7 @@ const tameV8ErrorConstructor= (
7349
7644
  };$h‍_once.tameV8ErrorConstructor(tameV8ErrorConstructor);
7350
7645
  })
7351
7646
  ,
7352
- // === functors[31] ===
7647
+ // === functors[32] ===
7353
7648
  (({ 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)]]]]]);
7354
7649
 
7355
7650
 
@@ -7603,7 +7898,7 @@ function tameErrorConstructor(
7603
7898
  }$h‍_once.default( tameErrorConstructor);
7604
7899
  })
7605
7900
  ,
7606
- // === functors[32] ===
7901
+ // === functors[33] ===
7607
7902
  (({ 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)]]]]]);
7608
7903
 
7609
7904
 
@@ -7626,7 +7921,7 @@ function tameErrorConstructor(
7626
7921
  * Object.getConstructorOf()
7627
7922
  * Helper function to improve readability, similar to Object.getPrototypeOf().
7628
7923
  *
7629
- * @param {Object} obj
7924
+ * @param {object} obj
7630
7925
  */
7631
7926
  function getConstructorOf(obj) {
7632
7927
  return getPrototypeOf(obj).constructor;
@@ -7644,7 +7939,7 @@ function makeArguments() {
7644
7939
  * Get the intrinsics not otherwise reachable by named own property
7645
7940
  * traversal from the global object.
7646
7941
  *
7647
- * @returns {Object}
7942
+ * @returns {object}
7648
7943
  */
7649
7944
  const getAnonymousIntrinsics= ()=> {
7650
7945
  const InertFunction= FERAL_FUNCTION.prototype.constructor;
@@ -7746,7 +8041,7 @@ const getAnonymousIntrinsics= ()=> {
7746
8041
  };$h‍_once.getAnonymousIntrinsics(getAnonymousIntrinsics);
7747
8042
  })
7748
8043
  ,
7749
- // === functors[33] ===
8044
+ // === functors[34] ===
7750
8045
  (({ 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)]]]]]);
7751
8046
 
7752
8047
 
@@ -7801,7 +8096,7 @@ const getAnonymousIntrinsics= ()=> {
7801
8096
 
7802
8097
 
7803
8098
  /**
7804
- * @typedef {import('../index.js').Harden} Harden
8099
+ * @typedef {import('../types.js').Harden} Harden
7805
8100
  */
7806
8101
 
7807
8102
  // Obtain the string tag accessor of of TypedArray so we can indirectly use the
@@ -7989,7 +8284,7 @@ const makeHardener= ()=> {
7989
8284
  };$h‍_once.makeHardener(makeHardener);
7990
8285
  })
7991
8286
  ,
7992
- // === functors[34] ===
8287
+ // === functors[35] ===
7993
8288
  (({ 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)]]]]]);
7994
8289
 
7995
8290
 
@@ -8106,7 +8401,7 @@ function tameDateConstructor(dateTaming= 'safe') {
8106
8401
  }$h‍_once.default( tameDateConstructor);
8107
8402
  })
8108
8403
  ,
8109
- // === functors[35] ===
8404
+ // === functors[36] ===
8110
8405
  (({ 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);
8111
8406
 
8112
8407
 
@@ -8135,6 +8430,7 @@ function tameDomains(domainTaming= 'safe') {
8135
8430
  if( domainDescriptor!== undefined&& domainDescriptor.get!== undefined) {
8136
8431
  // The domain descriptor on Node.js initially has value: null, which
8137
8432
  // becomes a get, set pair after domains initialize.
8433
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_NO_DOMAINS.md
8138
8434
  throw new TypeError(
8139
8435
  `SES failed to lockdown, Node.js domains have been initialized (SES_NO_DOMAINS)`);
8140
8436
 
@@ -8155,7 +8451,7 @@ function tameDomains(domainTaming= 'safe') {
8155
8451
  }
8156
8452
  })
8157
8453
  ,
8158
- // === functors[36] ===
8454
+ // === functors[37] ===
8159
8455
  (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let FERAL_FUNCTION,SyntaxError,TypeError,defineProperties,getPrototypeOf,setPrototypeOf,freeze;$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)]],["freeze", [$h‍_a => (freeze = $h‍_a)]]]]]);
8160
8456
 
8161
8457
 
@@ -8294,7 +8590,7 @@ function tameFunctionConstructors() {
8294
8590
  }$h‍_once.default( tameFunctionConstructors);
8295
8591
  })
8296
8592
  ,
8297
- // === functors[37] ===
8593
+ // === functors[38] ===
8298
8594
  (({ 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)]]]]]);
8299
8595
 
8300
8596
 
@@ -8347,7 +8643,33 @@ const tameFunctionToString= ()=> {
8347
8643
  };$h‍_once.tameFunctionToString(tameFunctionToString);
8348
8644
  })
8349
8645
  ,
8350
- // === functors[38] ===
8646
+ // === functors[39] ===
8647
+ (({ imports: $h‍_imports, liveVar: $h‍_live, onceVar: $h‍_once, importMeta: $h‍____meta, }) => { let TypeError,freeze;$h‍_imports([["./commons.js", [["TypeError", [$h‍_a => (TypeError = $h‍_a)]],["freeze", [$h‍_a => (freeze = $h‍_a)]]]]]);
8648
+
8649
+
8650
+ const tameHarden= (safeHarden, hardenTaming)=> {
8651
+ if( hardenTaming!== 'safe'&& hardenTaming!== 'unsafe') {
8652
+ throw new TypeError( `unrecognized fakeHardenOption ${hardenTaming}`);
8653
+ }
8654
+
8655
+ if( hardenTaming=== 'safe') {
8656
+ return safeHarden;
8657
+ }
8658
+
8659
+ // In on the joke
8660
+ Object.isExtensible= ()=> false;
8661
+ Object.isFrozen= ()=> true;
8662
+ Object.isSealed= ()=> true;
8663
+ Reflect.isExtensible= ()=> false;
8664
+
8665
+ const fakeHarden= (arg)=>arg;
8666
+ fakeHarden.isFake= true;
8667
+ return freeze(fakeHarden);
8668
+ };$h‍_once.tameHarden(tameHarden);
8669
+ freeze(tameHarden);
8670
+ })
8671
+ ,
8672
+ // === functors[40] ===
8351
8673
  (({ 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)]]]]]);
8352
8674
 
8353
8675
 
@@ -8367,14 +8689,14 @@ const localePattern= /^(\w*[a-z])Locale([A-Z]\w*)$/;
8367
8689
  // behavior or `.prototype` property.
8368
8690
  const tamedMethods= {
8369
8691
  // See https://tc39.es/ecma262/#sec-string.prototype.localecompare
8370
- localeCompare(that) {
8692
+ localeCompare(arg) {
8371
8693
  if( this=== null|| this=== undefined) {
8372
8694
  throw new TypeError(
8373
8695
  'Cannot localeCompare with null or undefined "this" value');
8374
8696
 
8375
8697
  }
8376
8698
  const s= `${this}`;
8377
- that= `${that}`;
8699
+ const that= `${arg}`;
8378
8700
  if( s< that) {
8379
8701
  return -1;
8380
8702
  }
@@ -8431,7 +8753,7 @@ function tameLocaleMethods(intrinsics, localeTaming= 'safe') {
8431
8753
  }$h‍_once.default( tameLocaleMethods);
8432
8754
  })
8433
8755
  ,
8434
- // === functors[39] ===
8756
+ // === functors[41] ===
8435
8757
  (({ 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)]]]]]);
8436
8758
 
8437
8759
 
@@ -8459,7 +8781,7 @@ function tameMathObject(mathTaming= 'safe') {
8459
8781
  }$h‍_once.default( tameMathObject);
8460
8782
  })
8461
8783
  ,
8462
- // === functors[40] ===
8784
+ // === functors[42] ===
8463
8785
  (({ 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)]]]]]);
8464
8786
 
8465
8787
 
@@ -8514,7 +8836,7 @@ function tameRegExpConstructor(regExpTaming= 'safe') {
8514
8836
  }$h‍_once.default( tameRegExpConstructor);
8515
8837
  })
8516
8838
  ,
8517
- // === functors[41] ===
8839
+ // === functors[43] ===
8518
8840
  (({ 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)]]]]]);
8519
8841
 
8520
8842
 
@@ -8583,8 +8905,8 @@ function tameRegExpConstructor(regExpTaming= 'safe') {
8583
8905
  * Removes all non-allowed properties found by recursively and
8584
8906
  * reflectively walking own property chains.
8585
8907
  *
8586
- * @param {Object} intrinsics
8587
- * @param {(Object) => void} markVirtualizedNativeFunction
8908
+ * @param {object} intrinsics
8909
+ * @param {(object) => void} markVirtualizedNativeFunction
8588
8910
  */
8589
8911
  function whitelistIntrinsics(
8590
8912
  intrinsics,
@@ -8829,8 +9151,8 @@ function whitelistIntrinsics(
8829
9151
  }$h‍_once.default( whitelistIntrinsics);
8830
9152
  })
8831
9153
  ,
8832
- // === functors[42] ===
8833
- (({ 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)]]]]]);
9154
+ // === functors[44] ===
9155
+ (({ 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,tameHarden;$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)]]]],["./tame-harden.js", [["tameHarden", [$h‍_a => (tameHarden = $h‍_a)]]]]]);
8834
9156
 
8835
9157
 
8836
9158
 
@@ -8885,7 +9207,8 @@ function whitelistIntrinsics(
8885
9207
 
8886
9208
 
8887
9209
 
8888
- /** @typedef {import('../index.js').LockdownOptions} LockdownOptions */
9210
+
9211
+ /** @typedef {import('../types.js').LockdownOptions} LockdownOptions */
8889
9212
 
8890
9213
  const { Fail, details: d, quote: q}= assert;
8891
9214
 
@@ -8899,7 +9222,7 @@ let priorLockdown;
8899
9222
  * @param {T} ref
8900
9223
  * @returns {T}
8901
9224
  */
8902
- const harden= makeHardener();
9225
+ const safeHarden= makeHardener();
8903
9226
 
8904
9227
  /**
8905
9228
  * @callback Transform
@@ -8909,9 +9232,9 @@ const harden= makeHardener();
8909
9232
 
8910
9233
  /**
8911
9234
  * @callback CompartmentConstructor
8912
- * @param {Object} endowments
8913
- * @param {Object} moduleMap
8914
- * @param {Object} [options]
9235
+ * @param {object} endowments
9236
+ * @param {object} moduleMap
9237
+ * @param {object} [options]
8915
9238
  * @param {Array<Transform>} [options.transforms]
8916
9239
  * @param {Array<Transform>} [options.__shimTransforms__]
8917
9240
  */
@@ -8947,6 +9270,7 @@ const assertDirectEvalAvailable= ()=> {
8947
9270
  allowed= true;
8948
9271
  }
8949
9272
  if( !allowed) {
9273
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_DIRECT_EVAL.md
8950
9274
  throw new TypeError(
8951
9275
  `SES cannot initialize unless 'eval' is the original intrinsic 'eval', suitable for direct-eval (dynamically scoped eval) (SES_DIRECT_EVAL)`);
8952
9276
 
@@ -9005,6 +9329,7 @@ const repairIntrinsics= (options= {})=> {
9005
9329
  /** @param {string} debugName */
9006
9330
  (debugName)=>debugName!== ''),
9007
9331
 
9332
+ __hardenTaming__= getenv('LOCKDOWN_HARDEN_TAMING', 'safe'),
9008
9333
  dateTaming= 'safe', // deprecated
9009
9334
  mathTaming= 'safe', // deprecated
9010
9335
  ...extraOptions}=
@@ -9038,6 +9363,7 @@ const repairIntrinsics= (options= {})=> {
9038
9363
  d `Already locked down at ${priorLockdown} (SES_ALREADY_LOCKED_DOWN)`,
9039
9364
  TypeError);
9040
9365
 
9366
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_ALREADY_LOCKED_DOWN.md
9041
9367
  priorLockdown= new TypeError('Prior lockdown (SES_ALREADY_LOCKED_DOWN)');
9042
9368
  // Tease V8 to generate the stack string and release the closures the stack
9043
9369
  // trace retained:
@@ -9079,6 +9405,7 @@ const repairIntrinsics= (options= {})=> {
9079
9405
  };
9080
9406
 
9081
9407
  if( seemsToBeLockedDown()) {
9408
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_MULTIPLE_INSTANCES.md
9082
9409
  throw new TypeError(
9083
9410
  `Already locked down but not by this SES instance (SES_MULTIPLE_INSTANCES)`);
9084
9411
 
@@ -9093,7 +9420,8 @@ const repairIntrinsics= (options= {})=> {
9093
9420
  const { addIntrinsics, completePrototypes, finalIntrinsics}=
9094
9421
  makeIntrinsicsCollector();
9095
9422
 
9096
- addIntrinsics({ harden});
9423
+ const tamedHarden= tameHarden(safeHarden, __hardenTaming__);
9424
+ addIntrinsics({ harden: tamedHarden});
9097
9425
 
9098
9426
  addIntrinsics(tameFunctionConstructors());
9099
9427
 
@@ -9206,7 +9534,7 @@ const repairIntrinsics= (options= {})=> {
9206
9534
 
9207
9535
  // Finally register and optionally freeze all the intrinsics. This
9208
9536
  // must be the operation that modifies the intrinsics.
9209
- harden(intrinsics);
9537
+ tamedHarden(intrinsics);
9210
9538
 
9211
9539
  // Reveal harden after lockdown.
9212
9540
  // Harden is dangerous before lockdown because hardening just
@@ -9216,7 +9544,7 @@ const repairIntrinsics= (options= {})=> {
9216
9544
  // scope signals whether such code should attempt to use harden in the
9217
9545
  // defense of its own API.
9218
9546
  // @ts-ignore harden not yet recognized on globalThis.
9219
- globalThis.harden= harden;
9547
+ globalThis.harden= tamedHarden;
9220
9548
 
9221
9549
  // Returning `true` indicates that this is a JS to SES transition.
9222
9550
  return true;
@@ -9234,7 +9562,7 @@ const lockdown= (options= {})=> {
9234
9562
  };$h‍_once.lockdown(lockdown);
9235
9563
  })
9236
9564
  ,
9237
- // === functors[43] ===
9565
+ // === functors[45] ===
9238
9566
  (({ 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)]]]]]);
9239
9567
 
9240
9568
 
@@ -9263,6 +9591,7 @@ function getThis() {
9263
9591
  }
9264
9592
 
9265
9593
  if( getThis()) {
9594
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_NO_SLOPPY.md
9266
9595
  throw new TypeError( `SES failed to initialize, sloppy mode (SES_NO_SLOPPY)`);
9267
9596
  }
9268
9597
 
@@ -9337,6 +9666,8 @@ assign(globalThis, {
9337
9666
  getOwnPropertyNames: cell("getOwnPropertyNames"),
9338
9667
  getPrototypeOf: cell("getPrototypeOf"),
9339
9668
  is: cell("is"),
9669
+ isFrozen: cell("isFrozen"),
9670
+ isSealed: cell("isSealed"),
9340
9671
  isExtensible: cell("isExtensible"),
9341
9672
  keys: cell("keys"),
9342
9673
  objectPrototype: cell("objectPrototype"),
@@ -9436,6 +9767,10 @@ assign(globalThis, {
9436
9767
  },
9437
9768
  {
9438
9769
  },
9770
+ {
9771
+ makeLRUCacheMap: cell("makeLRUCacheMap"),
9772
+ makeNoteLogArgsArrayKit: cell("makeNoteLogArgsArrayKit"),
9773
+ },
9439
9774
  {
9440
9775
  an: cell("an"),
9441
9776
  bestEffortStringify: cell("bestEffortStringify"),
@@ -9478,6 +9813,7 @@ assign(globalThis, {
9478
9813
  rejectSomeDirectEvalExpressions: cell("rejectSomeDirectEvalExpressions"),
9479
9814
  mandatoryTransforms: cell("mandatoryTransforms"),
9480
9815
  applyTransforms: cell("applyTransforms"),
9816
+ transforms: cell("transforms"),
9481
9817
  },
9482
9818
  {
9483
9819
  makeSafeEvaluator: cell("makeSafeEvaluator"),
@@ -9584,6 +9920,9 @@ assign(globalThis, {
9584
9920
  {
9585
9921
  tameFunctionToString: cell("tameFunctionToString"),
9586
9922
  },
9923
+ {
9924
+ tameHarden: cell("tameHarden"),
9925
+ },
9587
9926
  {
9588
9927
  default: cell("default"),
9589
9928
  },
@@ -9664,6 +10003,8 @@ function observeImports(map, importName, importIndex) {
9664
10003
  getOwnPropertyNames: cells[0].getOwnPropertyNames.set,
9665
10004
  getPrototypeOf: cells[0].getPrototypeOf.set,
9666
10005
  is: cells[0].is.set,
10006
+ isFrozen: cells[0].isFrozen.set,
10007
+ isSealed: cells[0].isSealed.set,
9667
10008
  isExtensible: cells[0].isExtensible.set,
9668
10009
  keys: cells[0].keys.set,
9669
10010
  objectPrototype: cells[0].objectPrototype.set,
@@ -9776,55 +10117,56 @@ function observeImports(map, importName, importIndex) {
9776
10117
  functors[2]({
9777
10118
  imports(entries) {
9778
10119
  const map = new Map(entries);
9779
- observeImports(map, "../commons.js", 0);
10120
+ observeImports(map, "./internal-types.js", 1);
9780
10121
  },
9781
10122
  liveVar: {
9782
10123
  },
9783
10124
  onceVar: {
9784
- an: cells[2].an.set,
9785
- bestEffortStringify: cells[2].bestEffortStringify.set,
9786
- enJoin: cells[2].enJoin.set,
10125
+ makeLRUCacheMap: cells[2].makeLRUCacheMap.set,
10126
+ makeNoteLogArgsArrayKit: cells[2].makeNoteLogArgsArrayKit.set,
9787
10127
  },
9788
10128
  importMeta: {},
9789
10129
  });
9790
10130
  functors[3]({
9791
10131
  imports(entries) {
9792
10132
  const map = new Map(entries);
10133
+ observeImports(map, "../commons.js", 0);
9793
10134
  },
9794
10135
  liveVar: {
9795
10136
  },
9796
10137
  onceVar: {
10138
+ an: cells[3].an.set,
10139
+ bestEffortStringify: cells[3].bestEffortStringify.set,
10140
+ enJoin: cells[3].enJoin.set,
9797
10141
  },
9798
10142
  importMeta: {},
9799
10143
  });
9800
10144
  functors[4]({
9801
10145
  imports(entries) {
9802
10146
  const map = new Map(entries);
9803
- observeImports(map, "../commons.js", 0);
9804
- observeImports(map, "./internal-types.js", 1);
9805
- observeImports(map, "./stringify-utils.js", 2);
9806
- observeImports(map, "./types.js", 3);
9807
10147
  },
9808
10148
  liveVar: {
9809
10149
  },
9810
10150
  onceVar: {
9811
- unredactedDetails: cells[4].unredactedDetails.set,
9812
- loggedErrorHandler: cells[4].loggedErrorHandler.set,
9813
- makeAssert: cells[4].makeAssert.set,
9814
- assert: cells[4].assert.set,
9815
10151
  },
9816
10152
  importMeta: {},
9817
10153
  });
9818
10154
  functors[5]({
9819
10155
  imports(entries) {
9820
10156
  const map = new Map(entries);
9821
- observeImports(map, "./commons.js", 0);
9822
- observeImports(map, "./error/assert.js", 4);
10157
+ observeImports(map, "../commons.js", 0);
10158
+ observeImports(map, "./internal-types.js", 1);
10159
+ observeImports(map, "./note-log-args.js", 2);
10160
+ observeImports(map, "./stringify-utils.js", 3);
10161
+ observeImports(map, "./types.js", 4);
9823
10162
  },
9824
10163
  liveVar: {
9825
10164
  },
9826
10165
  onceVar: {
9827
- makeEvalScopeKit: cells[5].makeEvalScopeKit.set,
10166
+ unredactedDetails: cells[5].unredactedDetails.set,
10167
+ loggedErrorHandler: cells[5].loggedErrorHandler.set,
10168
+ makeAssert: cells[5].makeAssert.set,
10169
+ assert: cells[5].assert.set,
9828
10170
  },
9829
10171
  importMeta: {},
9830
10172
  });
@@ -9832,12 +10174,12 @@ function observeImports(map, importName, importIndex) {
9832
10174
  imports(entries) {
9833
10175
  const map = new Map(entries);
9834
10176
  observeImports(map, "./commons.js", 0);
10177
+ observeImports(map, "./error/assert.js", 5);
9835
10178
  },
9836
10179
  liveVar: {
9837
10180
  },
9838
10181
  onceVar: {
9839
- isValidIdentifierName: cells[6].isValidIdentifierName.set,
9840
- getScopeConstants: cells[6].getScopeConstants.set,
10182
+ makeEvalScopeKit: cells[6].makeEvalScopeKit.set,
9841
10183
  },
9842
10184
  importMeta: {},
9843
10185
  });
@@ -9845,12 +10187,12 @@ function observeImports(map, importName, importIndex) {
9845
10187
  imports(entries) {
9846
10188
  const map = new Map(entries);
9847
10189
  observeImports(map, "./commons.js", 0);
9848
- observeImports(map, "./scope-constants.js", 6);
9849
10190
  },
9850
10191
  liveVar: {
9851
10192
  },
9852
10193
  onceVar: {
9853
- makeEvaluate: cells[7].makeEvaluate.set,
10194
+ isValidIdentifierName: cells[7].isValidIdentifierName.set,
10195
+ getScopeConstants: cells[7].getScopeConstants.set,
9854
10196
  },
9855
10197
  importMeta: {},
9856
10198
  });
@@ -9858,14 +10200,12 @@ function observeImports(map, importName, importIndex) {
9858
10200
  imports(entries) {
9859
10201
  const map = new Map(entries);
9860
10202
  observeImports(map, "./commons.js", 0);
9861
- observeImports(map, "./error/assert.js", 4);
10203
+ observeImports(map, "./scope-constants.js", 7);
9862
10204
  },
9863
10205
  liveVar: {
9864
10206
  },
9865
10207
  onceVar: {
9866
- alwaysThrowHandler: cells[8].alwaysThrowHandler.set,
9867
- strictScopeTerminatorHandler: cells[8].strictScopeTerminatorHandler.set,
9868
- strictScopeTerminator: cells[8].strictScopeTerminator.set,
10208
+ makeEvaluate: cells[8].makeEvaluate.set,
9869
10209
  },
9870
10210
  importMeta: {},
9871
10211
  });
@@ -9873,12 +10213,14 @@ function observeImports(map, importName, importIndex) {
9873
10213
  imports(entries) {
9874
10214
  const map = new Map(entries);
9875
10215
  observeImports(map, "./commons.js", 0);
9876
- observeImports(map, "./strict-scope-terminator.js", 8);
10216
+ observeImports(map, "./error/assert.js", 5);
9877
10217
  },
9878
10218
  liveVar: {
9879
10219
  },
9880
10220
  onceVar: {
9881
- createSloppyGlobalsScopeTerminator: cells[9].createSloppyGlobalsScopeTerminator.set,
10221
+ alwaysThrowHandler: cells[9].alwaysThrowHandler.set,
10222
+ strictScopeTerminatorHandler: cells[9].strictScopeTerminatorHandler.set,
10223
+ strictScopeTerminator: cells[9].strictScopeTerminator.set,
9882
10224
  },
9883
10225
  importMeta: {},
9884
10226
  });
@@ -9886,11 +10228,12 @@ function observeImports(map, importName, importIndex) {
9886
10228
  imports(entries) {
9887
10229
  const map = new Map(entries);
9888
10230
  observeImports(map, "./commons.js", 0);
10231
+ observeImports(map, "./strict-scope-terminator.js", 9);
9889
10232
  },
9890
10233
  liveVar: {
9891
10234
  },
9892
10235
  onceVar: {
9893
- getSourceURL: cells[10].getSourceURL.set,
10236
+ createSloppyGlobalsScopeTerminator: cells[10].createSloppyGlobalsScopeTerminator.set,
9894
10237
  },
9895
10238
  importMeta: {},
9896
10239
  });
@@ -9898,18 +10241,11 @@ function observeImports(map, importName, importIndex) {
9898
10241
  imports(entries) {
9899
10242
  const map = new Map(entries);
9900
10243
  observeImports(map, "./commons.js", 0);
9901
- observeImports(map, "./get-source-url.js", 10);
9902
10244
  },
9903
10245
  liveVar: {
9904
10246
  },
9905
10247
  onceVar: {
9906
- rejectHtmlComments: cells[11].rejectHtmlComments.set,
9907
- evadeHtmlCommentTest: cells[11].evadeHtmlCommentTest.set,
9908
- rejectImportExpressions: cells[11].rejectImportExpressions.set,
9909
- evadeImportExpressionTest: cells[11].evadeImportExpressionTest.set,
9910
- rejectSomeDirectEvalExpressions: cells[11].rejectSomeDirectEvalExpressions.set,
9911
- mandatoryTransforms: cells[11].mandatoryTransforms.set,
9912
- applyTransforms: cells[11].applyTransforms.set,
10248
+ getSourceURL: cells[11].getSourceURL.set,
9913
10249
  },
9914
10250
  importMeta: {},
9915
10251
  });
@@ -9917,17 +10253,19 @@ function observeImports(map, importName, importIndex) {
9917
10253
  imports(entries) {
9918
10254
  const map = new Map(entries);
9919
10255
  observeImports(map, "./commons.js", 0);
9920
- observeImports(map, "./error/assert.js", 4);
9921
- observeImports(map, "./eval-scope.js", 5);
9922
- observeImports(map, "./make-evaluate.js", 7);
9923
- observeImports(map, "./sloppy-globals-scope-terminator.js", 9);
9924
- observeImports(map, "./strict-scope-terminator.js", 8);
9925
- observeImports(map, "./transforms.js", 11);
10256
+ observeImports(map, "./get-source-url.js", 11);
9926
10257
  },
9927
10258
  liveVar: {
9928
10259
  },
9929
10260
  onceVar: {
9930
- makeSafeEvaluator: cells[12].makeSafeEvaluator.set,
10261
+ rejectHtmlComments: cells[12].rejectHtmlComments.set,
10262
+ evadeHtmlCommentTest: cells[12].evadeHtmlCommentTest.set,
10263
+ rejectImportExpressions: cells[12].rejectImportExpressions.set,
10264
+ evadeImportExpressionTest: cells[12].evadeImportExpressionTest.set,
10265
+ rejectSomeDirectEvalExpressions: cells[12].rejectSomeDirectEvalExpressions.set,
10266
+ mandatoryTransforms: cells[12].mandatoryTransforms.set,
10267
+ applyTransforms: cells[12].applyTransforms.set,
10268
+ transforms: cells[12].transforms.set,
9931
10269
  },
9932
10270
  importMeta: {},
9933
10271
  });
@@ -9935,75 +10273,75 @@ function observeImports(map, importName, importIndex) {
9935
10273
  imports(entries) {
9936
10274
  const map = new Map(entries);
9937
10275
  observeImports(map, "./commons.js", 0);
9938
- observeImports(map, "./make-safe-evaluator.js", 12);
9939
- observeImports(map, "./transforms.js", 11);
10276
+ observeImports(map, "./error/assert.js", 5);
10277
+ observeImports(map, "./eval-scope.js", 6);
10278
+ observeImports(map, "./make-evaluate.js", 8);
10279
+ observeImports(map, "./sloppy-globals-scope-terminator.js", 10);
10280
+ observeImports(map, "./strict-scope-terminator.js", 9);
10281
+ observeImports(map, "./transforms.js", 12);
9940
10282
  },
9941
10283
  liveVar: {
9942
10284
  },
9943
10285
  onceVar: {
9944
- provideCompartmentEvaluator: cells[13].provideCompartmentEvaluator.set,
9945
- compartmentEvaluate: cells[13].compartmentEvaluate.set,
10286
+ makeSafeEvaluator: cells[13].makeSafeEvaluator.set,
9946
10287
  },
9947
10288
  importMeta: {},
9948
10289
  });
9949
10290
  functors[14]({
9950
10291
  imports(entries) {
9951
10292
  const map = new Map(entries);
10293
+ observeImports(map, "./commons.js", 0);
10294
+ observeImports(map, "./make-safe-evaluator.js", 13);
10295
+ observeImports(map, "./transforms.js", 12);
9952
10296
  },
9953
10297
  liveVar: {
9954
10298
  },
9955
10299
  onceVar: {
9956
- makeEvalFunction: cells[14].makeEvalFunction.set,
10300
+ provideCompartmentEvaluator: cells[14].provideCompartmentEvaluator.set,
10301
+ compartmentEvaluate: cells[14].compartmentEvaluate.set,
9957
10302
  },
9958
10303
  importMeta: {},
9959
10304
  });
9960
10305
  functors[15]({
9961
10306
  imports(entries) {
9962
10307
  const map = new Map(entries);
9963
- observeImports(map, "./commons.js", 0);
9964
- observeImports(map, "./error/assert.js", 4);
9965
10308
  },
9966
10309
  liveVar: {
9967
10310
  },
9968
10311
  onceVar: {
9969
- makeFunctionConstructor: cells[15].makeFunctionConstructor.set,
10312
+ makeEvalFunction: cells[15].makeEvalFunction.set,
9970
10313
  },
9971
10314
  importMeta: {},
9972
10315
  });
9973
10316
  functors[16]({
9974
10317
  imports(entries) {
9975
10318
  const map = new Map(entries);
10319
+ observeImports(map, "./commons.js", 0);
10320
+ observeImports(map, "./error/assert.js", 5);
9976
10321
  },
9977
10322
  liveVar: {
9978
10323
  },
9979
10324
  onceVar: {
9980
- constantProperties: cells[16].constantProperties.set,
9981
- universalPropertyNames: cells[16].universalPropertyNames.set,
9982
- initialGlobalPropertyNames: cells[16].initialGlobalPropertyNames.set,
9983
- sharedGlobalPropertyNames: cells[16].sharedGlobalPropertyNames.set,
9984
- uniqueGlobalPropertyNames: cells[16].uniqueGlobalPropertyNames.set,
9985
- NativeErrors: cells[16].NativeErrors.set,
9986
- FunctionInstance: cells[16].FunctionInstance.set,
9987
- isAccessorPermit: cells[16].isAccessorPermit.set,
9988
- whitelist: cells[16].whitelist.set,
10325
+ makeFunctionConstructor: cells[16].makeFunctionConstructor.set,
9989
10326
  },
9990
10327
  importMeta: {},
9991
10328
  });
9992
10329
  functors[17]({
9993
10330
  imports(entries) {
9994
10331
  const map = new Map(entries);
9995
- observeImports(map, "./commons.js", 0);
9996
- observeImports(map, "./make-eval-function.js", 14);
9997
- observeImports(map, "./make-function-constructor.js", 15);
9998
- observeImports(map, "./whitelist.js", 16);
9999
10332
  },
10000
10333
  liveVar: {
10001
10334
  },
10002
10335
  onceVar: {
10003
- setGlobalObjectSymbolUnscopables: cells[17].setGlobalObjectSymbolUnscopables.set,
10004
- setGlobalObjectConstantProperties: cells[17].setGlobalObjectConstantProperties.set,
10005
- setGlobalObjectMutableProperties: cells[17].setGlobalObjectMutableProperties.set,
10006
- setGlobalObjectEvaluators: cells[17].setGlobalObjectEvaluators.set,
10336
+ constantProperties: cells[17].constantProperties.set,
10337
+ universalPropertyNames: cells[17].universalPropertyNames.set,
10338
+ initialGlobalPropertyNames: cells[17].initialGlobalPropertyNames.set,
10339
+ sharedGlobalPropertyNames: cells[17].sharedGlobalPropertyNames.set,
10340
+ uniqueGlobalPropertyNames: cells[17].uniqueGlobalPropertyNames.set,
10341
+ NativeErrors: cells[17].NativeErrors.set,
10342
+ FunctionInstance: cells[17].FunctionInstance.set,
10343
+ isAccessorPermit: cells[17].isAccessorPermit.set,
10344
+ whitelist: cells[17].whitelist.set,
10007
10345
  },
10008
10346
  importMeta: {},
10009
10347
  });
@@ -10011,13 +10349,17 @@ function observeImports(map, importName, importIndex) {
10011
10349
  imports(entries) {
10012
10350
  const map = new Map(entries);
10013
10351
  observeImports(map, "./commons.js", 0);
10014
- observeImports(map, "./error/assert.js", 4);
10352
+ observeImports(map, "./make-eval-function.js", 15);
10353
+ observeImports(map, "./make-function-constructor.js", 16);
10354
+ observeImports(map, "./whitelist.js", 17);
10015
10355
  },
10016
10356
  liveVar: {
10017
10357
  },
10018
10358
  onceVar: {
10019
- makeAlias: cells[18].makeAlias.set,
10020
- load: cells[18].load.set,
10359
+ setGlobalObjectSymbolUnscopables: cells[18].setGlobalObjectSymbolUnscopables.set,
10360
+ setGlobalObjectConstantProperties: cells[18].setGlobalObjectConstantProperties.set,
10361
+ setGlobalObjectMutableProperties: cells[18].setGlobalObjectMutableProperties.set,
10362
+ setGlobalObjectEvaluators: cells[18].setGlobalObjectEvaluators.set,
10021
10363
  },
10022
10364
  importMeta: {},
10023
10365
  });
@@ -10025,14 +10367,13 @@ function observeImports(map, importName, importIndex) {
10025
10367
  imports(entries) {
10026
10368
  const map = new Map(entries);
10027
10369
  observeImports(map, "./commons.js", 0);
10028
- observeImports(map, "./error/assert.js", 4);
10029
- observeImports(map, "./module-load.js", 18);
10370
+ observeImports(map, "./error/assert.js", 5);
10030
10371
  },
10031
10372
  liveVar: {
10032
10373
  },
10033
10374
  onceVar: {
10034
- deferExports: cells[19].deferExports.set,
10035
- getDeferredExports: cells[19].getDeferredExports.set,
10375
+ makeAlias: cells[19].makeAlias.set,
10376
+ load: cells[19].load.set,
10036
10377
  },
10037
10378
  importMeta: {},
10038
10379
  });
@@ -10040,15 +10381,14 @@ function observeImports(map, importName, importIndex) {
10040
10381
  imports(entries) {
10041
10382
  const map = new Map(entries);
10042
10383
  observeImports(map, "./commons.js", 0);
10043
- observeImports(map, "./compartment-evaluate.js", 13);
10044
- observeImports(map, "./error/assert.js", 4);
10045
- observeImports(map, "./module-proxy.js", 19);
10384
+ observeImports(map, "./error/assert.js", 5);
10385
+ observeImports(map, "./module-load.js", 19);
10046
10386
  },
10047
10387
  liveVar: {
10048
10388
  },
10049
10389
  onceVar: {
10050
- makeThirdPartyModuleInstance: cells[20].makeThirdPartyModuleInstance.set,
10051
- makeModuleInstance: cells[20].makeModuleInstance.set,
10390
+ deferExports: cells[20].deferExports.set,
10391
+ getDeferredExports: cells[20].getDeferredExports.set,
10052
10392
  },
10053
10393
  importMeta: {},
10054
10394
  });
@@ -10056,14 +10396,15 @@ function observeImports(map, importName, importIndex) {
10056
10396
  imports(entries) {
10057
10397
  const map = new Map(entries);
10058
10398
  observeImports(map, "./commons.js", 0);
10059
- observeImports(map, "./error/assert.js", 4);
10060
- observeImports(map, "./module-instance.js", 20);
10399
+ observeImports(map, "./compartment-evaluate.js", 14);
10400
+ observeImports(map, "./error/assert.js", 5);
10401
+ observeImports(map, "./module-proxy.js", 20);
10061
10402
  },
10062
10403
  liveVar: {
10063
10404
  },
10064
10405
  onceVar: {
10065
- link: cells[21].link.set,
10066
- instantiate: cells[21].instantiate.set,
10406
+ makeThirdPartyModuleInstance: cells[21].makeThirdPartyModuleInstance.set,
10407
+ makeModuleInstance: cells[21].makeModuleInstance.set,
10067
10408
  },
10068
10409
  importMeta: {},
10069
10410
  });
@@ -10071,21 +10412,14 @@ function observeImports(map, importName, importIndex) {
10071
10412
  imports(entries) {
10072
10413
  const map = new Map(entries);
10073
10414
  observeImports(map, "./commons.js", 0);
10074
- observeImports(map, "./compartment-evaluate.js", 13);
10075
- observeImports(map, "./error/assert.js", 4);
10076
- observeImports(map, "./global-object.js", 17);
10077
- observeImports(map, "./make-safe-evaluator.js", 12);
10078
- observeImports(map, "./module-link.js", 21);
10079
- observeImports(map, "./module-load.js", 18);
10080
- observeImports(map, "./module-proxy.js", 19);
10081
- observeImports(map, "./whitelist.js", 16);
10415
+ observeImports(map, "./error/assert.js", 5);
10416
+ observeImports(map, "./module-instance.js", 21);
10082
10417
  },
10083
10418
  liveVar: {
10084
10419
  },
10085
10420
  onceVar: {
10086
- InertCompartment: cells[22].InertCompartment.set,
10087
- CompartmentPrototype: cells[22].CompartmentPrototype.set,
10088
- makeCompartmentConstructor: cells[22].makeCompartmentConstructor.set,
10421
+ link: cells[22].link.set,
10422
+ instantiate: cells[22].instantiate.set,
10089
10423
  },
10090
10424
  importMeta: {},
10091
10425
  });
@@ -10093,39 +10427,48 @@ function observeImports(map, importName, importIndex) {
10093
10427
  imports(entries) {
10094
10428
  const map = new Map(entries);
10095
10429
  observeImports(map, "./commons.js", 0);
10096
- observeImports(map, "./whitelist.js", 16);
10430
+ observeImports(map, "./compartment-evaluate.js", 14);
10431
+ observeImports(map, "./error/assert.js", 5);
10432
+ observeImports(map, "./global-object.js", 18);
10433
+ observeImports(map, "./make-safe-evaluator.js", 13);
10434
+ observeImports(map, "./module-link.js", 22);
10435
+ observeImports(map, "./module-load.js", 19);
10436
+ observeImports(map, "./module-proxy.js", 20);
10437
+ observeImports(map, "./whitelist.js", 17);
10097
10438
  },
10098
10439
  liveVar: {
10099
10440
  },
10100
10441
  onceVar: {
10101
- makeIntrinsicsCollector: cells[23].makeIntrinsicsCollector.set,
10102
- getGlobalIntrinsics: cells[23].getGlobalIntrinsics.set,
10442
+ InertCompartment: cells[23].InertCompartment.set,
10443
+ CompartmentPrototype: cells[23].CompartmentPrototype.set,
10444
+ makeCompartmentConstructor: cells[23].makeCompartmentConstructor.set,
10103
10445
  },
10104
10446
  importMeta: {},
10105
10447
  });
10106
10448
  functors[24]({
10107
10449
  imports(entries) {
10108
10450
  const map = new Map(entries);
10451
+ observeImports(map, "./commons.js", 0);
10452
+ observeImports(map, "./whitelist.js", 17);
10109
10453
  },
10110
10454
  liveVar: {
10111
10455
  },
10112
10456
  onceVar: {
10113
- minEnablements: cells[24].minEnablements.set,
10114
- moderateEnablements: cells[24].moderateEnablements.set,
10115
- severeEnablements: cells[24].severeEnablements.set,
10457
+ makeIntrinsicsCollector: cells[24].makeIntrinsicsCollector.set,
10458
+ getGlobalIntrinsics: cells[24].getGlobalIntrinsics.set,
10116
10459
  },
10117
10460
  importMeta: {},
10118
10461
  });
10119
10462
  functors[25]({
10120
10463
  imports(entries) {
10121
10464
  const map = new Map(entries);
10122
- observeImports(map, "./commons.js", 0);
10123
- observeImports(map, "./enablements.js", 24);
10124
10465
  },
10125
10466
  liveVar: {
10126
10467
  },
10127
10468
  onceVar: {
10128
- default: cells[25].default.set,
10469
+ minEnablements: cells[25].minEnablements.set,
10470
+ moderateEnablements: cells[25].moderateEnablements.set,
10471
+ severeEnablements: cells[25].severeEnablements.set,
10129
10472
  },
10130
10473
  importMeta: {},
10131
10474
  });
@@ -10133,29 +10476,25 @@ function observeImports(map, importName, importIndex) {
10133
10476
  imports(entries) {
10134
10477
  const map = new Map(entries);
10135
10478
  observeImports(map, "./commons.js", 0);
10136
- observeImports(map, "./error/assert.js", 4);
10479
+ observeImports(map, "./enablements.js", 25);
10137
10480
  },
10138
10481
  liveVar: {
10139
10482
  },
10140
10483
  onceVar: {
10141
- makeEnvironmentCaptor: cells[26].makeEnvironmentCaptor.set,
10484
+ default: cells[26].default.set,
10142
10485
  },
10143
10486
  importMeta: {},
10144
10487
  });
10145
10488
  functors[27]({
10146
10489
  imports(entries) {
10147
10490
  const map = new Map(entries);
10148
- observeImports(map, "../commons.js", 0);
10149
- observeImports(map, "./internal-types.js", 1);
10150
- observeImports(map, "./types.js", 3);
10491
+ observeImports(map, "./commons.js", 0);
10492
+ observeImports(map, "./error/assert.js", 5);
10151
10493
  },
10152
10494
  liveVar: {
10153
10495
  },
10154
10496
  onceVar: {
10155
- makeLoggingConsoleKit: cells[27].makeLoggingConsoleKit.set,
10156
- makeCausalConsole: cells[27].makeCausalConsole.set,
10157
- filterConsole: cells[27].filterConsole.set,
10158
- consoleWhitelist: cells[27].consoleWhitelist.set,
10497
+ makeEnvironmentCaptor: cells[27].makeEnvironmentCaptor.set,
10159
10498
  },
10160
10499
  importMeta: {},
10161
10500
  });
@@ -10163,11 +10502,16 @@ function observeImports(map, importName, importIndex) {
10163
10502
  imports(entries) {
10164
10503
  const map = new Map(entries);
10165
10504
  observeImports(map, "../commons.js", 0);
10505
+ observeImports(map, "./internal-types.js", 1);
10506
+ observeImports(map, "./types.js", 4);
10166
10507
  },
10167
10508
  liveVar: {
10168
10509
  },
10169
10510
  onceVar: {
10170
- makeRejectionHandlers: cells[28].makeRejectionHandlers.set,
10511
+ makeLoggingConsoleKit: cells[28].makeLoggingConsoleKit.set,
10512
+ makeCausalConsole: cells[28].makeCausalConsole.set,
10513
+ filterConsole: cells[28].filterConsole.set,
10514
+ consoleWhitelist: cells[28].consoleWhitelist.set,
10171
10515
  },
10172
10516
  importMeta: {},
10173
10517
  });
@@ -10175,16 +10519,11 @@ function observeImports(map, importName, importIndex) {
10175
10519
  imports(entries) {
10176
10520
  const map = new Map(entries);
10177
10521
  observeImports(map, "../commons.js", 0);
10178
- observeImports(map, "./assert.js", 4);
10179
- observeImports(map, "./console.js", 27);
10180
- observeImports(map, "./internal-types.js", 1);
10181
- observeImports(map, "./types.js", 3);
10182
- observeImports(map, "./unhandled-rejection.js", 28);
10183
10522
  },
10184
10523
  liveVar: {
10185
10524
  },
10186
10525
  onceVar: {
10187
- tameConsole: cells[29].tameConsole.set,
10526
+ makeRejectionHandlers: cells[29].makeRejectionHandlers.set,
10188
10527
  },
10189
10528
  importMeta: {},
10190
10529
  });
@@ -10192,13 +10531,16 @@ function observeImports(map, importName, importIndex) {
10192
10531
  imports(entries) {
10193
10532
  const map = new Map(entries);
10194
10533
  observeImports(map, "../commons.js", 0);
10534
+ observeImports(map, "./assert.js", 5);
10535
+ observeImports(map, "./console.js", 28);
10536
+ observeImports(map, "./internal-types.js", 1);
10537
+ observeImports(map, "./types.js", 4);
10538
+ observeImports(map, "./unhandled-rejection.js", 29);
10195
10539
  },
10196
10540
  liveVar: {
10197
10541
  },
10198
10542
  onceVar: {
10199
- filterFileName: cells[30].filterFileName.set,
10200
- shortenCallSiteString: cells[30].shortenCallSiteString.set,
10201
- tameV8ErrorConstructor: cells[30].tameV8ErrorConstructor.set,
10543
+ tameConsole: cells[30].tameConsole.set,
10202
10544
  },
10203
10545
  importMeta: {},
10204
10546
  });
@@ -10206,26 +10548,27 @@ function observeImports(map, importName, importIndex) {
10206
10548
  imports(entries) {
10207
10549
  const map = new Map(entries);
10208
10550
  observeImports(map, "../commons.js", 0);
10209
- observeImports(map, "../whitelist.js", 16);
10210
- observeImports(map, "./tame-v8-error-constructor.js", 30);
10211
10551
  },
10212
10552
  liveVar: {
10213
10553
  },
10214
10554
  onceVar: {
10215
- default: cells[31].default.set,
10555
+ filterFileName: cells[31].filterFileName.set,
10556
+ shortenCallSiteString: cells[31].shortenCallSiteString.set,
10557
+ tameV8ErrorConstructor: cells[31].tameV8ErrorConstructor.set,
10216
10558
  },
10217
10559
  importMeta: {},
10218
10560
  });
10219
10561
  functors[32]({
10220
10562
  imports(entries) {
10221
10563
  const map = new Map(entries);
10222
- observeImports(map, "./commons.js", 0);
10223
- observeImports(map, "./compartment-shim.js", 22);
10564
+ observeImports(map, "../commons.js", 0);
10565
+ observeImports(map, "../whitelist.js", 17);
10566
+ observeImports(map, "./tame-v8-error-constructor.js", 31);
10224
10567
  },
10225
10568
  liveVar: {
10226
10569
  },
10227
10570
  onceVar: {
10228
- getAnonymousIntrinsics: cells[32].getAnonymousIntrinsics.set,
10571
+ default: cells[32].default.set,
10229
10572
  },
10230
10573
  importMeta: {},
10231
10574
  });
@@ -10233,13 +10576,12 @@ function observeImports(map, importName, importIndex) {
10233
10576
  imports(entries) {
10234
10577
  const map = new Map(entries);
10235
10578
  observeImports(map, "./commons.js", 0);
10236
- observeImports(map, "./error/assert.js", 4);
10579
+ observeImports(map, "./compartment-shim.js", 23);
10237
10580
  },
10238
10581
  liveVar: {
10239
10582
  },
10240
10583
  onceVar: {
10241
- isTypedArray: cells[33].isTypedArray.set,
10242
- makeHardener: cells[33].makeHardener.set,
10584
+ getAnonymousIntrinsics: cells[33].getAnonymousIntrinsics.set,
10243
10585
  },
10244
10586
  importMeta: {},
10245
10587
  });
@@ -10247,11 +10589,13 @@ function observeImports(map, importName, importIndex) {
10247
10589
  imports(entries) {
10248
10590
  const map = new Map(entries);
10249
10591
  observeImports(map, "./commons.js", 0);
10592
+ observeImports(map, "./error/assert.js", 5);
10250
10593
  },
10251
10594
  liveVar: {
10252
10595
  },
10253
10596
  onceVar: {
10254
- default: cells[34].default.set,
10597
+ isTypedArray: cells[34].isTypedArray.set,
10598
+ makeHardener: cells[34].makeHardener.set,
10255
10599
  },
10256
10600
  importMeta: {},
10257
10601
  });
@@ -10263,7 +10607,7 @@ function observeImports(map, importName, importIndex) {
10263
10607
  liveVar: {
10264
10608
  },
10265
10609
  onceVar: {
10266
- tameDomains: cells[35].tameDomains.set,
10610
+ default: cells[35].default.set,
10267
10611
  },
10268
10612
  importMeta: {},
10269
10613
  });
@@ -10275,7 +10619,7 @@ function observeImports(map, importName, importIndex) {
10275
10619
  liveVar: {
10276
10620
  },
10277
10621
  onceVar: {
10278
- default: cells[36].default.set,
10622
+ tameDomains: cells[36].tameDomains.set,
10279
10623
  },
10280
10624
  importMeta: {},
10281
10625
  });
@@ -10287,7 +10631,7 @@ function observeImports(map, importName, importIndex) {
10287
10631
  liveVar: {
10288
10632
  },
10289
10633
  onceVar: {
10290
- tameFunctionToString: cells[37].tameFunctionToString.set,
10634
+ default: cells[37].default.set,
10291
10635
  },
10292
10636
  importMeta: {},
10293
10637
  });
@@ -10295,12 +10639,11 @@ function observeImports(map, importName, importIndex) {
10295
10639
  imports(entries) {
10296
10640
  const map = new Map(entries);
10297
10641
  observeImports(map, "./commons.js", 0);
10298
- observeImports(map, "./error/assert.js", 4);
10299
10642
  },
10300
10643
  liveVar: {
10301
10644
  },
10302
10645
  onceVar: {
10303
- default: cells[38].default.set,
10646
+ tameFunctionToString: cells[38].tameFunctionToString.set,
10304
10647
  },
10305
10648
  importMeta: {},
10306
10649
  });
@@ -10312,7 +10655,7 @@ function observeImports(map, importName, importIndex) {
10312
10655
  liveVar: {
10313
10656
  },
10314
10657
  onceVar: {
10315
- default: cells[39].default.set,
10658
+ tameHarden: cells[39].tameHarden.set,
10316
10659
  },
10317
10660
  importMeta: {},
10318
10661
  });
@@ -10320,6 +10663,7 @@ function observeImports(map, importName, importIndex) {
10320
10663
  imports(entries) {
10321
10664
  const map = new Map(entries);
10322
10665
  observeImports(map, "./commons.js", 0);
10666
+ observeImports(map, "./error/assert.js", 5);
10323
10667
  },
10324
10668
  liveVar: {
10325
10669
  },
@@ -10332,7 +10676,6 @@ function observeImports(map, importName, importIndex) {
10332
10676
  imports(entries) {
10333
10677
  const map = new Map(entries);
10334
10678
  observeImports(map, "./commons.js", 0);
10335
- observeImports(map, "./whitelist.js", 16);
10336
10679
  },
10337
10680
  liveVar: {
10338
10681
  },
@@ -10345,45 +10688,71 @@ function observeImports(map, importName, importIndex) {
10345
10688
  imports(entries) {
10346
10689
  const map = new Map(entries);
10347
10690
  observeImports(map, "./commons.js", 0);
10348
- observeImports(map, "./compartment-shim.js", 22);
10349
- observeImports(map, "./enable-property-overrides.js", 25);
10350
- observeImports(map, "./environment-options.js", 26);
10351
- observeImports(map, "./error/assert.js", 4);
10352
- observeImports(map, "./error/stringify-utils.js", 2);
10353
- observeImports(map, "./error/tame-console.js", 29);
10354
- observeImports(map, "./error/tame-error-constructor.js", 31);
10355
- observeImports(map, "./get-anonymous-intrinsics.js", 32);
10356
- observeImports(map, "./global-object.js", 17);
10357
- observeImports(map, "./intrinsics.js", 23);
10358
- observeImports(map, "./make-hardener.js", 33);
10359
- observeImports(map, "./make-safe-evaluator.js", 12);
10360
- observeImports(map, "./tame-date-constructor.js", 34);
10361
- observeImports(map, "./tame-domains.js", 35);
10362
- observeImports(map, "./tame-function-constructors.js", 36);
10363
- observeImports(map, "./tame-function-tostring.js", 37);
10364
- observeImports(map, "./tame-locale-methods.js", 38);
10365
- observeImports(map, "./tame-math-object.js", 39);
10366
- observeImports(map, "./tame-regexp-constructor.js", 40);
10367
- observeImports(map, "./whitelist-intrinsics.js", 41);
10368
- observeImports(map, "./whitelist.js", 16);
10369
10691
  },
10370
10692
  liveVar: {
10371
10693
  },
10372
10694
  onceVar: {
10373
- repairIntrinsics: cells[42].repairIntrinsics.set,
10374
- lockdown: cells[42].lockdown.set,
10695
+ default: cells[42].default.set,
10375
10696
  },
10376
10697
  importMeta: {},
10377
10698
  });
10378
10699
  functors[43]({
10700
+ imports(entries) {
10701
+ const map = new Map(entries);
10702
+ observeImports(map, "./commons.js", 0);
10703
+ observeImports(map, "./whitelist.js", 17);
10704
+ },
10705
+ liveVar: {
10706
+ },
10707
+ onceVar: {
10708
+ default: cells[43].default.set,
10709
+ },
10710
+ importMeta: {},
10711
+ });
10712
+ functors[44]({
10713
+ imports(entries) {
10714
+ const map = new Map(entries);
10715
+ observeImports(map, "./commons.js", 0);
10716
+ observeImports(map, "./compartment-shim.js", 23);
10717
+ observeImports(map, "./enable-property-overrides.js", 26);
10718
+ observeImports(map, "./environment-options.js", 27);
10719
+ observeImports(map, "./error/assert.js", 5);
10720
+ observeImports(map, "./error/stringify-utils.js", 3);
10721
+ observeImports(map, "./error/tame-console.js", 30);
10722
+ observeImports(map, "./error/tame-error-constructor.js", 32);
10723
+ observeImports(map, "./get-anonymous-intrinsics.js", 33);
10724
+ observeImports(map, "./global-object.js", 18);
10725
+ observeImports(map, "./intrinsics.js", 24);
10726
+ observeImports(map, "./make-hardener.js", 34);
10727
+ observeImports(map, "./make-safe-evaluator.js", 13);
10728
+ observeImports(map, "./tame-date-constructor.js", 35);
10729
+ observeImports(map, "./tame-domains.js", 36);
10730
+ observeImports(map, "./tame-function-constructors.js", 37);
10731
+ observeImports(map, "./tame-function-tostring.js", 38);
10732
+ observeImports(map, "./tame-harden.js", 39);
10733
+ observeImports(map, "./tame-locale-methods.js", 40);
10734
+ observeImports(map, "./tame-math-object.js", 41);
10735
+ observeImports(map, "./tame-regexp-constructor.js", 42);
10736
+ observeImports(map, "./whitelist-intrinsics.js", 43);
10737
+ observeImports(map, "./whitelist.js", 17);
10738
+ },
10739
+ liveVar: {
10740
+ },
10741
+ onceVar: {
10742
+ repairIntrinsics: cells[44].repairIntrinsics.set,
10743
+ lockdown: cells[44].lockdown.set,
10744
+ },
10745
+ importMeta: {},
10746
+ });
10747
+ functors[45]({
10379
10748
  imports(entries) {
10380
10749
  const map = new Map(entries);
10381
10750
  observeImports(map, "./src/commons.js", 0);
10382
- observeImports(map, "./src/compartment-shim.js", 22);
10383
- observeImports(map, "./src/error/assert.js", 4);
10384
- observeImports(map, "./src/intrinsics.js", 23);
10385
- observeImports(map, "./src/lockdown-shim.js", 42);
10386
- observeImports(map, "./src/tame-function-tostring.js", 37);
10751
+ observeImports(map, "./src/compartment-shim.js", 23);
10752
+ observeImports(map, "./src/error/assert.js", 5);
10753
+ observeImports(map, "./src/intrinsics.js", 24);
10754
+ observeImports(map, "./src/lockdown-shim.js", 44);
10755
+ observeImports(map, "./src/tame-function-tostring.js", 38);
10387
10756
  },
10388
10757
  liveVar: {
10389
10758
  },