@metamask/snaps-execution-environments 10.2.0 → 10.2.1

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.
@@ -1,4 +1,4 @@
1
- <!doctype html><html><head><meta charset="utf-8"/><title>MetaMask Snaps Execution Environment</title><script>// ses@1.13.1
1
+ <!doctype html><html><head><meta charset="utf-8"/><title>MetaMask Snaps Execution Environment</title><script>// ses@1.14.0
2
2
  (functors => options => {
3
3
  'use strict';
4
4
 
@@ -95,6 +95,7 @@
95
95
  setPrototypeOf: cell("setPrototypeOf"),
96
96
  values: cell("values"),
97
97
  fromEntries: cell("fromEntries"),
98
+ hasOwn: cell("hasOwn"),
98
99
  speciesSymbol: cell("speciesSymbol"),
99
100
  toStringTagSymbol: cell("toStringTagSymbol"),
100
101
  iteratorSymbol: cell("iteratorSymbol"),
@@ -186,7 +187,7 @@
186
187
  finalizationRegistryRegister: cell("finalizationRegistryRegister"),
187
188
  finalizationRegistryUnregister: cell("finalizationRegistryUnregister"),
188
189
  getConstructorOf: cell("getConstructorOf"),
189
- isObject: cell("isObject"),
190
+ isPrimitive: cell("isPrimitive"),
190
191
  isError: cell("isError"),
191
192
  identity: cell("identity"),
192
193
  FERAL_EVAL: cell("FERAL_EVAL"),
@@ -207,9 +208,11 @@
207
208
  {
208
209
  },
209
210
  {
210
- transferBufferToImmutable: cell("transferBufferToImmutable"),
211
211
  isBufferImmutable: cell("isBufferImmutable"),
212
212
  sliceBufferToImmutable: cell("sliceBufferToImmutable"),
213
+ optTransferBufferToImmutable: cell("optTransferBufferToImmutable"),
214
+ },
215
+ {
213
216
  },
214
217
  {
215
218
  },
@@ -223,7 +226,10 @@
223
226
  {
224
227
  },
225
228
  {
226
- makeLRUCacheMap: cell("makeLRUCacheMap"),
229
+ makeCacheMapKit: cell("makeCacheMapKit"),
230
+ },
231
+ {
232
+ makeCacheMapKit: cell("makeCacheMapKit"),
227
233
  },
228
234
  {
229
235
  makeNoteLogArgsArrayKit: cell("makeNoteLogArgsArrayKit"),
@@ -435,6 +441,8 @@
435
441
 
436
442
  defineProperties(cells[3], getOwnPropertyDescriptors(cells[2]));
437
443
 
444
+ defineProperties(cells[11], {"makeCacheMapKit": { value: cells[10]["makeCacheMapKit"] } });
445
+
438
446
  const namespaces = cells.map(cells => freeze(create(null, {
439
447
  ...cells,
440
448
  // Make this appear like an ESM module namespace object.
@@ -516,6 +524,7 @@ function observeImports(map, importName, importIndex) {
516
524
  setPrototypeOf: cells[0].setPrototypeOf.set,
517
525
  values: cells[0].values.set,
518
526
  fromEntries: cells[0].fromEntries.set,
527
+ hasOwn: cells[0].hasOwn.set,
519
528
  speciesSymbol: cells[0].speciesSymbol.set,
520
529
  toStringTagSymbol: cells[0].toStringTagSymbol.set,
521
530
  iteratorSymbol: cells[0].iteratorSymbol.set,
@@ -607,7 +616,7 @@ function observeImports(map, importName, importIndex) {
607
616
  finalizationRegistryRegister: cells[0].finalizationRegistryRegister.set,
608
617
  finalizationRegistryUnregister: cells[0].finalizationRegistryUnregister.set,
609
618
  getConstructorOf: cells[0].getConstructorOf.set,
610
- isObject: cells[0].isObject.set,
619
+ isPrimitive: cells[0].isPrimitive.set,
611
620
  isError: cells[0].isError.set,
612
621
  identity: cells[0].identity.set,
613
622
  FERAL_EVAL: cells[0].FERAL_EVAL.set,
@@ -662,16 +671,16 @@ function observeImports(map, importName, importIndex) {
662
671
  liveVar: {
663
672
  },
664
673
  onceVar: {
665
- transferBufferToImmutable: cells[4].transferBufferToImmutable.set,
666
674
  isBufferImmutable: cells[4].isBufferImmutable.set,
667
675
  sliceBufferToImmutable: cells[4].sliceBufferToImmutable.set,
676
+ optTransferBufferToImmutable: cells[4].optTransferBufferToImmutable.set,
668
677
  },
669
678
  importMeta: {},
670
679
  });
671
680
  functors[5]({
672
681
  imports(entries) {
673
682
  const map = new Map(entries);
674
- observeImports(map, "./index.js", 4);
683
+ observeImports(map, "./immutable-arraybuffer-pony.js", 4);
675
684
  },
676
685
  liveVar: {
677
686
  },
@@ -682,24 +691,25 @@ function observeImports(map, importName, importIndex) {
682
691
  functors[6]({
683
692
  imports(entries) {
684
693
  const map = new Map(entries);
685
- observeImports(map, "../commons.js", 0);
694
+ observeImports(map, "./src/immutable-arraybuffer-shim.js", 5);
686
695
  },
687
696
  liveVar: {
688
697
  },
689
698
  onceVar: {
690
- an: cells[6].an.set,
691
- bestEffortStringify: cells[6].bestEffortStringify.set,
692
- enJoin: cells[6].enJoin.set,
693
699
  },
694
700
  importMeta: {},
695
701
  });
696
702
  functors[7]({
697
703
  imports(entries) {
698
704
  const map = new Map(entries);
705
+ observeImports(map, "../commons.js", 0);
699
706
  },
700
707
  liveVar: {
701
708
  },
702
709
  onceVar: {
710
+ an: cells[7].an.set,
711
+ bestEffortStringify: cells[7].bestEffortStringify.set,
712
+ enJoin: cells[7].enJoin.set,
703
713
  },
704
714
  importMeta: {},
705
715
  });
@@ -720,71 +730,66 @@ function observeImports(map, importName, importIndex) {
720
730
  liveVar: {
721
731
  },
722
732
  onceVar: {
723
- makeLRUCacheMap: cells[9].makeLRUCacheMap.set,
724
733
  },
725
734
  importMeta: {},
726
735
  });
727
736
  functors[10]({
728
737
  imports(entries) {
729
738
  const map = new Map(entries);
730
- observeImports(map, "../make-lru-cachemap.js", 9);
731
739
  },
732
740
  liveVar: {
733
741
  },
734
742
  onceVar: {
735
- makeNoteLogArgsArrayKit: cells[10].makeNoteLogArgsArrayKit.set,
743
+ makeCacheMapKit: cells[10].makeCacheMapKit.set,
736
744
  },
737
745
  importMeta: {},
738
746
  });
739
747
  functors[11]({
740
748
  imports(entries) {
741
749
  const map = new Map(entries);
742
- observeImports(map, "../commons.js", 0);
743
- observeImports(map, "./stringify-utils.js", 6);
744
- observeImports(map, "./types.js", 7);
745
- observeImports(map, "./internal-types.js", 8);
746
- observeImports(map, "./note-log-args.js", 10);
750
+ observeImports(map, "./src/cachemap.js", 10);
747
751
  },
748
752
  liveVar: {
749
753
  },
750
754
  onceVar: {
751
- quote: cells[11].q.set,
752
- bare: cells[11].b.set,
753
- redactedDetails: cells[11].X.set,
754
- unredactedDetails: cells[11].unredactedDetails.set,
755
- makeError: cells[11].makeError.set,
756
- note: cells[11].annotateError.set,
757
- loggedErrorHandler: cells[11].loggedErrorHandler.set,
758
- makeAssert: cells[11].makeAssert.set,
759
- assert: cells[11].assert.set,
760
- assertEqual: cells[11].assertEqual.set,
761
- sanitizeError: cells[11].sanitizeError.set,
762
755
  },
763
756
  importMeta: {},
764
757
  });
765
758
  functors[12]({
766
759
  imports(entries) {
767
760
  const map = new Map(entries);
768
- observeImports(map, "./commons.js", 0);
769
- observeImports(map, "./error/assert.js", 11);
761
+ observeImports(map, "@endo/cache-map", 11);
770
762
  },
771
763
  liveVar: {
772
764
  },
773
765
  onceVar: {
774
- isTypedArray: cells[12].isTypedArray.set,
775
- makeHardener: cells[12].makeHardener.set,
766
+ makeNoteLogArgsArrayKit: cells[12].makeNoteLogArgsArrayKit.set,
776
767
  },
777
768
  importMeta: {},
778
769
  });
779
770
  functors[13]({
780
771
  imports(entries) {
781
772
  const map = new Map(entries);
782
- observeImports(map, "./commons.js", 0);
773
+ observeImports(map, "../commons.js", 0);
774
+ observeImports(map, "./stringify-utils.js", 7);
775
+ observeImports(map, "./types.js", 8);
776
+ observeImports(map, "./internal-types.js", 9);
777
+ observeImports(map, "./note-log-args.js", 12);
783
778
  },
784
779
  liveVar: {
785
780
  },
786
781
  onceVar: {
787
- cauterizeProperty: cells[13].cauterizeProperty.set,
782
+ quote: cells[13].q.set,
783
+ bare: cells[13].b.set,
784
+ redactedDetails: cells[13].X.set,
785
+ unredactedDetails: cells[13].unredactedDetails.set,
786
+ makeError: cells[13].makeError.set,
787
+ note: cells[13].annotateError.set,
788
+ loggedErrorHandler: cells[13].loggedErrorHandler.set,
789
+ makeAssert: cells[13].makeAssert.set,
790
+ assert: cells[13].assert.set,
791
+ assertEqual: cells[13].assertEqual.set,
792
+ sanitizeError: cells[13].sanitizeError.set,
788
793
  },
789
794
  importMeta: {},
790
795
  });
@@ -792,68 +797,70 @@ function observeImports(map, importName, importIndex) {
792
797
  imports(entries) {
793
798
  const map = new Map(entries);
794
799
  observeImports(map, "./commons.js", 0);
800
+ observeImports(map, "./error/assert.js", 13);
795
801
  },
796
802
  liveVar: {
797
803
  },
798
804
  onceVar: {
799
- NativeErrors: cells[14].NativeErrors.set,
800
- constantProperties: cells[14].constantProperties.set,
801
- universalPropertyNames: cells[14].universalPropertyNames.set,
802
- initialGlobalPropertyNames: cells[14].initialGlobalPropertyNames.set,
803
- sharedGlobalPropertyNames: cells[14].sharedGlobalPropertyNames.set,
804
- uniqueGlobalPropertyNames: cells[14].uniqueGlobalPropertyNames.set,
805
- FunctionInstance: cells[14].FunctionInstance.set,
806
- AsyncFunctionInstance: cells[14].AsyncFunctionInstance.set,
807
- isAccessorPermit: cells[14].isAccessorPermit.set,
808
- permitted: cells[14].permitted.set,
805
+ isTypedArray: cells[14].isTypedArray.set,
806
+ makeHardener: cells[14].makeHardener.set,
809
807
  },
810
808
  importMeta: {},
811
809
  });
812
810
  functors[15]({
813
811
  imports(entries) {
814
812
  const map = new Map(entries);
815
- observeImports(map, "./cauterize-property.js", 13);
816
813
  observeImports(map, "./commons.js", 0);
817
- observeImports(map, "./permits.js", 14);
818
814
  },
819
815
  liveVar: {
820
816
  },
821
817
  onceVar: {
822
- makeIntrinsicsCollector: cells[15].makeIntrinsicsCollector.set,
823
- getGlobalIntrinsics: cells[15].getGlobalIntrinsics.set,
818
+ cauterizeProperty: cells[15].cauterizeProperty.set,
824
819
  },
825
820
  importMeta: {},
826
821
  });
827
822
  functors[16]({
828
823
  imports(entries) {
829
824
  const map = new Map(entries);
830
- observeImports(map, "./permits.js", 14);
831
825
  observeImports(map, "./commons.js", 0);
832
- observeImports(map, "./cauterize-property.js", 13);
833
826
  },
834
827
  liveVar: {
835
828
  },
836
829
  onceVar: {
837
- default: cells[16].default.set,
830
+ NativeErrors: cells[16].NativeErrors.set,
831
+ constantProperties: cells[16].constantProperties.set,
832
+ universalPropertyNames: cells[16].universalPropertyNames.set,
833
+ initialGlobalPropertyNames: cells[16].initialGlobalPropertyNames.set,
834
+ sharedGlobalPropertyNames: cells[16].sharedGlobalPropertyNames.set,
835
+ uniqueGlobalPropertyNames: cells[16].uniqueGlobalPropertyNames.set,
836
+ FunctionInstance: cells[16].FunctionInstance.set,
837
+ AsyncFunctionInstance: cells[16].AsyncFunctionInstance.set,
838
+ isAccessorPermit: cells[16].isAccessorPermit.set,
839
+ permitted: cells[16].permitted.set,
838
840
  },
839
841
  importMeta: {},
840
842
  });
841
843
  functors[17]({
842
844
  imports(entries) {
843
845
  const map = new Map(entries);
846
+ observeImports(map, "./cauterize-property.js", 15);
844
847
  observeImports(map, "./commons.js", 0);
848
+ observeImports(map, "./permits.js", 16);
845
849
  },
846
850
  liveVar: {
847
851
  },
848
852
  onceVar: {
849
- default: cells[17].default.set,
853
+ makeIntrinsicsCollector: cells[17].makeIntrinsicsCollector.set,
854
+ getGlobalIntrinsics: cells[17].getGlobalIntrinsics.set,
850
855
  },
851
856
  importMeta: {},
852
857
  });
853
858
  functors[18]({
854
859
  imports(entries) {
855
860
  const map = new Map(entries);
861
+ observeImports(map, "./permits.js", 16);
856
862
  observeImports(map, "./commons.js", 0);
863
+ observeImports(map, "./cauterize-property.js", 15);
857
864
  },
858
865
  liveVar: {
859
866
  },
@@ -894,9 +901,7 @@ function observeImports(map, importName, importIndex) {
894
901
  liveVar: {
895
902
  },
896
903
  onceVar: {
897
- minEnablements: cells[21].minEnablements.set,
898
- moderateEnablements: cells[21].moderateEnablements.set,
899
- severeEnablements: cells[21].severeEnablements.set,
904
+ default: cells[21].default.set,
900
905
  },
901
906
  importMeta: {},
902
907
  });
@@ -904,7 +909,6 @@ function observeImports(map, importName, importIndex) {
904
909
  imports(entries) {
905
910
  const map = new Map(entries);
906
911
  observeImports(map, "./commons.js", 0);
907
- observeImports(map, "./enablements.js", 21);
908
912
  },
909
913
  liveVar: {
910
914
  },
@@ -917,23 +921,26 @@ function observeImports(map, importName, importIndex) {
917
921
  imports(entries) {
918
922
  const map = new Map(entries);
919
923
  observeImports(map, "./commons.js", 0);
920
- observeImports(map, "./error/assert.js", 11);
921
924
  },
922
925
  liveVar: {
923
926
  },
924
927
  onceVar: {
925
- default: cells[23].default.set,
928
+ minEnablements: cells[23].minEnablements.set,
929
+ moderateEnablements: cells[23].moderateEnablements.set,
930
+ severeEnablements: cells[23].severeEnablements.set,
926
931
  },
927
932
  importMeta: {},
928
933
  });
929
934
  functors[24]({
930
935
  imports(entries) {
931
936
  const map = new Map(entries);
937
+ observeImports(map, "./commons.js", 0);
938
+ observeImports(map, "./enablements.js", 23);
932
939
  },
933
940
  liveVar: {
934
941
  },
935
942
  onceVar: {
936
- makeEvalFunction: cells[24].makeEvalFunction.set,
943
+ default: cells[24].default.set,
937
944
  },
938
945
  importMeta: {},
939
946
  });
@@ -941,30 +948,23 @@ function observeImports(map, importName, importIndex) {
941
948
  imports(entries) {
942
949
  const map = new Map(entries);
943
950
  observeImports(map, "./commons.js", 0);
944
- observeImports(map, "./error/assert.js", 11);
951
+ observeImports(map, "./error/assert.js", 13);
945
952
  },
946
953
  liveVar: {
947
954
  },
948
955
  onceVar: {
949
- makeFunctionConstructor: cells[25].makeFunctionConstructor.set,
956
+ default: cells[25].default.set,
950
957
  },
951
958
  importMeta: {},
952
959
  });
953
960
  functors[26]({
954
961
  imports(entries) {
955
962
  const map = new Map(entries);
956
- observeImports(map, "./commons.js", 0);
957
- observeImports(map, "./make-eval-function.js", 24);
958
- observeImports(map, "./make-function-constructor.js", 25);
959
- observeImports(map, "./permits.js", 14);
960
963
  },
961
964
  liveVar: {
962
965
  },
963
966
  onceVar: {
964
- setGlobalObjectSymbolUnscopables: cells[26].setGlobalObjectSymbolUnscopables.set,
965
- setGlobalObjectConstantProperties: cells[26].setGlobalObjectConstantProperties.set,
966
- setGlobalObjectMutableProperties: cells[26].setGlobalObjectMutableProperties.set,
967
- setGlobalObjectEvaluators: cells[26].setGlobalObjectEvaluators.set,
967
+ makeEvalFunction: cells[26].makeEvalFunction.set,
968
968
  },
969
969
  importMeta: {},
970
970
  });
@@ -972,14 +972,12 @@ function observeImports(map, importName, importIndex) {
972
972
  imports(entries) {
973
973
  const map = new Map(entries);
974
974
  observeImports(map, "./commons.js", 0);
975
- observeImports(map, "./error/assert.js", 11);
975
+ observeImports(map, "./error/assert.js", 13);
976
976
  },
977
977
  liveVar: {
978
978
  },
979
979
  onceVar: {
980
- alwaysThrowHandler: cells[27].alwaysThrowHandler.set,
981
- strictScopeTerminatorHandler: cells[27].strictScopeTerminatorHandler.set,
982
- strictScopeTerminator: cells[27].strictScopeTerminator.set,
980
+ makeFunctionConstructor: cells[27].makeFunctionConstructor.set,
983
981
  },
984
982
  importMeta: {},
985
983
  });
@@ -987,12 +985,17 @@ function observeImports(map, importName, importIndex) {
987
985
  imports(entries) {
988
986
  const map = new Map(entries);
989
987
  observeImports(map, "./commons.js", 0);
990
- observeImports(map, "./strict-scope-terminator.js", 27);
988
+ observeImports(map, "./make-eval-function.js", 26);
989
+ observeImports(map, "./make-function-constructor.js", 27);
990
+ observeImports(map, "./permits.js", 16);
991
991
  },
992
992
  liveVar: {
993
993
  },
994
994
  onceVar: {
995
- createSloppyGlobalsScopeTerminator: cells[28].createSloppyGlobalsScopeTerminator.set,
995
+ setGlobalObjectSymbolUnscopables: cells[28].setGlobalObjectSymbolUnscopables.set,
996
+ setGlobalObjectConstantProperties: cells[28].setGlobalObjectConstantProperties.set,
997
+ setGlobalObjectMutableProperties: cells[28].setGlobalObjectMutableProperties.set,
998
+ setGlobalObjectEvaluators: cells[28].setGlobalObjectEvaluators.set,
996
999
  },
997
1000
  importMeta: {},
998
1001
  });
@@ -1000,12 +1003,14 @@ function observeImports(map, importName, importIndex) {
1000
1003
  imports(entries) {
1001
1004
  const map = new Map(entries);
1002
1005
  observeImports(map, "./commons.js", 0);
1003
- observeImports(map, "./error/assert.js", 11);
1006
+ observeImports(map, "./error/assert.js", 13);
1004
1007
  },
1005
1008
  liveVar: {
1006
1009
  },
1007
1010
  onceVar: {
1008
- makeEvalScopeKit: cells[29].makeEvalScopeKit.set,
1011
+ alwaysThrowHandler: cells[29].alwaysThrowHandler.set,
1012
+ strictScopeTerminatorHandler: cells[29].strictScopeTerminatorHandler.set,
1013
+ strictScopeTerminator: cells[29].strictScopeTerminator.set,
1009
1014
  },
1010
1015
  importMeta: {},
1011
1016
  });
@@ -1013,11 +1018,12 @@ function observeImports(map, importName, importIndex) {
1013
1018
  imports(entries) {
1014
1019
  const map = new Map(entries);
1015
1020
  observeImports(map, "./commons.js", 0);
1021
+ observeImports(map, "./strict-scope-terminator.js", 29);
1016
1022
  },
1017
1023
  liveVar: {
1018
1024
  },
1019
1025
  onceVar: {
1020
- getSourceURL: cells[30].getSourceURL.set,
1026
+ createSloppyGlobalsScopeTerminator: cells[30].createSloppyGlobalsScopeTerminator.set,
1021
1027
  },
1022
1028
  importMeta: {},
1023
1029
  });
@@ -1025,19 +1031,12 @@ function observeImports(map, importName, importIndex) {
1025
1031
  imports(entries) {
1026
1032
  const map = new Map(entries);
1027
1033
  observeImports(map, "./commons.js", 0);
1028
- observeImports(map, "./get-source-url.js", 30);
1034
+ observeImports(map, "./error/assert.js", 13);
1029
1035
  },
1030
1036
  liveVar: {
1031
1037
  },
1032
1038
  onceVar: {
1033
- rejectHtmlComments: cells[31].rejectHtmlComments.set,
1034
- evadeHtmlCommentTest: cells[31].evadeHtmlCommentTest.set,
1035
- rejectImportExpressions: cells[31].rejectImportExpressions.set,
1036
- evadeImportExpressionTest: cells[31].evadeImportExpressionTest.set,
1037
- rejectSomeDirectEvalExpressions: cells[31].rejectSomeDirectEvalExpressions.set,
1038
- mandatoryTransforms: cells[31].mandatoryTransforms.set,
1039
- applyTransforms: cells[31].applyTransforms.set,
1040
- transforms: cells[31].transforms.set,
1039
+ makeEvalScopeKit: cells[31].makeEvalScopeKit.set,
1041
1040
  },
1042
1041
  importMeta: {},
1043
1042
  });
@@ -1049,8 +1048,7 @@ function observeImports(map, importName, importIndex) {
1049
1048
  liveVar: {
1050
1049
  },
1051
1050
  onceVar: {
1052
- isValidIdentifierName: cells[32].isValidIdentifierName.set,
1053
- getScopeConstants: cells[32].getScopeConstants.set,
1051
+ getSourceURL: cells[32].getSourceURL.set,
1054
1052
  },
1055
1053
  importMeta: {},
1056
1054
  });
@@ -1058,12 +1056,19 @@ function observeImports(map, importName, importIndex) {
1058
1056
  imports(entries) {
1059
1057
  const map = new Map(entries);
1060
1058
  observeImports(map, "./commons.js", 0);
1061
- observeImports(map, "./scope-constants.js", 32);
1059
+ observeImports(map, "./get-source-url.js", 32);
1062
1060
  },
1063
1061
  liveVar: {
1064
1062
  },
1065
1063
  onceVar: {
1066
- makeEvaluate: cells[33].makeEvaluate.set,
1064
+ rejectHtmlComments: cells[33].rejectHtmlComments.set,
1065
+ evadeHtmlCommentTest: cells[33].evadeHtmlCommentTest.set,
1066
+ rejectImportExpressions: cells[33].rejectImportExpressions.set,
1067
+ evadeImportExpressionTest: cells[33].evadeImportExpressionTest.set,
1068
+ rejectSomeDirectEvalExpressions: cells[33].rejectSomeDirectEvalExpressions.set,
1069
+ mandatoryTransforms: cells[33].mandatoryTransforms.set,
1070
+ applyTransforms: cells[33].applyTransforms.set,
1071
+ transforms: cells[33].transforms.set,
1067
1072
  },
1068
1073
  importMeta: {},
1069
1074
  });
@@ -1071,17 +1076,12 @@ function observeImports(map, importName, importIndex) {
1071
1076
  imports(entries) {
1072
1077
  const map = new Map(entries);
1073
1078
  observeImports(map, "./commons.js", 0);
1074
- observeImports(map, "./strict-scope-terminator.js", 27);
1075
- observeImports(map, "./sloppy-globals-scope-terminator.js", 28);
1076
- observeImports(map, "./eval-scope.js", 29);
1077
- observeImports(map, "./transforms.js", 31);
1078
- observeImports(map, "./make-evaluate.js", 33);
1079
- observeImports(map, "./error/assert.js", 11);
1080
1079
  },
1081
1080
  liveVar: {
1082
1081
  },
1083
1082
  onceVar: {
1084
- makeSafeEvaluator: cells[34].makeSafeEvaluator.set,
1083
+ isValidIdentifierName: cells[34].isValidIdentifierName.set,
1084
+ getScopeConstants: cells[34].getScopeConstants.set,
1085
1085
  },
1086
1086
  importMeta: {},
1087
1087
  });
@@ -1089,11 +1089,12 @@ function observeImports(map, importName, importIndex) {
1089
1089
  imports(entries) {
1090
1090
  const map = new Map(entries);
1091
1091
  observeImports(map, "./commons.js", 0);
1092
+ observeImports(map, "./scope-constants.js", 34);
1092
1093
  },
1093
1094
  liveVar: {
1094
1095
  },
1095
1096
  onceVar: {
1096
- tameFunctionToString: cells[35].tameFunctionToString.set,
1097
+ makeEvaluate: cells[35].makeEvaluate.set,
1097
1098
  },
1098
1099
  importMeta: {},
1099
1100
  });
@@ -1101,11 +1102,17 @@ function observeImports(map, importName, importIndex) {
1101
1102
  imports(entries) {
1102
1103
  const map = new Map(entries);
1103
1104
  observeImports(map, "./commons.js", 0);
1105
+ observeImports(map, "./strict-scope-terminator.js", 29);
1106
+ observeImports(map, "./sloppy-globals-scope-terminator.js", 30);
1107
+ observeImports(map, "./eval-scope.js", 31);
1108
+ observeImports(map, "./transforms.js", 33);
1109
+ observeImports(map, "./make-evaluate.js", 35);
1110
+ observeImports(map, "./error/assert.js", 13);
1104
1111
  },
1105
1112
  liveVar: {
1106
1113
  },
1107
1114
  onceVar: {
1108
- tameDomains: cells[36].tameDomains.set,
1115
+ makeSafeEvaluator: cells[36].makeSafeEvaluator.set,
1109
1116
  },
1110
1117
  importMeta: {},
1111
1118
  });
@@ -1117,37 +1124,31 @@ function observeImports(map, importName, importIndex) {
1117
1124
  liveVar: {
1118
1125
  },
1119
1126
  onceVar: {
1120
- tameModuleSource: cells[37].tameModuleSource.set,
1127
+ tameFunctionToString: cells[37].tameFunctionToString.set,
1121
1128
  },
1122
1129
  importMeta: {},
1123
1130
  });
1124
1131
  functors[38]({
1125
1132
  imports(entries) {
1126
1133
  const map = new Map(entries);
1127
- observeImports(map, "../commons.js", 0);
1134
+ observeImports(map, "./commons.js", 0);
1128
1135
  },
1129
1136
  liveVar: {
1130
1137
  },
1131
1138
  onceVar: {
1132
- consoleLevelMethods: cells[38].consoleLevelMethods.set,
1133
- consoleOtherMethods: cells[38].consoleOtherMethods.set,
1134
- makeLoggingConsoleKit: cells[38].makeLoggingConsoleKit.set,
1135
- pumpLogToConsole: cells[38].pumpLogToConsole.set,
1136
- makeCausalConsole: cells[38].makeCausalConsole.set,
1137
- defineCausalConsoleFromLogger: cells[38].defineCausalConsoleFromLogger.set,
1138
- filterConsole: cells[38].filterConsole.set,
1139
+ tameDomains: cells[38].tameDomains.set,
1139
1140
  },
1140
1141
  importMeta: {},
1141
1142
  });
1142
1143
  functors[39]({
1143
1144
  imports(entries) {
1144
1145
  const map = new Map(entries);
1145
- observeImports(map, "../commons.js", 0);
1146
+ observeImports(map, "./commons.js", 0);
1146
1147
  },
1147
1148
  liveVar: {
1148
1149
  },
1149
1150
  onceVar: {
1150
- makeRejectionHandlers: cells[39].makeRejectionHandlers.set,
1151
+ tameModuleSource: cells[39].tameModuleSource.set,
1151
1152
  },
1152
1153
  importMeta: {},
1153
1154
  });
@@ -1155,14 +1156,17 @@ function observeImports(map, importName, importIndex) {
1155
1156
  imports(entries) {
1156
1157
  const map = new Map(entries);
1157
1158
  observeImports(map, "../commons.js", 0);
1158
- observeImports(map, "./assert.js", 11);
1159
- observeImports(map, "./console.js", 38);
1160
- observeImports(map, "./unhandled-rejection.js", 39);
1161
1159
  },
1162
1160
  liveVar: {
1163
1161
  },
1164
1162
  onceVar: {
1165
- tameConsole: cells[40].tameConsole.set,
1163
+ consoleLevelMethods: cells[40].consoleLevelMethods.set,
1164
+ consoleOtherMethods: cells[40].consoleOtherMethods.set,
1165
+ makeLoggingConsoleKit: cells[40].makeLoggingConsoleKit.set,
1166
+ pumpLogToConsole: cells[40].pumpLogToConsole.set,
1167
+ makeCausalConsole: cells[40].makeCausalConsole.set,
1168
+ defineCausalConsoleFromLogger: cells[40].defineCausalConsoleFromLogger.set,
1169
+ filterConsole: cells[40].filterConsole.set,
1166
1170
  },
1167
1171
  importMeta: {},
1168
1172
  });
@@ -1174,9 +1178,7 @@ function observeImports(map, importName, importIndex) {
1174
1178
  liveVar: {
1175
1179
  },
1176
1180
  onceVar: {
1177
- filterFileName: cells[41].filterFileName.set,
1178
- shortenCallSiteString: cells[41].shortenCallSiteString.set,
1179
- tameV8ErrorConstructor: cells[41].tameV8ErrorConstructor.set,
1181
+ makeRejectionHandlers: cells[41].makeRejectionHandlers.set,
1180
1182
  },
1181
1183
  importMeta: {},
1182
1184
  });
@@ -1184,126 +1186,119 @@ function observeImports(map, importName, importIndex) {
1184
1186
  imports(entries) {
1185
1187
  const map = new Map(entries);
1186
1188
  observeImports(map, "../commons.js", 0);
1187
- observeImports(map, "../permits.js", 14);
1188
- observeImports(map, "./tame-v8-error-constructor.js", 41);
1189
+ observeImports(map, "./assert.js", 13);
1190
+ observeImports(map, "./console.js", 40);
1191
+ observeImports(map, "./unhandled-rejection.js", 41);
1189
1192
  },
1190
1193
  liveVar: {
1191
1194
  },
1192
1195
  onceVar: {
1193
- default: cells[42].default.set,
1196
+ tameConsole: cells[42].tameConsole.set,
1194
1197
  },
1195
1198
  importMeta: {},
1196
1199
  });
1197
1200
  functors[43]({
1198
1201
  imports(entries) {
1199
1202
  const map = new Map(entries);
1200
- observeImports(map, "@endo/env-options", 3);
1201
- observeImports(map, "./commons.js", 0);
1202
- observeImports(map, "./error/assert.js", 11);
1203
+ observeImports(map, "../commons.js", 0);
1203
1204
  },
1204
1205
  liveVar: {
1205
1206
  },
1206
1207
  onceVar: {
1207
- makeAlias: cells[43].makeAlias.set,
1208
- load: cells[43].load.set,
1209
- loadNow: cells[43].loadNow.set,
1208
+ filterFileName: cells[43].filterFileName.set,
1209
+ shortenCallSiteString: cells[43].shortenCallSiteString.set,
1210
+ tameV8ErrorConstructor: cells[43].tameV8ErrorConstructor.set,
1210
1211
  },
1211
1212
  importMeta: {},
1212
1213
  });
1213
1214
  functors[44]({
1214
1215
  imports(entries) {
1215
1216
  const map = new Map(entries);
1216
- observeImports(map, "./module-load.js", 43);
1217
- observeImports(map, "./commons.js", 0);
1218
- observeImports(map, "./error/assert.js", 11);
1217
+ observeImports(map, "../commons.js", 0);
1218
+ observeImports(map, "../permits.js", 16);
1219
+ observeImports(map, "./tame-v8-error-constructor.js", 43);
1219
1220
  },
1220
1221
  liveVar: {
1221
1222
  },
1222
1223
  onceVar: {
1223
- deferExports: cells[44].deferExports.set,
1224
- getDeferredExports: cells[44].getDeferredExports.set,
1224
+ default: cells[44].default.set,
1225
1225
  },
1226
1226
  importMeta: {},
1227
1227
  });
1228
1228
  functors[45]({
1229
1229
  imports(entries) {
1230
1230
  const map = new Map(entries);
1231
+ observeImports(map, "@endo/env-options", 3);
1231
1232
  observeImports(map, "./commons.js", 0);
1232
- observeImports(map, "./transforms.js", 31);
1233
- observeImports(map, "./make-safe-evaluator.js", 34);
1233
+ observeImports(map, "./error/assert.js", 13);
1234
1234
  },
1235
1235
  liveVar: {
1236
1236
  },
1237
1237
  onceVar: {
1238
- provideCompartmentEvaluator: cells[45].provideCompartmentEvaluator.set,
1239
- compartmentEvaluate: cells[45].compartmentEvaluate.set,
1238
+ makeAlias: cells[45].makeAlias.set,
1239
+ load: cells[45].load.set,
1240
+ loadNow: cells[45].loadNow.set,
1240
1241
  },
1241
1242
  importMeta: {},
1242
1243
  });
1243
1244
  functors[46]({
1244
1245
  imports(entries) {
1245
1246
  const map = new Map(entries);
1246
- observeImports(map, "./error/assert.js", 11);
1247
- observeImports(map, "./module-proxy.js", 44);
1247
+ observeImports(map, "./module-load.js", 45);
1248
1248
  observeImports(map, "./commons.js", 0);
1249
- observeImports(map, "./compartment-evaluate.js", 45);
1249
+ observeImports(map, "./error/assert.js", 13);
1250
1250
  },
1251
1251
  liveVar: {
1252
1252
  },
1253
1253
  onceVar: {
1254
- makeVirtualModuleInstance: cells[46].makeVirtualModuleInstance.set,
1255
- makeModuleInstance: cells[46].makeModuleInstance.set,
1254
+ deferExports: cells[46].deferExports.set,
1255
+ getDeferredExports: cells[46].getDeferredExports.set,
1256
1256
  },
1257
1257
  importMeta: {},
1258
1258
  });
1259
1259
  functors[47]({
1260
1260
  imports(entries) {
1261
1261
  const map = new Map(entries);
1262
- observeImports(map, "./error/assert.js", 11);
1263
- observeImports(map, "./module-instance.js", 46);
1264
1262
  observeImports(map, "./commons.js", 0);
1263
+ observeImports(map, "./transforms.js", 33);
1264
+ observeImports(map, "./make-safe-evaluator.js", 36);
1265
1265
  },
1266
1266
  liveVar: {
1267
1267
  },
1268
1268
  onceVar: {
1269
- link: cells[47].link.set,
1270
- instantiate: cells[47].instantiate.set,
1269
+ provideCompartmentEvaluator: cells[47].provideCompartmentEvaluator.set,
1270
+ compartmentEvaluate: cells[47].compartmentEvaluate.set,
1271
1271
  },
1272
1272
  importMeta: {},
1273
1273
  });
1274
1274
  functors[48]({
1275
1275
  imports(entries) {
1276
1276
  const map = new Map(entries);
1277
+ observeImports(map, "./error/assert.js", 13);
1278
+ observeImports(map, "./module-proxy.js", 46);
1277
1279
  observeImports(map, "./commons.js", 0);
1278
- observeImports(map, "./global-object.js", 26);
1279
- observeImports(map, "./error/assert.js", 11);
1280
- observeImports(map, "./permits.js", 14);
1281
- observeImports(map, "./module-load.js", 43);
1282
- observeImports(map, "./module-link.js", 47);
1283
- observeImports(map, "./module-proxy.js", 44);
1284
- observeImports(map, "./compartment-evaluate.js", 45);
1285
- observeImports(map, "./make-safe-evaluator.js", 34);
1280
+ observeImports(map, "./compartment-evaluate.js", 47);
1286
1281
  },
1287
1282
  liveVar: {
1288
1283
  },
1289
1284
  onceVar: {
1290
- InertCompartment: cells[48].InertCompartment.set,
1291
- CompartmentPrototype: cells[48].CompartmentPrototype.set,
1292
- compartmentOptions: cells[48].compartmentOptions.set,
1293
- makeCompartmentConstructor: cells[48].makeCompartmentConstructor.set,
1285
+ makeVirtualModuleInstance: cells[48].makeVirtualModuleInstance.set,
1286
+ makeModuleInstance: cells[48].makeModuleInstance.set,
1294
1287
  },
1295
1288
  importMeta: {},
1296
1289
  });
1297
1290
  functors[49]({
1298
1291
  imports(entries) {
1299
1292
  const map = new Map(entries);
1293
+ observeImports(map, "./error/assert.js", 13);
1294
+ observeImports(map, "./module-instance.js", 48);
1300
1295
  observeImports(map, "./commons.js", 0);
1301
- observeImports(map, "./compartment.js", 48);
1302
1296
  },
1303
1297
  liveVar: {
1304
1298
  },
1305
1299
  onceVar: {
1306
- getAnonymousIntrinsics: cells[49].getAnonymousIntrinsics.set,
1300
+ link: cells[49].link.set,
1301
+ instantiate: cells[49].instantiate.set,
1307
1302
  },
1308
1303
  importMeta: {},
1309
1304
  });
@@ -1311,11 +1306,22 @@ function observeImports(map, importName, importIndex) {
1311
1306
  imports(entries) {
1312
1307
  const map = new Map(entries);
1313
1308
  observeImports(map, "./commons.js", 0);
1309
+ observeImports(map, "./global-object.js", 28);
1310
+ observeImports(map, "./error/assert.js", 13);
1311
+ observeImports(map, "./permits.js", 16);
1312
+ observeImports(map, "./module-load.js", 45);
1313
+ observeImports(map, "./module-link.js", 49);
1314
+ observeImports(map, "./module-proxy.js", 46);
1315
+ observeImports(map, "./compartment-evaluate.js", 47);
1316
+ observeImports(map, "./make-safe-evaluator.js", 36);
1314
1317
  },
1315
1318
  liveVar: {
1316
1319
  },
1317
1320
  onceVar: {
1318
- tameHarden: cells[50].tameHarden.set,
1321
+ InertCompartment: cells[50].InertCompartment.set,
1322
+ CompartmentPrototype: cells[50].CompartmentPrototype.set,
1323
+ compartmentOptions: cells[50].compartmentOptions.set,
1324
+ makeCompartmentConstructor: cells[50].makeCompartmentConstructor.set,
1319
1325
  },
1320
1326
  importMeta: {},
1321
1327
  });
@@ -1323,11 +1329,12 @@ function observeImports(map, importName, importIndex) {
1323
1329
  imports(entries) {
1324
1330
  const map = new Map(entries);
1325
1331
  observeImports(map, "./commons.js", 0);
1332
+ observeImports(map, "./compartment.js", 50);
1326
1333
  },
1327
1334
  liveVar: {
1328
1335
  },
1329
1336
  onceVar: {
1330
- tameSymbolConstructor: cells[51].tameSymbolConstructor.set,
1337
+ getAnonymousIntrinsics: cells[51].getAnonymousIntrinsics.set,
1331
1338
  },
1332
1339
  importMeta: {},
1333
1340
  });
@@ -1339,8 +1346,7 @@ function observeImports(map, importName, importIndex) {
1339
1346
  liveVar: {
1340
1347
  },
1341
1348
  onceVar: {
1342
- tameFauxDataProperty: cells[52].tameFauxDataProperty.set,
1343
- tameFauxDataProperties: cells[52].tameFauxDataProperties.set,
1349
+ tameHarden: cells[52].tameHarden.set,
1344
1350
  },
1345
1351
  importMeta: {},
1346
1352
  });
@@ -1352,7 +1358,7 @@ function observeImports(map, importName, importIndex) {
1352
1358
  liveVar: {
1353
1359
  },
1354
1360
  onceVar: {
1355
- tameRegeneratorRuntime: cells[53].tameRegeneratorRuntime.set,
1361
+ tameSymbolConstructor: cells[53].tameSymbolConstructor.set,
1356
1362
  },
1357
1363
  importMeta: {},
1358
1364
  });
@@ -1364,7 +1370,8 @@ function observeImports(map, importName, importIndex) {
1364
1370
  liveVar: {
1365
1371
  },
1366
1372
  onceVar: {
1367
- shimArrayBufferTransfer: cells[54].shimArrayBufferTransfer.set,
1373
+ tameFauxDataProperty: cells[54].tameFauxDataProperty.set,
1374
+ tameFauxDataProperties: cells[54].tameFauxDataProperties.set,
1368
1375
  },
1369
1376
  importMeta: {},
1370
1377
  });
@@ -1372,89 +1379,86 @@ function observeImports(map, importName, importIndex) {
1372
1379
  imports(entries) {
1373
1380
  const map = new Map(entries);
1374
1381
  observeImports(map, "./commons.js", 0);
1375
- observeImports(map, "./error/assert.js", 11);
1376
1382
  },
1377
1383
  liveVar: {
1378
1384
  },
1379
1385
  onceVar: {
1380
- chooseReporter: cells[55].chooseReporter.set,
1381
- reportInGroup: cells[55].reportInGroup.set,
1386
+ tameRegeneratorRuntime: cells[55].tameRegeneratorRuntime.set,
1382
1387
  },
1383
1388
  importMeta: {},
1384
1389
  });
1385
1390
  functors[56]({
1386
1391
  imports(entries) {
1387
1392
  const map = new Map(entries);
1388
- observeImports(map, "@endo/env-options", 3);
1389
- observeImports(map, "@endo/immutable-arraybuffer/shim.js", 5);
1390
1393
  observeImports(map, "./commons.js", 0);
1391
- observeImports(map, "./make-hardener.js", 12);
1392
- observeImports(map, "./intrinsics.js", 15);
1393
- observeImports(map, "./permits-intrinsics.js", 16);
1394
- observeImports(map, "./tame-function-constructors.js", 17);
1395
- observeImports(map, "./tame-date-constructor.js", 18);
1396
- observeImports(map, "./tame-math-object.js", 19);
1397
- observeImports(map, "./tame-regexp-constructor.js", 20);
1398
- observeImports(map, "./enable-property-overrides.js", 22);
1399
- observeImports(map, "./tame-locale-methods.js", 23);
1400
- observeImports(map, "./global-object.js", 26);
1401
- observeImports(map, "./make-safe-evaluator.js", 34);
1402
- observeImports(map, "./permits.js", 14);
1403
- observeImports(map, "./tame-function-tostring.js", 35);
1404
- observeImports(map, "./tame-domains.js", 36);
1405
- observeImports(map, "./tame-module-source.js", 37);
1406
- observeImports(map, "./error/tame-console.js", 40);
1407
- observeImports(map, "./error/tame-error-constructor.js", 42);
1408
- observeImports(map, "./error/assert.js", 11);
1409
- observeImports(map, "./get-anonymous-intrinsics.js", 49);
1410
- observeImports(map, "./compartment.js", 48);
1411
- observeImports(map, "./tame-harden.js", 50);
1412
- observeImports(map, "./tame-symbol-constructor.js", 51);
1413
- observeImports(map, "./tame-faux-data-properties.js", 52);
1414
- observeImports(map, "./tame-regenerator-runtime.js", 53);
1415
- observeImports(map, "./shim-arraybuffer-transfer.js", 54);
1416
- observeImports(map, "./reporting.js", 55);
1417
1394
  },
1418
1395
  liveVar: {
1419
1396
  },
1420
1397
  onceVar: {
1421
- repairIntrinsics: cells[56].repairIntrinsics.set,
1398
+ shimArrayBufferTransfer: cells[56].shimArrayBufferTransfer.set,
1422
1399
  },
1423
1400
  importMeta: {},
1424
1401
  });
1425
1402
  functors[57]({
1426
1403
  imports(entries) {
1427
1404
  const map = new Map(entries);
1428
- observeImports(map, "./assert-sloppy-mode.js", 1);
1429
1405
  observeImports(map, "./commons.js", 0);
1430
- observeImports(map, "./lockdown.js", 56);
1406
+ observeImports(map, "./error/assert.js", 13);
1431
1407
  },
1432
1408
  liveVar: {
1433
1409
  },
1434
1410
  onceVar: {
1411
+ chooseReporter: cells[57].chooseReporter.set,
1412
+ reportInGroup: cells[57].reportInGroup.set,
1435
1413
  },
1436
1414
  importMeta: {},
1437
1415
  });
1438
1416
  functors[58]({
1439
1417
  imports(entries) {
1440
1418
  const map = new Map(entries);
1419
+ observeImports(map, "@endo/env-options", 3);
1420
+ observeImports(map, "@endo/immutable-arraybuffer/shim.js", 6);
1441
1421
  observeImports(map, "./commons.js", 0);
1442
- observeImports(map, "./compartment.js", 48);
1443
- observeImports(map, "./tame-function-tostring.js", 35);
1444
- observeImports(map, "./intrinsics.js", 15);
1445
- observeImports(map, "./reporting.js", 55);
1422
+ observeImports(map, "./make-hardener.js", 14);
1423
+ observeImports(map, "./intrinsics.js", 17);
1424
+ observeImports(map, "./permits-intrinsics.js", 18);
1425
+ observeImports(map, "./tame-function-constructors.js", 19);
1426
+ observeImports(map, "./tame-date-constructor.js", 20);
1427
+ observeImports(map, "./tame-math-object.js", 21);
1428
+ observeImports(map, "./tame-regexp-constructor.js", 22);
1429
+ observeImports(map, "./enable-property-overrides.js", 24);
1430
+ observeImports(map, "./tame-locale-methods.js", 25);
1431
+ observeImports(map, "./global-object.js", 28);
1432
+ observeImports(map, "./make-safe-evaluator.js", 36);
1433
+ observeImports(map, "./permits.js", 16);
1434
+ observeImports(map, "./tame-function-tostring.js", 37);
1435
+ observeImports(map, "./tame-domains.js", 38);
1436
+ observeImports(map, "./tame-module-source.js", 39);
1437
+ observeImports(map, "./error/tame-console.js", 42);
1438
+ observeImports(map, "./error/tame-error-constructor.js", 44);
1439
+ observeImports(map, "./error/assert.js", 13);
1440
+ observeImports(map, "./get-anonymous-intrinsics.js", 51);
1441
+ observeImports(map, "./compartment.js", 50);
1442
+ observeImports(map, "./tame-harden.js", 52);
1443
+ observeImports(map, "./tame-symbol-constructor.js", 53);
1444
+ observeImports(map, "./tame-faux-data-properties.js", 54);
1445
+ observeImports(map, "./tame-regenerator-runtime.js", 55);
1446
+ observeImports(map, "./shim-arraybuffer-transfer.js", 56);
1447
+ observeImports(map, "./reporting.js", 57);
1446
1448
  },
1447
1449
  liveVar: {
1448
1450
  },
1449
1451
  onceVar: {
1452
+ repairIntrinsics: cells[58].repairIntrinsics.set,
1450
1453
  },
1451
1454
  importMeta: {},
1452
1455
  });
1453
1456
  functors[59]({
1454
1457
  imports(entries) {
1455
1458
  const map = new Map(entries);
1459
+ observeImports(map, "./assert-sloppy-mode.js", 1);
1456
1460
  observeImports(map, "./commons.js", 0);
1457
- observeImports(map, "./error/assert.js", 11);
1461
+ observeImports(map, "./lockdown.js", 58);
1458
1462
  },
1459
1463
  liveVar: {
1460
1464
  },
@@ -1466,8 +1470,10 @@ function observeImports(map, importName, importIndex) {
1466
1470
  imports(entries) {
1467
1471
  const map = new Map(entries);
1468
1472
  observeImports(map, "./commons.js", 0);
1469
- observeImports(map, "./error/console.js", 38);
1470
- observeImports(map, "./error/assert.js", 11);
1473
+ observeImports(map, "./compartment.js", 50);
1474
+ observeImports(map, "./tame-function-tostring.js", 37);
1475
+ observeImports(map, "./intrinsics.js", 17);
1476
+ observeImports(map, "./reporting.js", 57);
1471
1477
  },
1472
1478
  liveVar: {
1473
1479
  },
@@ -1478,10 +1484,35 @@ function observeImports(map, importName, importIndex) {
1478
1484
  functors[61]({
1479
1485
  imports(entries) {
1480
1486
  const map = new Map(entries);
1481
- observeImports(map, "./src/lockdown-shim.js", 57);
1482
- observeImports(map, "./src/compartment-shim.js", 58);
1483
- observeImports(map, "./src/assert-shim.js", 59);
1484
- observeImports(map, "./src/console-shim.js", 60);
1487
+ observeImports(map, "./commons.js", 0);
1488
+ observeImports(map, "./error/assert.js", 13);
1489
+ },
1490
+ liveVar: {
1491
+ },
1492
+ onceVar: {
1493
+ },
1494
+ importMeta: {},
1495
+ });
1496
+ functors[62]({
1497
+ imports(entries) {
1498
+ const map = new Map(entries);
1499
+ observeImports(map, "./commons.js", 0);
1500
+ observeImports(map, "./error/console.js", 40);
1501
+ observeImports(map, "./error/assert.js", 13);
1502
+ },
1503
+ liveVar: {
1504
+ },
1505
+ onceVar: {
1506
+ },
1507
+ importMeta: {},
1508
+ });
1509
+ functors[63]({
1510
+ imports(entries) {
1511
+ const map = new Map(entries);
1512
+ observeImports(map, "./src/lockdown-shim.js", 59);
1513
+ observeImports(map, "./src/compartment-shim.js", 60);
1514
+ observeImports(map, "./src/assert-shim.js", 61);
1515
+ observeImports(map, "./src/console-shim.js", 62);
1485
1516
  },
1486
1517
  liveVar: {
1487
1518
  },
@@ -1572,7 +1603,8 @@ const universalThis = globalThis;$h͏_once.universalThis(universalThis);
1572
1603
  setPrototypeOf,
1573
1604
  values,
1574
1605
  fromEntries,
1575
- } = 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);
1606
+ hasOwn,
1607
+ } = 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);$h͏_once.hasOwn(hasOwn);
1576
1608
 
1577
1609
  const {
1578
1610
  species: speciesSymbol,
@@ -1660,8 +1692,11 @@ const { bind } = functionPrototype;
1660
1692
  * @type {<F extends (this: any, ...args: any[]) => any>(fn: F) => ((thisArg: ThisParameterType<F>, ...args: Parameters<F>) => ReturnType<F>)}
1661
1693
  */
1662
1694
  const uncurryThis = bind.bind(bind.call); // eslint-disable-line @endo/no-polymorphic-call
1663
- $h͏_once.uncurryThis(uncurryThis);
1664
- const objectHasOwnProperty = uncurryThis(objectPrototype.hasOwnProperty);
1695
+
1696
+ /**
1697
+ * @deprecated Use `hasOwn` instead
1698
+ */$h͏_once.uncurryThis(uncurryThis);
1699
+ const objectHasOwnProperty = hasOwn;
1665
1700
  //
1666
1701
  $h͏_once.objectHasOwnProperty(objectHasOwnProperty);const arrayFilter=uncurryThis(arrayPrototype.filter);$h͏_once.arrayFilter(arrayFilter);
1667
1702
  const arrayForEach = uncurryThis(arrayPrototype.forEach);$h͏_once.arrayForEach(arrayForEach);
@@ -1767,23 +1802,20 @@ $h͏_once.promiseThen(promiseThen);const finalizationRegistryRegister=
1767
1802
  reflectGet(getPrototypeOf(fn), 'constructor');
1768
1803
 
1769
1804
  /**
1770
- * isObject tests whether a value is an object.
1771
- * Today, this is equivalent to:
1805
+ * TODO Consolidate with `isPrimitive` that's currently in `@endo/pass-style`.
1806
+ * Layering constraints make this tricky, which is why we haven't yet figured
1807
+ * out how to do this.
1772
1808
  *
1773
- * const isObject = value => {
1774
- * if (value === null) return false;
1775
- * const type = typeof value;
1776
- * return type === 'object' || type === 'function';
1777
- * };
1778
- *
1779
- * But this is not safe in the face of possible evolution of the language, for
1780
- * example new types or semantics of records and tuples.
1781
- * We use this implementation despite the unnecessary allocation implied by
1782
- * attempting to box a primitive.
1783
- *
1784
- * @param {any} value
1809
+ * @type {(val: unknown) => val is (undefined
1810
+ * | null
1811
+ * | boolean
1812
+ * | number
1813
+ * | bigint
1814
+ * | string
1815
+ * | symbol)}
1785
1816
  */$h͏_once.getConstructorOf(getConstructorOf);
1786
- const isObject = value => Object(value) === value;
1817
+ const isPrimitive = val =>
1818
+ !val || (typeof val !== 'object' && typeof val !== 'function');
1787
1819
 
1788
1820
  /**
1789
1821
  * isError tests whether an object inherits from the intrinsic
@@ -1795,7 +1827,7 @@ $h͏_once.promiseThen(promiseThen);const finalizationRegistryRegister=
1795
1827
  * for such a trivial case outside commons.js, we provide a utility function.
1796
1828
  *
1797
1829
  * @param {any} value
1798
- */$h͏_once.isObject(isObject);
1830
+ */$h͏_once.isPrimitive(isPrimitive);
1799
1831
  const isError = value => value instanceof FERAL_ERROR;
1800
1832
 
1801
1833
  /**
@@ -1944,6 +1976,10 @@ if (getThis()) {
1944
1976
  // Prelude of cheap good - enough imitations of things we'd use or
1945
1977
  // do differently if we could depend on ses
1946
1978
 
1979
+ // eslint-disable-next-line no-restricted-globals
1980
+ const localThis = globalThis;
1981
+
1982
+ const { Object, Reflect, Array, String, JSON, Error } = localThis;
1947
1983
  const { freeze } = Object;
1948
1984
  const { apply } = Reflect;
1949
1985
 
@@ -2078,272 +2114,298 @@ freeze(makeEnvironmentCaptor);
2078
2114
  getEnvironmentOption,
2079
2115
  getEnvironmentOptionsList,
2080
2116
  environmentOptionsListHas,
2081
- } = makeEnvironmentCaptor(globalThis, true);$h͏_once.getEnvironmentOption(getEnvironmentOption);$h͏_once.getEnvironmentOptionsList(getEnvironmentOptionsList);$h͏_once.environmentOptionsListHas(environmentOptionsListHas);
2117
+ } = makeEnvironmentCaptor(localThis, true);$h͏_once.getEnvironmentOption(getEnvironmentOption);$h͏_once.getEnvironmentOptionsList(getEnvironmentOptionsList);$h͏_once.environmentOptionsListHas(environmentOptionsListHas);
2082
2118
  })()
2083
2119
  ,
2084
2120
  // === 3. env-options ./index.js ===
2085
2121
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([["./src/env-options.js", []]]);
2086
2122
  })()
2087
2123
  ,
2088
- // === 4. immutable-arraybuffer ./index.js ===
2124
+ // === 4. immutable-arraybuffer ./src/immutable-arraybuffer-pony.js ===
2089
2125
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);/* global globalThis */
2090
2126
 
2091
- const { setPrototypeOf, getOwnPropertyDescriptors, defineProperties } = Object;
2092
- const { apply } = Reflect;
2127
+ const {
2128
+ ArrayBuffer,
2129
+ Object,
2130
+ Reflect,
2131
+ Symbol,
2132
+ TypeError,
2133
+ Uint8Array,
2134
+ WeakMap,
2135
+ // Capture structuredClone before it can be scuttled.
2136
+ structuredClone: optStructuredClone
2137
+ // eslint-disable-next-line no-restricted-globals
2138
+ } = globalThis;
2139
+
2140
+ const { freeze, defineProperty, getPrototypeOf, getOwnPropertyDescriptor } =
2141
+ Object;
2142
+ const { apply, ownKeys } = Reflect;
2143
+ const { toStringTag } = Symbol;
2144
+
2093
2145
  const { prototype: arrayBufferPrototype } = ArrayBuffer;
2094
- // Capture structuredClone before it could be scuttled.
2095
- const { structuredClone: originalStructuredCloneMaybe } = globalThis;
2146
+ const { slice, transfer: optTransfer } = arrayBufferPrototype;
2147
+ // @ts-expect-error TS doesn't know it'll be there
2148
+ const { get: arrayBufferByteLength } = getOwnPropertyDescriptor(
2149
+ arrayBufferPrototype,
2150
+ 'byteLength',
2151
+ );
2096
2152
 
2097
- const {
2098
- slice,
2099
- // TODO used to be a-ts-expect-error, but my local IDE's TS server
2100
- // seems to use a more recent definition of the `ArrayBuffer` type.
2101
- // @ts-ignore At the time of this writing, the `ArrayBuffer` type built
2102
- // into TypeScript does not know about the recent standard `transfer` method.
2103
- // Indeed, the `transfer` method is absent from Node <= 20.
2104
- transfer,
2105
- } = arrayBufferPrototype;
2153
+ const typedArrayPrototype = getPrototypeOf(Uint8Array.prototype);
2154
+ const { set: uint8ArraySet } = typedArrayPrototype;
2155
+ // @ts-expect-error TS doesn't know it'll be there
2156
+ const { get: uint8ArrayBuffer } = getOwnPropertyDescriptor(
2157
+ typedArrayPrototype,
2158
+ 'buffer',
2159
+ );
2106
2160
 
2107
2161
  /**
2108
- * Enforces that `arrayBuffer` is a genuine `ArrayBuffer` exotic object.
2162
+ * Copy a range of values from a genuine ArrayBuffer exotic object into a new
2163
+ * ArrayBuffer.
2109
2164
  *
2110
- * @param {ArrayBuffer} arrayBuffer
2165
+ * @param {ArrayBuffer} realBuffer
2111
2166
  * @param {number} [start]
2112
2167
  * @param {number} [end]
2113
2168
  * @returns {ArrayBuffer}
2114
2169
  */
2115
- const arrayBufferSlice = (arrayBuffer, start = undefined, end = undefined) =>
2116
- apply(slice, arrayBuffer, [start, end]);
2170
+ const arrayBufferSlice = (realBuffer, start = undefined, end = undefined) =>
2171
+ apply(slice, realBuffer, [start, end]);
2117
2172
 
2118
2173
  /**
2119
- * Enforces that `arrayBuffer` is a genuine `ArrayBuffer` exotic object.
2120
- * Return a new fresh `ArrayBuffer` exotic object, where the contents of the
2121
- * original `arrayBuffer` has been moved into the new one, and the original
2122
- * `arrayBuffer` has been detached.
2174
+ * Move the contents of a genuine ArrayBuffer exotic object into a new fresh
2175
+ * ArrayBuffer and detach the original source.
2176
+ * We can only do this on platforms that support `structuredClone` or
2177
+ * `ArrayBuffer.prototype.transfer`.
2178
+ * On other platforms, we can still emulate
2179
+ * `ArrayBuffer.prototoype.sliceToImmutable`, but not
2180
+ * `ArrayBuffer.prototype.transferToImmutable`.
2181
+ * Currently, these known-deficient platforms are
2182
+ * - Hermes
2183
+ * - Node.js <= 16
2184
+ * - Apparently some versions of JavaScriptCore that are still of concern.
2123
2185
  *
2124
2186
  * @param {ArrayBuffer} arrayBuffer
2125
2187
  * @returns {ArrayBuffer}
2126
2188
  */
2127
- let arrayBufferTransfer;
2189
+ let optArrayBufferTransfer;
2128
2190
 
2129
- if (transfer) {
2130
- arrayBufferTransfer = arrayBuffer => apply(transfer, arrayBuffer, []);
2131
- } else if (originalStructuredCloneMaybe) {
2132
- arrayBufferTransfer = arrayBuffer => {
2191
+ if (optTransfer) {
2192
+ optArrayBufferTransfer = arrayBuffer => apply(optTransfer, arrayBuffer, []);
2193
+ } else if (optStructuredClone) {
2194
+ optArrayBufferTransfer = arrayBuffer => {
2133
2195
  // Hopefully, a zero-length slice is cheap, but still enforces that
2134
2196
  // `arrayBuffer` is a genuine `ArrayBuffer` exotic object.
2135
2197
  arrayBufferSlice(arrayBuffer, 0, 0);
2136
- return originalStructuredCloneMaybe(arrayBuffer, {
2198
+ return optStructuredClone(arrayBuffer, {
2137
2199
  transfer: [arrayBuffer],
2138
2200
  });
2139
2201
  };
2140
2202
  } else {
2141
- // Indeed, Node <= 16 has neither.
2142
- throw TypeError(
2143
- `Can only emulate immutable ArrayBuffer on a platform with either "structuredClone" or "ArrayBuffer.prototype.transfer"`,
2144
- );
2203
+ // Assignment is redundant, but remains for clarity.
2204
+ optArrayBufferTransfer = undefined;
2145
2205
  }
2146
2206
 
2147
2207
  /**
2148
- * This class only exists as an artifact of this ponyfill and shim,
2149
- * as a convenience for imperfectly emulating the
2150
- * *Immutable ArrayBuffer* proposal, which would not have this class.
2151
- * In the proposal,
2152
- * `transferToImmutable` makes a new `ArrayBuffer` that inherits directly from
2153
- * `ArrayBuffer.prototype` as you'd expect. In the ponyfill and shim,
2154
- * `transferToImmutable` makes a normal object that inherits directly from
2155
- * `immutableArrayBufferPrototype`, which has been surgically
2156
- * altered to inherit directly from `ArrayBuffer.prototype`. The constructor is
2157
- * captured for use internal to this module, and is made otherwise inaccessible.
2158
- * Therefore, `immutableArrayBufferPrototype` and all its methods
2159
- * and accessor functions effectively become hidden intrinsics.
2160
- * They are not encapsulated. Rather, they are trivially discoverable if you
2161
- * know how, but are not discoverable merely by enumerating naming paths.
2208
+ * If we could use classes with private fields everywhere, this would have
2209
+ * been a `this.#buffer` private field on an `ImmutableArrayBufferInternal`
2210
+ * class. But we cannot do so on Hermes. So, instead, we
2211
+ * emulate the `this.#buffer` private field, including its use as a brand check.
2212
+ * Maps from all and only emulated Immutable ArrayBuffers to real ArrayBuffers.
2213
+ *
2214
+ * @type {Pick<WeakMap<ArrayBuffer, ArrayBuffer>, 'get' | 'has' | 'set'>}
2162
2215
  */
2163
- class ImmutableArrayBufferInternal {
2164
- /** @type {ArrayBuffer} */
2165
- #buffer;
2166
-
2167
- constructor(buffer) {
2168
- // This constructor is deleted from the prototype below.
2169
- this.#buffer = arrayBufferTransfer(buffer);
2216
+ const buffers = new WeakMap();
2217
+ // Avoid post-hoc prototype lookups.
2218
+ for (const methodName of ['get', 'has', 'set']) {
2219
+ defineProperty(buffers, methodName, { value: buffers[methodName] });
2220
+ }
2221
+ const getBuffer = immuAB => {
2222
+ // Safe because this WeakMap owns its get method.
2223
+ // eslint-disable-next-line @endo/no-polymorphic-call
2224
+ const result = buffers.get(immuAB);
2225
+ if (result) {
2226
+ return result;
2170
2227
  }
2228
+ throw TypeError('Not an emulated Immutable ArrayBuffer');
2229
+ };
2171
2230
 
2231
+ // Omits `constructor` so `Array.prototype.constructor` is inherited.
2232
+ const ImmutableArrayBufferInternalPrototype = {
2233
+ __proto__: arrayBufferPrototype,
2172
2234
  get byteLength() {
2173
- return this.#buffer.byteLength;
2174
- }
2175
-
2235
+ return apply(arrayBufferByteLength, getBuffer(this), []);
2236
+ },
2176
2237
  get detached() {
2177
- this.#buffer; // shim brand check
2238
+ getBuffer(this); // shim brand check
2178
2239
  return false;
2179
- }
2180
-
2240
+ },
2181
2241
  get maxByteLength() {
2182
2242
  // Not underlying maxByteLength, which is irrelevant
2183
- return this.#buffer.byteLength;
2184
- }
2185
-
2243
+ return apply(arrayBufferByteLength, getBuffer(this), []);
2244
+ },
2186
2245
  get resizable() {
2187
- this.#buffer; // shim brand check
2246
+ getBuffer(this); // shim brand check
2188
2247
  return false;
2189
- }
2190
-
2248
+ },
2191
2249
  get immutable() {
2192
- this.#buffer; // shim brand check
2250
+ getBuffer(this); // shim brand check
2193
2251
  return true;
2194
- }
2195
-
2252
+ },
2196
2253
  slice(start = undefined, end = undefined) {
2197
- return arrayBufferSlice(this.#buffer, start, end);
2198
- }
2199
-
2254
+ return arrayBufferSlice(getBuffer(this), start, end);
2255
+ },
2200
2256
  sliceToImmutable(start = undefined, end = undefined) {
2201
2257
  // eslint-disable-next-line no-use-before-define
2202
- return sliceBufferToImmutable(this.#buffer, start, end);
2203
- }
2204
-
2258
+ return sliceBufferToImmutable(getBuffer(this), start, end);
2259
+ },
2205
2260
  resize(_newByteLength = undefined) {
2206
- this.#buffer; // shim brand check
2261
+ getBuffer(this); // shim brand check
2207
2262
  throw TypeError('Cannot resize an immutable ArrayBuffer');
2208
- }
2209
-
2263
+ },
2210
2264
  transfer(_newLength = undefined) {
2211
- this.#buffer; // shim brand check
2265
+ getBuffer(this); // shim brand check
2212
2266
  throw TypeError('Cannot detach an immutable ArrayBuffer');
2213
- }
2214
-
2267
+ },
2215
2268
  transferToFixedLength(_newLength = undefined) {
2216
- this.#buffer; // shim brand check
2269
+ getBuffer(this); // shim brand check
2217
2270
  throw TypeError('Cannot detach an immutable ArrayBuffer');
2218
- }
2219
-
2271
+ },
2220
2272
  transferToImmutable(_newLength = undefined) {
2221
- this.#buffer; // shim brand check
2273
+ getBuffer(this); // shim brand check
2222
2274
  throw TypeError('Cannot detach an immutable ArrayBuffer');
2223
- }
2224
- }
2225
-
2226
- const immutableArrayBufferPrototype = ImmutableArrayBufferInternal.prototype;
2227
- // @ts-expect-error can only delete optionals
2228
- delete immutableArrayBufferPrototype.constructor;
2229
-
2230
- const {
2231
- slice: { value: sliceOfImmutable },
2232
- immutable: { get: isImmutableGetter },
2233
- } = getOwnPropertyDescriptors(immutableArrayBufferPrototype);
2234
-
2235
- setPrototypeOf(immutableArrayBufferPrototype, arrayBufferPrototype);
2275
+ },
2276
+ /**
2277
+ * See https://github.com/endojs/endo/tree/master/packages/immutable-arraybuffer#purposeful-violation
2278
+ */
2279
+ [toStringTag]: 'ImmutableArrayBuffer',
2280
+ };
2236
2281
 
2237
- // See https://github.com/endojs/endo/tree/master/packages/immutable-arraybuffer#purposeful-violation
2238
- defineProperties(immutableArrayBufferPrototype, {
2239
- [Symbol.toStringTag]: {
2240
- value: 'ImmutableArrayBuffer',
2241
- writable: false,
2282
+ // Better fidelity emulation of a class prototype
2283
+ for (const key of ownKeys(ImmutableArrayBufferInternalPrototype)) {
2284
+ defineProperty(ImmutableArrayBufferInternalPrototype, key, {
2242
2285
  enumerable: false,
2243
- configurable: true,
2244
- },
2245
- });
2286
+ });
2287
+ }
2246
2288
 
2247
2289
  /**
2248
- * Transfer the contents to a new Immutable ArrayBuffer
2290
+ * Emulates what would have been the encapsulated `ImmutableArrayBufferInternal`
2291
+ * class constructor. This function takes the `realBuffer` which its
2292
+ * result encapsulates. Security demands that this result has exclusive access
2293
+ * to the `realBuffer` it is given, which its callers must ensure.
2249
2294
  *
2250
- * @param {ArrayBuffer} buffer The original buffer.
2251
- * @param {number} [newLength] The start index.
2295
+ * @param {ArrayBuffer} realBuffer
2252
2296
  * @returns {ArrayBuffer}
2253
2297
  */
2254
- const transferBufferToImmutable = (buffer, newLength = undefined) => {
2255
- if (newLength !== undefined) {
2256
- if (transfer) {
2257
- buffer = apply(transfer, buffer, [newLength]);
2258
- } else {
2259
- buffer = arrayBufferTransfer(buffer);
2260
- const oldLength = buffer.byteLength;
2261
- // eslint-disable-next-line @endo/restrict-comparison-operands
2262
- if (newLength <= oldLength) {
2263
- buffer = arrayBufferSlice(buffer, 0, newLength);
2264
- } else {
2265
- const oldTA = new Uint8Array(buffer);
2266
- const newTA = new Uint8Array(newLength);
2267
- newTA.set(oldTA);
2268
- buffer = newTA.buffer;
2269
- }
2270
- }
2271
- }
2272
- const result = new ImmutableArrayBufferInternal(buffer);
2273
- return /** @type {ArrayBuffer} */ (/** @type {unknown} */ (result));
2274
- };$h͏_once.transferBufferToImmutable(transferBufferToImmutable);
2275
-
2276
- const isBufferImmutable = buffer => {
2277
- try {
2278
- // @ts-expect-error Getter should be typed as this-sensitive
2279
- return apply(isImmutableGetter, buffer, []);
2280
- } catch (err) {
2281
- if (err instanceof TypeError) {
2282
- // Enforce that `buffer` is a genuine ArrayBuffer before returning.
2283
- arrayBufferSlice(buffer, 0, 0);
2284
- return false;
2285
- }
2286
- throw err;
2287
- }
2298
+ const makeImmutableArrayBufferInternal = realBuffer => {
2299
+ const result = /** @type {ArrayBuffer} */ (
2300
+ /** @type {unknown} */ ({
2301
+ __proto__: ImmutableArrayBufferInternalPrototype,
2302
+ })
2303
+ );
2304
+ // Safe because this WeakMap owns its set method.
2305
+ // eslint-disable-next-line @endo/no-polymorphic-call
2306
+ buffers.set(result, realBuffer);
2307
+ return result;
2288
2308
  };
2309
+ // Since `makeImmutableArrayBufferInternal` MUST not escape,
2310
+ // this `freeze` is just belt-and-suspenders.
2311
+ freeze(makeImmutableArrayBufferInternal);
2289
2312
 
2290
2313
  /**
2291
- * Enforces that `arrayBuffer` is a genuine `ArrayBuffer` exotic object.
2292
- *
2293
2314
  * @param {ArrayBuffer} buffer
2294
- * @param {number} [start]
2295
- * @param {number} [end]
2296
- * @returns {ArrayBuffer}
2297
- */$h͏_once.isBufferImmutable(isBufferImmutable);
2298
- const sliceBuffer = (buffer, start = undefined, end = undefined) => {
2299
- try {
2300
- // @ts-expect-error We know it is really there
2301
- return apply(sliceOfImmutable, buffer, [start, end]);
2302
- } catch (err) {
2303
- if (err instanceof TypeError) {
2304
- return arrayBufferSlice(buffer, start, end);
2305
- }
2306
- throw err;
2307
- }
2308
- };
2315
+ * @returns {boolean}
2316
+ */
2317
+ // eslint-disable-next-line @endo/no-polymorphic-call
2318
+ const isBufferImmutable = buffer => buffers.has(buffer);
2309
2319
 
2310
2320
  /**
2311
2321
  * Creates an immutable slice of the given buffer.
2312
- *
2313
2322
  * @param {ArrayBuffer} buffer The original buffer.
2314
2323
  * @param {number} [start] The start index.
2315
2324
  * @param {number} [end] The end index.
2316
2325
  * @returns {ArrayBuffer} The sliced immutable ArrayBuffer.
2317
- */
2326
+ */$h͏_once.isBufferImmutable(isBufferImmutable);
2318
2327
  const sliceBufferToImmutable = (
2319
2328
  buffer,
2320
2329
  start = undefined,
2321
2330
  end = undefined,
2322
- ) => transferBufferToImmutable(sliceBuffer(buffer, start, end));$h͏_once.sliceBufferToImmutable(sliceBufferToImmutable);
2331
+ ) => {
2332
+ // Safe because this WeakMap owns its get method.
2333
+ // eslint-disable-next-line @endo/no-polymorphic-call
2334
+ let realBuffer = buffers.get(buffer);
2335
+ if (realBuffer === undefined) {
2336
+ realBuffer = buffer;
2337
+ }
2338
+ return makeImmutableArrayBufferInternal(
2339
+ arrayBufferSlice(realBuffer, start, end),
2340
+ );
2341
+ };$h͏_once.sliceBufferToImmutable(sliceBufferToImmutable);
2342
+
2343
+ let transferBufferToImmutable;
2344
+ if (optArrayBufferTransfer) {
2345
+ /**
2346
+ * Transfer the contents to a new Immutable ArrayBuffer
2347
+ *
2348
+ * @param {ArrayBuffer} buffer The original buffer.
2349
+ * @param {number} [newLength] The start index.
2350
+ * @returns {ArrayBuffer}
2351
+ */
2352
+ transferBufferToImmutable = (buffer, newLength = undefined) => {
2353
+ if (newLength === undefined) {
2354
+ buffer = optArrayBufferTransfer(buffer);
2355
+ } else if (optTransfer) {
2356
+ buffer = apply(optTransfer, buffer, [newLength]);
2357
+ } else {
2358
+ buffer = optArrayBufferTransfer(buffer);
2359
+ const oldLength = buffer.byteLength;
2360
+ // eslint-disable-next-line @endo/restrict-comparison-operands
2361
+ if (newLength <= oldLength) {
2362
+ buffer = arrayBufferSlice(buffer, 0, newLength);
2363
+ } else {
2364
+ const oldTA = new Uint8Array(buffer);
2365
+ const newTA = new Uint8Array(newLength);
2366
+ apply(uint8ArraySet, newTA, [oldTA]);
2367
+ buffer = apply(uint8ArrayBuffer, newTA, []);
2368
+ }
2369
+ }
2370
+ const result = makeImmutableArrayBufferInternal(buffer);
2371
+ return /** @type {ArrayBuffer} */ (/** @type {unknown} */ (result));
2372
+ };
2373
+ } else {
2374
+ transferBufferToImmutable = undefined;
2375
+ }
2376
+
2377
+ const optTransferBufferToImmutable = transferBufferToImmutable;$h͏_once.optTransferBufferToImmutable(optTransferBufferToImmutable);
2323
2378
  })()
2324
2379
  ,
2325
- // === 5. immutable-arraybuffer ./shim.js ===
2326
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let transferBufferToImmutable,isBufferImmutable,sliceBufferToImmutable;$h͏_imports([["./index.js", [["transferBufferToImmutable",[$h͏_a => (transferBufferToImmutable = $h͏_a)]],["isBufferImmutable",[$h͏_a => (isBufferImmutable = $h͏_a)]],["sliceBufferToImmutable",[$h͏_a => (sliceBufferToImmutable = $h͏_a)]]]]]);
2380
+ // === 5. immutable-arraybuffer ./src/immutable-arraybuffer-shim.js ===
2381
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let isBufferImmutable,sliceBufferToImmutable,optXferBuf2Immu;$h͏_imports([["./immutable-arraybuffer-pony.js", [["isBufferImmutable",[$h͏_a => (isBufferImmutable = $h͏_a)]],["sliceBufferToImmutable",[$h͏_a => (sliceBufferToImmutable = $h͏_a)]],["optTransferBufferToImmutable",[$h͏_a => (optXferBuf2Immu = $h͏_a)]]]]]);
2382
+
2383
+
2327
2384
 
2328
2385
 
2329
2386
 
2330
2387
 
2331
2388
 
2332
- const { getOwnPropertyDescriptors, defineProperties } = Object;
2389
+ const {
2390
+ ArrayBuffer,
2391
+ JSON,
2392
+ Object,
2393
+ Reflect
2394
+ // eslint-disable-next-line no-restricted-globals
2395
+ } = globalThis;
2396
+
2397
+ // Even though the imported one is not exported by the pony as a live binding,
2398
+ // TS doesn't know that,
2399
+ // so it cannot do its normal flow-based inference. By making and using a local
2400
+ // copy, no problem.
2401
+ const optTransferBufferToImmutable = optXferBuf2Immu;
2402
+
2403
+ const { getOwnPropertyDescriptors, defineProperties, defineProperty } = Object;
2404
+ const { ownKeys } = Reflect;
2333
2405
  const { prototype: arrayBufferPrototype } = ArrayBuffer;
2406
+ const { stringify } = JSON;
2334
2407
 
2335
2408
  const arrayBufferMethods = {
2336
- /**
2337
- * Transfer the contents to a new Immutable ArrayBuffer
2338
- *
2339
- * @this {ArrayBuffer} buffer The original buffer.
2340
- * @param {number} [newLength] The start index.
2341
- * @returns {ArrayBuffer} The sliced immutable ArrayBuffer.
2342
- */
2343
- transferToImmutable(newLength = undefined) {
2344
- return transferBufferToImmutable(this, newLength);
2345
- },
2346
-
2347
2409
  /**
2348
2410
  * Creates an immutable slice of the given buffer.
2349
2411
  *
@@ -2356,24 +2418,56 @@ const arrayBufferMethods = {
2356
2418
  return sliceBufferToImmutable(this, start, end);
2357
2419
  },
2358
2420
 
2421
+ /**
2422
+ * @this {ArrayBuffer}
2423
+ */
2359
2424
  get immutable() {
2360
2425
  return isBufferImmutable(this);
2361
2426
  },
2427
+
2428
+ ...(optTransferBufferToImmutable
2429
+ ? {
2430
+ /**
2431
+ * Transfer the contents to a new Immutable ArrayBuffer
2432
+ *
2433
+ * @this {ArrayBuffer} buffer The original buffer.
2434
+ * @param {number} [newLength] The start index.
2435
+ * @returns {ArrayBuffer} The sliced immutable ArrayBuffer.
2436
+ */
2437
+ transferToImmutable(newLength = undefined) {
2438
+ return optTransferBufferToImmutable(this, newLength);
2439
+ },
2440
+ }
2441
+ : {}),
2362
2442
  };
2363
2443
 
2364
- if ('sliceToImmutable' in arrayBufferPrototype) {
2365
- // Modern shim practice frowns on conditional installation, at least for
2366
- // proposals prior to stage 3. This is so changes to the proposal since
2367
- // an old shim was distributed don't need to worry about the proposal
2368
- // breaking old code depending on the old shim. Thus, if we detect that
2369
- // we're about to overwrite a prior installation, we simply issue this
2370
- // warning and continue.
2371
- //
2372
- // TODO, if the primordials are frozen after the prior implementation, such as
2373
- // by `lockdown`, then this precludes overwriting as expected. However, for
2374
- // this case, the following warning text will be confusing.
2444
+ // Better fidelity emulation of a class prototype
2445
+ for (const key of ownKeys(arrayBufferMethods)) {
2446
+ defineProperty(arrayBufferMethods, key, {
2447
+ enumerable: false,
2448
+ });
2449
+ }
2450
+
2451
+ // Modern shim practice frowns on conditional installation, at least for
2452
+ // proposals prior to stage 3. This is so changes to the proposal since
2453
+ // an old shim was distributed don't need to worry about the proposal
2454
+ // breaking old code depending on the old shim. Thus, if we detect that
2455
+ // we're about to overwrite a prior installation, we simply issue this
2456
+ // warning and continue.
2457
+ //
2458
+ // TODO, if the primordials are frozen after the prior implementation, such as
2459
+ // by `lockdown`, then this precludes overwriting as expected. However, for
2460
+ // this case, the following warning text will be confusing.
2461
+ //
2462
+ // Allowing polymorphic calls because these occur during initialization.
2463
+ // eslint-disable-next-line @endo/no-polymorphic-call
2464
+ const overwrites = ownKeys(arrayBufferMethods).filter(
2465
+ key => key in arrayBufferPrototype,
2466
+ );
2467
+ if (overwrites.length > 0) {
2468
+ // eslint-disable-next-line @endo/no-polymorphic-call
2375
2469
  console.warn(
2376
- 'About to overwrite a prior implementation of "sliceToImmutable"',
2470
+ `About to overwrite ArrayBuffer.prototype properties ${stringify(overwrites)}`,
2377
2471
  );
2378
2472
  }
2379
2473
 
@@ -2383,7 +2477,11 @@ defineProperties(
2383
2477
  );
2384
2478
  })()
2385
2479
  ,
2386
- // === 6. ses ./src/error/stringify-utils.js ===
2480
+ // === 6. immutable-arraybuffer ./shim.js ===
2481
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([["./src/immutable-arraybuffer-shim.js", []]]);
2482
+ })()
2483
+ ,
2484
+ // === 7. ses ./src/error/stringify-utils.js ===
2387
2485
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let Set,String,isArray,arrayJoin,arraySlice,arraySort,arrayMap,keys,fromEntries,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)]],["isArray",[$h͏_a => (isArray = $h͏_a)]],["arrayJoin",[$h͏_a => (arrayJoin = $h͏_a)]],["arraySlice",[$h͏_a => (arraySlice = $h͏_a)]],["arraySort",[$h͏_a => (arraySort = $h͏_a)]],["arrayMap",[$h͏_a => (arrayMap = $h͏_a)]],["keys",[$h͏_a => (keys = $h͏_a)]],["fromEntries",[$h͏_a => (fromEntries = $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)]]]]]);
2388
2486
 
2389
2487
 
@@ -2580,7 +2678,7 @@ const bestEffortStringify = (payload, spaces = undefined) => {
2580
2678
  freeze(bestEffortStringify);
2581
2679
  })()
2582
2680
  ,
2583
- // === 7. ses ./src/error/types.js ===
2681
+ // === 8. ses ./src/error/types.js ===
2584
2682
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);// @ts-check
2585
2683
 
2586
2684
  /** @import {GenericErrorConstructor, AssertMakeErrorOptions, DetailsToken, StringablePayload} from '../../types.js' */
@@ -2642,7 +2740,7 @@ freeze(bestEffortStringify);
2642
2740
  */
2643
2741
  })()
2644
2742
  ,
2645
- // === 8. ses ./src/error/internal-types.js ===
2743
+ // === 9. ses ./src/error/internal-types.js ===
2646
2744
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);// @ts-check
2647
2745
 
2648
2746
  /**
@@ -2743,10 +2841,15 @@ freeze(bestEffortStringify);
2743
2841
  */
2744
2842
  })()
2745
2843
  ,
2746
- // === 9. ses ./src/make-lru-cachemap.js ===
2844
+ // === 10. cache-map ./src/cachemap.js ===
2747
2845
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);// @ts-check
2846
+ /* global globalThis */
2748
2847
  /* eslint-disable @endo/no-polymorphic-call */
2749
2848
 
2849
+ // eslint-disable-next-line no-restricted-globals
2850
+ const { Error, TypeError, WeakMap } = globalThis;
2851
+ // eslint-disable-next-line no-restricted-globals
2852
+ const { parse, stringify } = JSON;
2750
2853
  // eslint-disable-next-line no-restricted-globals
2751
2854
  const { isSafeInteger } = Number;
2752
2855
  // eslint-disable-next-line no-restricted-globals
@@ -2754,227 +2857,323 @@ const { freeze } = Object;
2754
2857
  // eslint-disable-next-line no-restricted-globals
2755
2858
  const { toStringTag: toStringTagSymbol } = Symbol;
2756
2859
 
2860
+ // eslint-disable-next-line no-restricted-globals
2861
+ const UNKNOWN_KEY = Symbol('UNKNOWN_KEY');
2862
+
2757
2863
  /**
2758
- * @template Data
2759
- * @typedef {object} DoublyLinkedCell
2760
- * A cell of a doubly-linked ring, i.e., a doubly-linked circular list.
2761
- * DoublyLinkedCells are not frozen, and so should be closely encapsulated by
2762
- * any abstraction that uses them.
2763
- * @property {DoublyLinkedCell<Data>} next
2764
- * @property {DoublyLinkedCell<Data>} prev
2765
- * @property {Data} data
2864
+ * @template T
2865
+ * @typedef {T extends object ? { -readonly [K in keyof T]: T[K] } : never} WritableDeep
2866
+ * Intentionally limited to local needs; refer to
2867
+ * https://github.com/sindresorhus/type-fest if insufficient.
2766
2868
  */
2767
2869
 
2768
2870
  /**
2769
- * Makes a new self-linked cell. There are two reasons to do so:
2770
- * * To make the head sigil of a new initially-empty doubly-linked ring.
2771
- * * To make a non-sigil cell to be `spliceAfter`ed.
2871
+ * @template T
2872
+ * @param {T} value
2873
+ * @param {<U,>(name: string, value: U) => U} [reviver]
2874
+ * @returns {WritableDeep<T>}
2875
+ */
2876
+ const deepCopyJsonable = (value, reviver) => {
2877
+ const encoded = stringify(value);
2878
+ const decoded = parse(encoded, reviver);
2879
+ return decoded;
2880
+ };
2881
+
2882
+ const freezingReviver = (_name, value) => freeze(value);
2883
+
2884
+ /** @type {<T,>(value: T) => T} */
2885
+ const deepCopyAndFreezeJsonable = value =>
2886
+ deepCopyJsonable(value, freezingReviver);
2887
+
2888
+ /**
2889
+ * A cache of bounded size, implementing the WeakMap interface but holding keys
2890
+ * strongly if created with a non-weak `makeMap` option of
2891
+ * {@link makeCacheMapKit}.
2772
2892
  *
2773
- * @template Data
2774
- * @param {Data} data
2775
- * @returns {DoublyLinkedCell<Data>}
2893
+ * @template K
2894
+ * @template V
2895
+ * @typedef {Pick<Map<K, V>, Exclude<keyof WeakMap<WeakKey, *>, 'set'>> & {set: (key: K, value: V) => WeakMapAPI<K, V>}} WeakMapAPI
2776
2896
  */
2777
- const makeSelfCell = data => {
2778
- /** @type {Partial<DoublyLinkedCell<Data>>} */
2779
- const incompleteCell = {
2780
- next: undefined,
2781
- prev: undefined,
2782
- data,
2783
- };
2784
- const selfCell = /** @type {DoublyLinkedCell<Data>} */ (incompleteCell);
2785
- selfCell.next = selfCell;
2786
- selfCell.prev = selfCell;
2787
- // Not frozen!
2788
- return selfCell;
2789
- };
2790
2897
 
2791
2898
  /**
2792
- * Splices a self-linked non-sigil cell into a ring after `prev`.
2793
- * `prev` could be the head sigil, or it could be some other non-sigil
2794
- * cell within a ring.
2899
+ * @template K
2900
+ * @template V
2901
+ * @typedef {WeakMapAPI<K, V> & ({clear?: undefined} | Pick<Map<K, V>, 'clear'>)} SingleEntryMap
2902
+ */
2903
+
2904
+ /**
2905
+ * A cell of a doubly-linked ring (circular list) for a cache map.
2906
+ * Instances are not frozen, and so should be closely encapsulated.
2795
2907
  *
2796
- * @template Data
2797
- * @param {DoublyLinkedCell<Data>} prev
2798
- * @param {DoublyLinkedCell<Data>} selfCell
2908
+ * @template K
2909
+ * @template V
2910
+ * @typedef {object} CacheMapCell
2911
+ * @property {number} id for debugging
2912
+ * @property {CacheMapCell<K, V>} next
2913
+ * @property {CacheMapCell<K, V>} prev
2914
+ * @property {SingleEntryMap<K, V>} data
2799
2915
  */
2800
- const spliceAfter = (prev, selfCell) => {
2801
- if (prev === selfCell) {
2802
- // eslint-disable-next-line no-restricted-globals
2803
- throw TypeError('Cannot splice a cell into itself');
2804
- }
2805
- if (selfCell.next !== selfCell || selfCell.prev !== selfCell) {
2806
- // eslint-disable-next-line no-restricted-globals
2807
- throw TypeError('Expected self-linked cell');
2808
- }
2809
- const cell = selfCell;
2810
- // rename variable cause it isn't self-linked after this point.
2811
2916
 
2812
- const next = prev.next;
2813
- cell.prev = prev;
2814
- cell.next = next;
2917
+ /**
2918
+ * @template K
2919
+ * @template V
2920
+ * @param {CacheMapCell<K, V>} prev
2921
+ * @param {number} id
2922
+ * @param {SingleEntryMap<K, V>} data
2923
+ * @returns {CacheMapCell<K, V>}
2924
+ */
2925
+ const appendNewCell = (prev, id, data) => {
2926
+ const next = prev?.next;
2927
+ const cell = { id, next, prev, data };
2815
2928
  prev.next = cell;
2816
2929
  next.prev = cell;
2817
- // Not frozen!
2818
2930
  return cell;
2819
2931
  };
2820
2932
 
2821
2933
  /**
2822
- * @template Data
2823
- * @param {DoublyLinkedCell<Data>} cell
2824
- * No-op if the cell is self-linked.
2934
+ * @template K
2935
+ * @template V
2936
+ * @param {CacheMapCell<K, V>} cell
2937
+ * @param {CacheMapCell<K, V>} prev
2938
+ * @param {CacheMapCell<K, V>} [next]
2825
2939
  */
2826
- const spliceOut = cell => {
2827
- const { prev, next } = cell;
2828
- prev.next = next;
2829
- next.prev = prev;
2830
- cell.prev = cell;
2831
- cell.next = cell;
2940
+ const moveCellAfter = (cell, prev, next = prev.next) => {
2941
+ if (cell === prev || cell === next) return; // already in position
2942
+
2943
+ // Splice out cell.
2944
+ const { prev: oldPrev, next: oldNext } = cell;
2945
+ oldPrev.next = oldNext;
2946
+ oldNext.prev = oldPrev;
2947
+
2948
+ // Splice in cell after prev.
2949
+ cell.prev = prev;
2950
+ cell.next = next;
2951
+ prev.next = cell;
2952
+ next.prev = cell;
2832
2953
  };
2833
2954
 
2834
2955
  /**
2835
- * The LRUCacheMap is used within the implementation of `assert` and so
2836
- * at a layer below SES or harden. Thus, we give it a `WeakMap`-like interface
2837
- * rather than a `WeakMapStore`-like interface. To work before `lockdown`,
2838
- * the implementation must use `freeze` manually, but still exhaustively.
2956
+ * Clear out a cell to prepare it for future use. Its map is preserved when
2957
+ * possible, but must instead be replaced if the associated key is not known.
2839
2958
  *
2840
- * It implements the WeakMap interface, and holds its keys weakly. Cached
2841
- * values are only held while the key is held by the user and the key/value
2842
- * bookkeeping cell has not been pushed off the end of the cache by `budget`
2843
- * number of more recently referenced cells. If the key is dropped by the user,
2844
- * the value will no longer be held by the cache, but the bookkeeping cell
2845
- * itself will stay in memory.
2846
- *
2847
- * @template {{}} K
2848
- * @template {unknown} V
2849
- * @param {number} keysBudget
2850
- * @returns {WeakMap<K,V>}
2959
+ * @template K
2960
+ * @template V
2961
+ * @param {CacheMapCell<K, V>} cell
2962
+ * @param {K | UNKNOWN_KEY} oldKey
2963
+ * @param {() => SingleEntryMap<K, V>} [makeMap] required when the key is unknown
2851
2964
  */
2852
- const makeLRUCacheMap = keysBudget => {
2853
- if (!isSafeInteger(keysBudget) || keysBudget < 0) {
2854
- // eslint-disable-next-line no-restricted-globals
2855
- throw TypeError('keysBudget must be a safe non-negative integer number');
2965
+ const resetCell = (cell, oldKey, makeMap) => {
2966
+ if (oldKey !== UNKNOWN_KEY) {
2967
+ cell.data.delete(oldKey);
2968
+ return;
2856
2969
  }
2857
- /** @typedef {DoublyLinkedCell<WeakMap<K, V> | undefined>} LRUCacheCell */
2858
- /** @type {WeakMap<K, LRUCacheCell>} */
2859
- // eslint-disable-next-line no-restricted-globals
2860
- const keyToCell = new WeakMap();
2861
- let size = 0; // `size` must remain <= `keysBudget`
2862
- // As a sigil, `head` uniquely is not in the `keyToCell` map.
2863
- /** @type {LRUCacheCell} */
2864
- const head = makeSelfCell(undefined);
2970
+ if (cell.data.clear) {
2971
+ cell.data.clear();
2972
+ return;
2973
+ }
2974
+ // WeakMap instances must be replaced when the key is unknown.
2975
+ if (!makeMap) {
2976
+ throw Error('internal: makeMap is required with UNKNOWN_KEY');
2977
+ }
2978
+ cell.data = makeMap();
2979
+ };
2865
2980
 
2866
- const touchCell = key => {
2867
- const cell = keyToCell.get(key);
2868
- if (cell === undefined || cell.data === undefined) {
2869
- // Either the key was GCed, or the cell was condemned.
2870
- return undefined;
2871
- }
2872
- // Becomes most recently used
2873
- spliceOut(cell);
2874
- spliceAfter(head, cell);
2875
- return cell;
2876
- };
2981
+ const zeroMetrics = freeze({
2982
+ totalQueryCount: 0,
2983
+ totalHitCount: 0
2984
+ // TODO?
2985
+ // * method-specific counts
2986
+ // * liveTouchStats/evictedTouchStats { count, sum, mean, min, max }
2987
+ // * p50/p90/p95/p99 via Ben-Haim/Tom-Tov streaming histograms
2988
+ });
2989
+ /** @typedef {typeof zeroMetrics} CacheMapMetrics */
2990
+
2991
+ /**
2992
+ * @template {MapConstructor | WeakMapConstructor} [C=WeakMapConstructor]
2993
+ * @template {Parameters<InstanceType<C>['set']>[0]} [K=Parameters<InstanceType<C>['set']>[0]]
2994
+ * @template {unknown} [V=unknown]
2995
+ * @typedef {object} CacheMapKit
2996
+ * @property {WeakMapAPI<K, V>} cache
2997
+ * @property {() => CacheMapMetrics} getMetrics
2998
+ */
2999
+
3000
+ /**
3001
+ * Create a bounded-size cache having WeakMap-compatible
3002
+ * `has`/`get`/`set`/`delete` methods, capable of supporting SES (specifically
3003
+ * `assert` error notes).
3004
+ * Key validity, comparison, and referential strength are controlled by the
3005
+ * `makeMap` option, which defaults to `WeakMap` but can be set to any producer
3006
+ * of objects with those methods (e.g., using `Map` allows for arbitrary keys
3007
+ * which will be strongly held).
3008
+ * Cache eviction policy is not currently configurable, but strives for a hit
3009
+ * ratio at least as good as
3010
+ * [LRU](https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU) (e.g., it
3011
+ * might be
3012
+ * [CLOCK](https://en.wikipedia.org/wiki/Page_replacement_algorithm#Clock)
3013
+ * or [SIEVE](https://sievecache.com/)).
3014
+ *
3015
+ * @template {MapConstructor | WeakMapConstructor} [C=WeakMapConstructor]
3016
+ * @template {Parameters<InstanceType<C>['set']>[0]} [K=Parameters<InstanceType<C>['set']>[0]]
3017
+ * @template {unknown} [V=unknown]
3018
+ * @param {number} capacity
3019
+ * @param {object} [options]
3020
+ * @param {C | (() => SingleEntryMap<K, V>)} [options.makeMap]
3021
+ * @returns {CacheMapKit<C, K, V>}
3022
+ */
3023
+ const makeCacheMapKit = (capacity, options = {}) => {
3024
+ if (!isSafeInteger(capacity) || capacity < 0) {
3025
+ throw TypeError(
3026
+ 'capacity must be a non-negative safe integer number <= 2**53 - 1',
3027
+ );
3028
+ }
2877
3029
 
2878
3030
  /**
2879
- * @param {K} key
3031
+ * @template V
3032
+ * @type {<V,>() => SingleEntryMap<K, V>}
2880
3033
  */
2881
- const has = key => touchCell(key) !== undefined;
2882
- freeze(has);
3034
+ const makeMap = (MaybeCtor => {
3035
+ try {
3036
+ // @ts-expect-error
3037
+ MaybeCtor();
3038
+ return /** @type {any} */ (MaybeCtor);
3039
+ } catch (err) {
3040
+ // @ts-expect-error
3041
+ const constructNewMap = () => new MaybeCtor();
3042
+ return constructNewMap;
3043
+ }
3044
+ })(options.makeMap ?? WeakMap);
3045
+ const tag =
3046
+ /** @type {any} */ (makeMap()).clear === undefined
3047
+ ? 'WeakCacheMap'
3048
+ : 'CacheMap';
3049
+
3050
+ /** @type {WeakMapAPI<K, CacheMapCell<K, V>>} */
3051
+ const keyToCell = makeMap();
3052
+ // @ts-expect-error this sentinel head is special
3053
+ const head = /** @type {CacheMapCell<K, V>} */ ({
3054
+ id: 0,
3055
+ // next and prev are established below as self-referential.
3056
+ next: undefined,
3057
+ prev: undefined,
3058
+ data: {
3059
+ has: () => {
3060
+ throw Error('internal: sentinel head cell has no data');
3061
+ },
3062
+ },
3063
+ });
3064
+ head.next = head;
3065
+ head.prev = head;
3066
+ let cellCount = 0;
3067
+
3068
+ const metrics = deepCopyJsonable(zeroMetrics);
3069
+ const getMetrics = () => deepCopyAndFreezeJsonable(metrics);
2883
3070
 
2884
3071
  /**
2885
- * @param {K} key
3072
+ * Touching moves a cell to first position so LRU eviction can target the last
3073
+ * cell (`head.prev`).
3074
+ *
3075
+ * @type {(key: K) => (CacheMapCell<K, V> | undefined)}
2886
3076
  */
2887
- // UNTIL https://github.com/endojs/endo/issues/1514
2888
- // Prefer: const get = key => touchCell(key)?.data?.get(key);
3077
+ const touchKey = key => {
3078
+ metrics.totalQueryCount += 1;
3079
+ const cell = keyToCell.get(key);
3080
+ if (!cell?.data.has(key)) return undefined;
3081
+
3082
+ metrics.totalHitCount += 1;
3083
+ moveCellAfter(cell, head);
3084
+ return cell;
3085
+ };
3086
+
3087
+ /** @type {WeakMapAPI<K, V>['has']} */
3088
+ const has = key => {
3089
+ const cell = touchKey(key);
3090
+ return cell !== undefined;
3091
+ };
3092
+ freeze(has);
3093
+
3094
+ /** @type {WeakMapAPI<K, V>['get']} */
2889
3095
  const get = key => {
2890
- const cell = touchCell(key);
2891
- return cell && cell.data && cell.data.get(key);
3096
+ const cell = touchKey(key);
3097
+ return cell?.data.get(key);
2892
3098
  };
2893
3099
  freeze(get);
2894
3100
 
2895
- /**
2896
- * @param {K} key
2897
- * @param {V} value
2898
- */
3101
+ /** @type {WeakMapAPI<K, V>['set']} */
2899
3102
  const set = (key, value) => {
2900
- if (keysBudget < 1) {
3103
+ let cell = touchKey(key);
3104
+ if (cell) {
3105
+ cell.data.set(key, value);
2901
3106
  // eslint-disable-next-line no-use-before-define
2902
- return lruCacheMap; // Implements WeakMap.set
3107
+ return implementation;
2903
3108
  }
2904
3109
 
2905
- let cell = touchCell(key);
2906
- if (cell === undefined) {
2907
- cell = makeSelfCell(undefined);
2908
- spliceAfter(head, cell); // start most recently used
2909
- }
2910
- if (!cell.data) {
2911
- // Either a fresh cell or a reused condemned cell.
2912
- size += 1;
2913
- // Add its data.
2914
- // eslint-disable-next-line no-restricted-globals
2915
- cell.data = new WeakMap();
2916
- // Advertise the cell for this key.
2917
- keyToCell.set(key, cell);
2918
- while (size > keysBudget) {
2919
- const condemned = head.prev;
2920
- spliceOut(condemned); // Drop least recently used
2921
- condemned.data = undefined;
2922
- size -= 1;
2923
- }
3110
+ if (cellCount < capacity) {
3111
+ // Add and use a new cell at first position.
3112
+ cell = appendNewCell(head, cellCount + 1, makeMap());
3113
+ cellCount += 1; // intentionally follows cell creation
3114
+ cell.data.set(key, value);
3115
+ } else if (capacity > 0) {
3116
+ // Reuse the current tail, moving it to first position.
3117
+ cell = head.prev;
3118
+ resetCell(/** @type {any} */ (cell), UNKNOWN_KEY, makeMap);
3119
+ cell.data.set(key, value);
3120
+ moveCellAfter(cell, head);
2924
3121
  }
2925
3122
 
2926
- // Update the data.
2927
- cell.data.set(key, value);
3123
+ // Don't establish this entry until prior steps succeed.
3124
+ if (cell) keyToCell.set(key, cell);
2928
3125
 
2929
3126
  // eslint-disable-next-line no-use-before-define
2930
- return lruCacheMap; // Implements WeakMap.set
3127
+ return implementation;
2931
3128
  };
2932
3129
  freeze(set);
2933
3130
 
2934
3131
  // "delete" is a keyword.
2935
- /**
2936
- * @param {K} key
2937
- */
2938
- const deleteIt = key => {
2939
- const cell = keyToCell.get(key);
2940
- if (cell === undefined) {
2941
- return false;
2942
- }
2943
- spliceOut(cell);
2944
- keyToCell.delete(key);
2945
- if (cell.data === undefined) {
2946
- // Already condemned.
2947
- return false;
2948
- }
2949
-
2950
- cell.data = undefined;
2951
- size -= 1;
2952
- return true;
3132
+ const { delete: deleteEntry } = {
3133
+ /** @type {WeakMapAPI<K, V>['delete']} */
3134
+ delete: key => {
3135
+ const cell = keyToCell.get(key);
3136
+ if (!cell?.data.has(key)) {
3137
+ keyToCell.delete(key);
3138
+ return false;
3139
+ }
3140
+ moveCellAfter(cell, head.prev);
3141
+ resetCell(cell, key);
3142
+ keyToCell.delete(key);
3143
+ return true;
3144
+ },
2953
3145
  };
2954
- freeze(deleteIt);
3146
+ freeze(deleteEntry);
2955
3147
 
2956
- const lruCacheMap = freeze({
3148
+ const implementation = /** @type {WeakMapAPI<K, V>} */ ({
2957
3149
  has,
2958
3150
  get,
2959
3151
  set,
2960
- delete: deleteIt,
3152
+ delete: deleteEntry,
2961
3153
  // eslint-disable-next-line jsdoc/check-types
2962
- [/** @type {typeof Symbol.toStringTag} */ (toStringTagSymbol)]:
2963
- 'LRUCacheMap',
3154
+ [/** @type {typeof Symbol.toStringTag} */ (toStringTagSymbol)]: tag,
2964
3155
  });
2965
- return lruCacheMap;
2966
- };$h͏_once.makeLRUCacheMap(makeLRUCacheMap);
2967
- freeze(makeLRUCacheMap);
3156
+ freeze(implementation);
3157
+
3158
+ const kit = { cache: implementation, getMetrics };
3159
+ return freeze(kit);
3160
+ };$h͏_once.makeCacheMapKit(makeCacheMapKit);
3161
+ freeze(makeCacheMapKit);
2968
3162
  })()
2969
3163
  ,
2970
- // === 10. ses ./src/error/note-log-args.js ===
2971
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let makeLRUCacheMap;$h͏_imports([["../make-lru-cachemap.js", [["makeLRUCacheMap",[$h͏_a => (makeLRUCacheMap = $h͏_a)]]]]]);
3164
+ // === 11. cache-map ./index.js ===
3165
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([["./src/cachemap.js", []]]);
3166
+ })()
3167
+ ,
3168
+ // === 12. ses ./src/error/note-log-args.js ===
3169
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let makeCacheMapKit;$h͏_imports([["@endo/cache-map", [["makeCacheMapKit",[$h͏_a => (makeCacheMapKit = $h͏_a)]]]]]);
2972
3170
 
2973
3171
 
2974
3172
 
2975
3173
 
2976
3174
 
2977
3175
  /**
3176
+ * @import {CacheMapKit} from '@endo/cache-map';
2978
3177
  * @import {LogArgs} from './internal-types.js';
2979
3178
  */
2980
3179
 
@@ -2999,16 +3198,16 @@ const defaultArgsPerErrorBudget = 100;
2999
3198
  }
3000
3199
 
3001
3200
  /**
3002
- * @type {WeakMap<Error, LogArgs[]>}
3003
- *
3004
3201
  * Maps from an error to an array of log args, where each log args is
3005
3202
  * remembered as an annotation on that error. This can be used, for example,
3006
3203
  * to keep track of additional causes of the error. The elements of any
3007
3204
  * log args may include errors which are associated with further annotations.
3008
3205
  * An augmented console, like the causal console of `console.js`, could
3009
3206
  * then retrieve the graph of such annotations.
3207
+ *
3208
+ * @type {CacheMapKit<WeakMapConstructor, Error, LogArgs[]>}
3010
3209
  */
3011
- const noteLogArgsArrayMap = makeLRUCacheMap(errorsBudget);
3210
+ const { cache: noteLogArgsArrayMap } = makeCacheMapKit(errorsBudget);
3012
3211
 
3013
3212
  /**
3014
3213
  * @param {Error} error
@@ -3046,8 +3245,8 @@ const defaultArgsPerErrorBudget = 100;
3046
3245
  freeze(makeNoteLogArgsArrayKit);
3047
3246
  })()
3048
3247
  ,
3049
- // === 11. ses ./src/error/assert.js ===
3050
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let RangeError,TypeError,WeakMap,arrayJoin,arrayMap,arrayPop,arrayPush,assign,freeze,defineProperty,globalThis,is,isError,regexpTest,stringIndexOf,stringReplace,stringSlice,stringStartsWith,weakmapDelete,weakmapGet,weakmapHas,weakmapSet,AggregateError,getOwnPropertyDescriptors,ownKeys,create,objectPrototype,objectHasOwnProperty,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)]],["defineProperty",[$h͏_a => (defineProperty = $h͏_a)]],["globalThis",[$h͏_a => (globalThis = $h͏_a)]],["is",[$h͏_a => (is = $h͏_a)]],["isError",[$h͏_a => (isError = $h͏_a)]],["regexpTest",[$h͏_a => (regexpTest = $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)]],["AggregateError",[$h͏_a => (AggregateError = $h͏_a)]],["getOwnPropertyDescriptors",[$h͏_a => (getOwnPropertyDescriptors = $h͏_a)]],["ownKeys",[$h͏_a => (ownKeys = $h͏_a)]],["create",[$h͏_a => (create = $h͏_a)]],["objectPrototype",[$h͏_a => (objectPrototype = $h͏_a)]],["objectHasOwnProperty",[$h͏_a => (objectHasOwnProperty = $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)]]]]]);
3248
+ // === 13. ses ./src/error/assert.js ===
3249
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let RangeError,TypeError,WeakMap,arrayJoin,arrayMap,arrayPop,arrayPush,assign,freeze,defineProperty,globalThis,is,isError,regexpTest,stringIndexOf,stringReplace,stringSlice,stringStartsWith,weakmapDelete,weakmapGet,weakmapHas,weakmapSet,AggregateError,getOwnPropertyDescriptors,ownKeys,create,objectPrototype,hasOwn,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)]],["defineProperty",[$h͏_a => (defineProperty = $h͏_a)]],["globalThis",[$h͏_a => (globalThis = $h͏_a)]],["is",[$h͏_a => (is = $h͏_a)]],["isError",[$h͏_a => (isError = $h͏_a)]],["regexpTest",[$h͏_a => (regexpTest = $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)]],["AggregateError",[$h͏_a => (AggregateError = $h͏_a)]],["getOwnPropertyDescriptors",[$h͏_a => (getOwnPropertyDescriptors = $h͏_a)]],["ownKeys",[$h͏_a => (ownKeys = $h͏_a)]],["create",[$h͏_a => (create = $h͏_a)]],["objectPrototype",[$h͏_a => (objectPrototype = $h͏_a)]],["hasOwn",[$h͏_a => (hasOwn = $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)]]]]]);
3051
3250
 
3052
3251
 
3053
3252
 
@@ -3356,7 +3555,7 @@ const tagError = (err, optErrorName = err.name) => {
3356
3555
  for (const name of ownKeys(error)) {
3357
3556
  // @ts-expect-error TS still confused by symbols as property names
3358
3557
  const desc = descs[name];
3359
- if (desc && objectHasOwnProperty(desc, 'get')) {
3558
+ if (desc && hasOwn(desc, 'get')) {
3360
3559
  defineProperty(error, name, {
3361
3560
  value: error[name] // invoke the getter to convert to data property
3362
3561
  });
@@ -3624,8 +3823,8 @@ const assert = makeAssert();$h͏_once.assert(assert);
3624
3823
  const assertEqual = assert.equal;$h͏_once.assertEqual(assertEqual);
3625
3824
  })()
3626
3825
  ,
3627
- // === 12. ses ./src/make-hardener.js ===
3628
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let Set,String,TypeError,WeakSet,globalThis,apply,arrayForEach,defineProperty,freeze,getOwnPropertyDescriptor,getOwnPropertyDescriptors,getPrototypeOf,isInteger,isObject,objectHasOwnProperty,ownKeys,preventExtensions,setAdd,setForEach,setHas,toStringTagSymbol,typedArrayPrototype,weaksetAdd,weaksetHas,FERAL_STACK_GETTER,FERAL_STACK_SETTER,isError,assert;$h͏_imports([["./commons.js", [["Set",[$h͏_a => (Set = $h͏_a)]],["String",[$h͏_a => (String = $h͏_a)]],["TypeError",[$h͏_a => (TypeError = $h͏_a)]],["WeakSet",[$h͏_a => (WeakSet = $h͏_a)]],["globalThis",[$h͏_a => (globalThis = $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)]],["weaksetAdd",[$h͏_a => (weaksetAdd = $h͏_a)]],["weaksetHas",[$h͏_a => (weaksetHas = $h͏_a)]],["FERAL_STACK_GETTER",[$h͏_a => (FERAL_STACK_GETTER = $h͏_a)]],["FERAL_STACK_SETTER",[$h͏_a => (FERAL_STACK_SETTER = $h͏_a)]],["isError",[$h͏_a => (isError = $h͏_a)]]]],["./error/assert.js", [["assert",[$h͏_a => (assert = $h͏_a)]]]]]);
3826
+ // === 14. ses ./src/make-hardener.js ===
3827
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let Set,String,TypeError,WeakSet,globalThis,apply,arrayForEach,defineProperty,freeze,getOwnPropertyDescriptor,getOwnPropertyDescriptors,getPrototypeOf,isInteger,isPrimitive,hasOwn,ownKeys,preventExtensions,setAdd,setForEach,setHas,toStringTagSymbol,typedArrayPrototype,weaksetAdd,weaksetHas,FERAL_STACK_GETTER,FERAL_STACK_SETTER,isError,assert;$h͏_imports([["./commons.js", [["Set",[$h͏_a => (Set = $h͏_a)]],["String",[$h͏_a => (String = $h͏_a)]],["TypeError",[$h͏_a => (TypeError = $h͏_a)]],["WeakSet",[$h͏_a => (WeakSet = $h͏_a)]],["globalThis",[$h͏_a => (globalThis = $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)]],["isPrimitive",[$h͏_a => (isPrimitive = $h͏_a)]],["hasOwn",[$h͏_a => (hasOwn = $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)]],["weaksetAdd",[$h͏_a => (weaksetAdd = $h͏_a)]],["weaksetHas",[$h͏_a => (weaksetHas = $h͏_a)]],["FERAL_STACK_GETTER",[$h͏_a => (FERAL_STACK_GETTER = $h͏_a)]],["FERAL_STACK_SETTER",[$h͏_a => (FERAL_STACK_SETTER = $h͏_a)]],["isError",[$h͏_a => (isError = $h͏_a)]]]],["./error/assert.js", [["assert",[$h͏_a => (assert = $h͏_a)]]]]]);
3629
3828
 
3630
3829
 
3631
3830
 
@@ -3778,7 +3977,7 @@ const freezeTypedArray = array => {
3778
3977
  * @param {any} val
3779
3978
  */
3780
3979
  function enqueue(val) {
3781
- if (!isObject(val)) {
3980
+ if (isPrimitive(val)) {
3782
3981
  // ignore primitives
3783
3982
  return;
3784
3983
  }
@@ -3833,7 +4032,7 @@ const freezeTypedArray = array => {
3833
4032
  // test could be confused. We use hasOwnProperty to be sure about
3834
4033
  // whether 'value' is present or not, which tells us for sure that
3835
4034
  // this is a data property.
3836
- if (objectHasOwnProperty(desc, 'value')) {
4035
+ if (hasOwn(desc, 'value')) {
3837
4036
  enqueue(desc.value);
3838
4037
  } else {
3839
4038
  enqueue(desc.get);
@@ -3902,8 +4101,8 @@ const freezeTypedArray = array => {
3902
4101
  };$h͏_once.makeHardener(makeHardener);
3903
4102
  })()
3904
4103
  ,
3905
- // === 13. ses ./src/cauterize-property.js ===
3906
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let objectHasOwnProperty;$h͏_imports([["./commons.js", [["objectHasOwnProperty",[$h͏_a => (objectHasOwnProperty = $h͏_a)]]]]]);
4104
+ // === 15. ses ./src/cauterize-property.js ===
4105
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let hasOwn;$h͏_imports([["./commons.js", [["hasOwn",[$h͏_a => (hasOwn = $h͏_a)]]]]]);
3907
4106
 
3908
4107
  /**
3909
4108
  * @import {Reporter} from './reporting-types.js'
@@ -3957,7 +4156,7 @@ const freezeTypedArray = array => {
3957
4156
  try {
3958
4157
  delete obj[prop];
3959
4158
  } catch (err) {
3960
- if (objectHasOwnProperty(obj, prop)) {
4159
+ if (hasOwn(obj, prop)) {
3961
4160
  if (typeof obj === 'function' && prop === 'prototype') {
3962
4161
  obj.prototype = undefined;
3963
4162
  if (obj.prototype === undefined) {
@@ -3974,7 +4173,7 @@ const freezeTypedArray = array => {
3974
4173
  };$h͏_once.cauterizeProperty(cauterizeProperty);
3975
4174
  })()
3976
4175
  ,
3977
- // === 14. ses ./src/permits.js ===
4176
+ // === 16. ses ./src/permits.js ===
3978
4177
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let arrayPush,arrayForEach;$h͏_imports([["./commons.js", [["arrayPush",[$h͏_a => (arrayPush = $h͏_a)]],["arrayForEach",[$h͏_a => (arrayForEach = $h͏_a)]]]]]);
3979
4178
 
3980
4179
 
@@ -5738,8 +5937,8 @@ const CommonMath = {
5738
5937
  };$h͏_once.permitted(permitted);
5739
5938
  })()
5740
5939
  ,
5741
- // === 15. ses ./src/intrinsics.js ===
5742
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let cauterizeProperty,TypeError,WeakSet,arrayFilter,create,defineProperty,entries,freeze,getOwnPropertyDescriptor,getOwnPropertyDescriptors,globalThis,is,isObject,objectHasOwnProperty,values,weaksetHas,constantProperties,sharedGlobalPropertyNames,universalPropertyNames,permitted;$h͏_imports([["./cauterize-property.js", [["cauterizeProperty",[$h͏_a => (cauterizeProperty = $h͏_a)]]]],["./commons.js", [["TypeError",[$h͏_a => (TypeError = $h͏_a)]],["WeakSet",[$h͏_a => (WeakSet = $h͏_a)]],["arrayFilter",[$h͏_a => (arrayFilter = $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)]],["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)]]]],["./permits.js", [["constantProperties",[$h͏_a => (constantProperties = $h͏_a)]],["sharedGlobalPropertyNames",[$h͏_a => (sharedGlobalPropertyNames = $h͏_a)]],["universalPropertyNames",[$h͏_a => (universalPropertyNames = $h͏_a)]],["permitted",[$h͏_a => (permitted = $h͏_a)]]]]]);
5940
+ // === 17. ses ./src/intrinsics.js ===
5941
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let cauterizeProperty,TypeError,WeakSet,arrayFilter,create,defineProperty,entries,freeze,getOwnPropertyDescriptor,getOwnPropertyDescriptors,globalThis,is,isPrimitive,hasOwn,values,weaksetHas,constantProperties,sharedGlobalPropertyNames,universalPropertyNames,permitted;$h͏_imports([["./cauterize-property.js", [["cauterizeProperty",[$h͏_a => (cauterizeProperty = $h͏_a)]]]],["./commons.js", [["TypeError",[$h͏_a => (TypeError = $h͏_a)]],["WeakSet",[$h͏_a => (WeakSet = $h͏_a)]],["arrayFilter",[$h͏_a => (arrayFilter = $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)]],["getOwnPropertyDescriptor",[$h͏_a => (getOwnPropertyDescriptor = $h͏_a)]],["getOwnPropertyDescriptors",[$h͏_a => (getOwnPropertyDescriptors = $h͏_a)]],["globalThis",[$h͏_a => (globalThis = $h͏_a)]],["is",[$h͏_a => (is = $h͏_a)]],["isPrimitive",[$h͏_a => (isPrimitive = $h͏_a)]],["hasOwn",[$h͏_a => (hasOwn = $h͏_a)]],["values",[$h͏_a => (values = $h͏_a)]],["weaksetHas",[$h͏_a => (weaksetHas = $h͏_a)]]]],["./permits.js", [["constantProperties",[$h͏_a => (constantProperties = $h͏_a)]],["sharedGlobalPropertyNames",[$h͏_a => (sharedGlobalPropertyNames = $h͏_a)]],["universalPropertyNames",[$h͏_a => (universalPropertyNames = $h͏_a)]],["permitted",[$h͏_a => (permitted = $h͏_a)]]]]]);
5743
5942
 
5744
5943
 
5745
5944
 
@@ -5778,7 +5977,7 @@ const isFunction = obj => typeof obj === 'function';
5778
5977
  // get masked as one overwrites the other. Accordingly, the thrown error
5779
5978
  // complains of a "Conflicting definition".
5780
5979
  function initProperty(obj, name, desc) {
5781
- if (objectHasOwnProperty(obj, name)) {
5980
+ if (hasOwn(obj, name)) {
5782
5981
  const preDesc = getOwnPropertyDescriptor(obj, name);
5783
5982
  if (
5784
5983
  !preDesc ||
@@ -5810,7 +6009,7 @@ function initProperties(obj, descs) {
5810
6009
  function sampleGlobals(globalObject, newPropertyNames) {
5811
6010
  const newIntrinsics = { __proto__: null };
5812
6011
  for (const [globalName, intrinsicName] of entries(newPropertyNames)) {
5813
- if (objectHasOwnProperty(globalObject, globalName)) {
6012
+ if (hasOwn(globalObject, globalName)) {
5814
6013
  newIntrinsics[intrinsicName] = globalObject[globalName];
5815
6014
  }
5816
6015
  }
@@ -5835,11 +6034,11 @@ function sampleGlobals(globalObject, newPropertyNames) {
5835
6034
  // to the intrinsics.
5836
6035
  const completePrototypes = () => {
5837
6036
  for (const [name, intrinsic] of entries(intrinsics)) {
5838
- if (!isObject(intrinsic)) {
6037
+ if (isPrimitive(intrinsic)) {
5839
6038
  // eslint-disable-next-line no-continue
5840
6039
  continue;
5841
6040
  }
5842
- if (!objectHasOwnProperty(intrinsic, 'prototype')) {
6041
+ if (!hasOwn(intrinsic, 'prototype')) {
5843
6042
  // eslint-disable-next-line no-continue
5844
6043
  continue;
5845
6044
  }
@@ -5861,12 +6060,12 @@ function sampleGlobals(globalObject, newPropertyNames) {
5861
6060
  }
5862
6061
  if (
5863
6062
  typeof namePrototype !== 'string' ||
5864
- !objectHasOwnProperty(permitted, namePrototype)
6063
+ !hasOwn(permitted, namePrototype)
5865
6064
  ) {
5866
6065
  throw TypeError(`Unrecognized ${name}.prototype permits entry`);
5867
6066
  }
5868
6067
  const intrinsicPrototype = intrinsic.prototype;
5869
- if (objectHasOwnProperty(intrinsics, namePrototype)) {
6068
+ if (hasOwn(intrinsics, namePrototype)) {
5870
6069
  if (intrinsics[namePrototype] !== intrinsicPrototype) {
5871
6070
  throw TypeError(`Conflicting bindings of ${namePrototype}`);
5872
6071
  }
@@ -5933,8 +6132,8 @@ function sampleGlobals(globalObject, newPropertyNames) {
5933
6132
  };$h͏_once.getGlobalIntrinsics(getGlobalIntrinsics);
5934
6133
  })()
5935
6134
  ,
5936
- // === 16. ses ./src/permits-intrinsics.js ===
5937
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let permitted,FunctionInstance,isAccessorPermit,Map,String,Symbol,TypeError,arrayFilter,arrayIncludes,arrayMap,entries,getOwnPropertyDescriptor,getPrototypeOf,isObject,mapGet,objectHasOwnProperty,ownKeys,symbolKeyFor,cauterizeProperty;$h͏_imports([["./permits.js", [["permitted",[$h͏_a => (permitted = $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)]],["Symbol",[$h͏_a => (Symbol = $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)]]]],["./cauterize-property.js", [["cauterizeProperty",[$h͏_a => (cauterizeProperty = $h͏_a)]]]]]);
6135
+ // === 18. ses ./src/permits-intrinsics.js ===
6136
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let permitted,FunctionInstance,isAccessorPermit,Map,String,Symbol,TypeError,arrayFilter,arrayIncludes,arrayMap,entries,getOwnPropertyDescriptor,getPrototypeOf,isPrimitive,mapGet,hasOwn,ownKeys,symbolKeyFor,cauterizeProperty;$h͏_imports([["./permits.js", [["permitted",[$h͏_a => (permitted = $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)]],["Symbol",[$h͏_a => (Symbol = $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)]],["isPrimitive",[$h͏_a => (isPrimitive = $h͏_a)]],["mapGet",[$h͏_a => (mapGet = $h͏_a)]],["hasOwn",[$h͏_a => (hasOwn = $h͏_a)]],["ownKeys",[$h͏_a => (ownKeys = $h͏_a)]],["symbolKeyFor",[$h͏_a => (symbolKeyFor = $h͏_a)]]]],["./cauterize-property.js", [["cauterizeProperty",[$h͏_a => (cauterizeProperty = $h͏_a)]]]]]);
5938
6137
 
5939
6138
 
5940
6139
 
@@ -6067,8 +6266,8 @@ function sampleGlobals(globalObject, newPropertyNames) {
6067
6266
  * Validate the object's [[prototype]] against a permit.
6068
6267
  */
6069
6268
  function visitPrototype(path, obj, protoName) {
6070
- if (!isObject(obj)) {
6071
- throw TypeError(`Object expected: ${path}, ${obj}, ${protoName}`);
6269
+ if (isPrimitive(obj)) {
6270
+ throw TypeError(`Object expected: ${path}, ${String(obj)}, ${protoName}`);
6072
6271
  }
6073
6272
  const proto = getPrototypeOf(obj);
6074
6273
 
@@ -6121,7 +6320,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6121
6320
  // Assert: the permit is the name of an intrinsic.
6122
6321
  // Assert: the property value is equal to that intrinsic.
6123
6322
 
6124
- if (objectHasOwnProperty(intrinsics, permit)) {
6323
+ if (hasOwn(intrinsics, permit)) {
6125
6324
  if (value !== intrinsics[permit]) {
6126
6325
  throw TypeError(`Does not match permit for ${path}`);
6127
6326
  }
@@ -6161,7 +6360,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6161
6360
  }
6162
6361
 
6163
6362
  // Is this a value property?
6164
- if (objectHasOwnProperty(desc, 'value')) {
6363
+ if (hasOwn(desc, 'value')) {
6165
6364
  if (isAccessorPermit(permit)) {
6166
6365
  throw TypeError(`Accessor expected at ${path}`);
6167
6366
  }
@@ -6181,12 +6380,12 @@ function sampleGlobals(globalObject, newPropertyNames) {
6181
6380
  */
6182
6381
  function getSubPermit(obj, permit, prop) {
6183
6382
  const permitProp = prop === '__proto__' ? '--proto--' : prop;
6184
- if (objectHasOwnProperty(permit, permitProp)) {
6383
+ if (hasOwn(permit, permitProp)) {
6185
6384
  return permit[permitProp];
6186
6385
  }
6187
6386
 
6188
6387
  if (typeof obj === 'function') {
6189
- if (objectHasOwnProperty(FunctionInstance, permitProp)) {
6388
+ if (hasOwn(FunctionInstance, permitProp)) {
6190
6389
  return FunctionInstance[permitProp];
6191
6390
  }
6192
6391
  }
@@ -6227,7 +6426,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6227
6426
  }$h͏_once.default( removeUnpermittedIntrinsics);
6228
6427
  })()
6229
6428
  ,
6230
- // === 17. ses ./src/tame-function-constructors.js ===
6429
+ // === 19. ses ./src/tame-function-constructors.js ===
6231
6430
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let FERAL_FUNCTION,SyntaxError,TypeError,defineProperties,getPrototypeOf,setPrototypeOf,freeze,AsyncGeneratorFunctionInstance;$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)]],["AsyncGeneratorFunctionInstance",[$h͏_a => (AsyncGeneratorFunctionInstance = $h͏_a)]]]]]);
6232
6431
 
6233
6432
 
@@ -6370,7 +6569,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6370
6569
  }$h͏_once.default( tameFunctionConstructors);
6371
6570
  })()
6372
6571
  ,
6373
- // === 18. ses ./src/tame-date-constructor.js ===
6572
+ // === 20. ses ./src/tame-date-constructor.js ===
6374
6573
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
6375
6574
 
6376
6575
 
@@ -6500,7 +6699,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6500
6699
  }$h͏_once.default( tameDateConstructor);
6501
6700
  })()
6502
6701
  ,
6503
- // === 19. ses ./src/tame-math-object.js ===
6702
+ // === 21. ses ./src/tame-math-object.js ===
6504
6703
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
6505
6704
 
6506
6705
 
@@ -6544,7 +6743,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6544
6743
  }$h͏_once.default( tameMathObject);
6545
6744
  })()
6546
6745
  ,
6547
- // === 20. ses ./src/tame-regexp-constructor.js ===
6746
+ // === 22. ses ./src/tame-regexp-constructor.js ===
6548
6747
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
6549
6748
 
6550
6749
 
@@ -6612,7 +6811,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6612
6811
  }$h͏_once.default( tameRegExpConstructor);
6613
6812
  })()
6614
6813
  ,
6615
- // === 21. ses ./src/enablements.js ===
6814
+ // === 23. ses ./src/enablements.js ===
6616
6815
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let toStringTagSymbol,iteratorSymbol;$h͏_imports([["./commons.js", [["toStringTagSymbol",[$h͏_a => (toStringTagSymbol = $h͏_a)]],["iteratorSymbol",[$h͏_a => (iteratorSymbol = $h͏_a)]]]]]);
6617
6816
 
6618
6817
  /**
@@ -6859,8 +7058,8 @@ function sampleGlobals(globalObject, newPropertyNames) {
6859
7058
  };$h͏_once.severeEnablements(severeEnablements);
6860
7059
  })()
6861
7060
  ,
6862
- // === 22. ses ./src/enable-property-overrides.js ===
6863
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let Set,String,TypeError,arrayForEach,defineProperty,getOwnPropertyDescriptor,getOwnPropertyDescriptors,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)]],["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)]]]]]);
7061
+ // === 24. ses ./src/enable-property-overrides.js ===
7062
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let Set,String,TypeError,arrayForEach,defineProperty,getOwnPropertyDescriptor,getOwnPropertyDescriptors,isPrimitive,hasOwn,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)]],["isPrimitive",[$h͏_a => (isPrimitive = $h͏_a)]],["hasOwn",[$h͏_a => (hasOwn = $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)]]]]]);
6864
7063
 
6865
7064
 
6866
7065
 
@@ -6971,7 +7170,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6971
7170
  )}' of '${path}'`,
6972
7171
  );
6973
7172
  }
6974
- if (objectHasOwnProperty(this, prop)) {
7173
+ if (hasOwn(this, prop)) {
6975
7174
  this[prop] = newValue;
6976
7175
  } else {
6977
7176
  if (isDebug) {
@@ -7041,7 +7240,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
7041
7240
  enableProperty(subPath, obj, prop);
7042
7241
  } else if (subPlan === '*') {
7043
7242
  enableAllProperties(subPath, desc.value);
7044
- } else if (isObject(subPlan)) {
7243
+ } else if (!isPrimitive(subPlan)) {
7045
7244
  enableProperties(subPath, desc.value, subPlan);
7046
7245
  } else {
7047
7246
  throw TypeError(`Unexpected override enablement plan ${subPath}`);
@@ -7073,8 +7272,8 @@ function sampleGlobals(globalObject, newPropertyNames) {
7073
7272
  }$h͏_once.default( enablePropertyOverrides);
7074
7273
  })()
7075
7274
  ,
7076
- // === 23. ses ./src/tame-locale-methods.js ===
7077
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
7275
+ // === 25. ses ./src/tame-locale-methods.js ===
7276
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let Number,String,TypeError,defineProperty,getOwnPropertyNames,isPrimitive,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)]],["isPrimitive",[$h͏_a => (isPrimitive = $h͏_a)]],["regexpExec",[$h͏_a => (regexpExec = $h͏_a)]]]],["./error/assert.js", [["assert",[$h͏_a => (assert = $h͏_a)]]]]]);
7078
7277
 
7079
7278
 
7080
7279
 
@@ -7130,7 +7329,7 @@ const numberToString = tamedMethods.toString;
7130
7329
 
7131
7330
  for (const intrinsicName of getOwnPropertyNames(intrinsics)) {
7132
7331
  const intrinsic = intrinsics[intrinsicName];
7133
- if (isObject(intrinsic)) {
7332
+ if (!isPrimitive(intrinsic)) {
7134
7333
  for (const methodName of getOwnPropertyNames(intrinsic)) {
7135
7334
  const match = regexpExec(localePattern, methodName);
7136
7335
  if (match) {
@@ -7154,7 +7353,7 @@ const numberToString = tamedMethods.toString;
7154
7353
  }$h͏_once.default( tameLocaleMethods);
7155
7354
  })()
7156
7355
  ,
7157
- // === 24. ses ./src/make-eval-function.js ===
7356
+ // === 26. ses ./src/make-eval-function.js ===
7158
7357
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);/**
7159
7358
  * makeEvalFunction()
7160
7359
  * A safe version of the native eval function which relies on
@@ -7185,7 +7384,7 @@ const numberToString = tamedMethods.toString;
7185
7384
  };$h͏_once.makeEvalFunction(makeEvalFunction);
7186
7385
  })()
7187
7386
  ,
7188
- // === 25. ses ./src/make-function-constructor.js ===
7387
+ // === 27. ses ./src/make-function-constructor.js ===
7189
7388
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
7190
7389
 
7191
7390
 
@@ -7267,8 +7466,8 @@ const { Fail } = assert;
7267
7466
  };$h͏_once.makeFunctionConstructor(makeFunctionConstructor);
7268
7467
  })()
7269
7468
  ,
7270
- // === 26. ses ./src/global-object.js ===
7271
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]],["./permits.js", [["constantProperties",[$h͏_a => (constantProperties = $h͏_a)]],["universalPropertyNames",[$h͏_a => (universalPropertyNames = $h͏_a)]]]]]);
7469
+ // === 28. ses ./src/global-object.js ===
7470
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let TypeError,assign,create,defineProperty,entries,freeze,hasOwn,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)]],["hasOwn",[$h͏_a => (hasOwn = $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)]]]],["./permits.js", [["constantProperties",[$h͏_a => (constantProperties = $h͏_a)]],["universalPropertyNames",[$h͏_a => (universalPropertyNames = $h͏_a)]]]]]);
7272
7471
 
7273
7472
 
7274
7473
 
@@ -7357,7 +7556,7 @@ const { Fail } = assert;
7357
7556
  },
7358
7557
  ) => {
7359
7558
  for (const [name, intrinsicName] of entries(universalPropertyNames)) {
7360
- if (objectHasOwnProperty(intrinsics, intrinsicName)) {
7559
+ if (hasOwn(intrinsics, intrinsicName)) {
7361
7560
  defineProperty(globalObject, name, {
7362
7561
  value: intrinsics[intrinsicName],
7363
7562
  writable: true,
@@ -7368,7 +7567,7 @@ const { Fail } = assert;
7368
7567
  }
7369
7568
 
7370
7569
  for (const [name, intrinsicName] of entries(newGlobalPropertyNames)) {
7371
- if (objectHasOwnProperty(intrinsics, intrinsicName)) {
7570
+ if (hasOwn(intrinsics, intrinsicName)) {
7372
7571
  defineProperty(globalObject, name, {
7373
7572
  value: intrinsics[intrinsicName],
7374
7573
  writable: true,
@@ -7445,7 +7644,7 @@ const { Fail } = assert;
7445
7644
  };$h͏_once.setGlobalObjectEvaluators(setGlobalObjectEvaluators);
7446
7645
  })()
7447
7646
  ,
7448
- // === 27. ses ./src/strict-scope-terminator.js ===
7647
+ // === 29. ses ./src/strict-scope-terminator.js ===
7449
7648
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let Proxy,String,TypeError,ReferenceError,create,freeze,getOwnPropertyDescriptors,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)]]]],["./error/assert.js", [["assert",[$h͏_a => (assert = $h͏_a)]]]]]);
7450
7649
 
7451
7650
 
@@ -7547,7 +7746,7 @@ const scopeProxyHandlerProperties = {
7547
7746
  );$h͏_once.strictScopeTerminator(strictScopeTerminator);
7548
7747
  })()
7549
7748
  ,
7550
- // === 28. ses ./src/sloppy-globals-scope-terminator.js ===
7749
+ // === 30. ses ./src/sloppy-globals-scope-terminator.js ===
7551
7750
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let Proxy,create,freeze,getOwnPropertyDescriptors,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)]],["reflectSet",[$h͏_a => (reflectSet = $h͏_a)]]]],["./strict-scope-terminator.js", [["strictScopeTerminatorHandler",[$h͏_a => (strictScopeTerminatorHandler = $h͏_a)]],["alwaysThrowHandler",[$h͏_a => (alwaysThrowHandler = $h͏_a)]]]]]);
7552
7751
 
7553
7752
 
@@ -7611,7 +7810,7 @@ const objTarget = freeze({ __proto__: null });
7611
7810
  freeze(createSloppyGlobalsScopeTerminator);
7612
7811
  })()
7613
7812
  ,
7614
- // === 29. ses ./src/eval-scope.js ===
7813
+ // === 31. ses ./src/eval-scope.js ===
7615
7814
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
7616
7815
 
7617
7816
 
@@ -7703,7 +7902,7 @@ const { Fail } = assert;
7703
7902
  };$h͏_once.makeEvalScopeKit(makeEvalScopeKit);
7704
7903
  })()
7705
7904
  ,
7706
- // === 30. ses ./src/get-source-url.js ===
7905
+ // === 32. ses ./src/get-source-url.js ===
7707
7906
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
7708
7907
 
7709
7908
  // Captures a key and value of the form #key=value or @key=value
@@ -7756,7 +7955,7 @@ const sourceMetaEntriesRegExp = new FERAL_REG_EXP(
7756
7955
  };$h͏_once.getSourceURL(getSourceURL);
7757
7956
  })()
7758
7957
  ,
7759
- // === 31. ses ./src/transforms.js ===
7958
+ // === 33. ses ./src/transforms.js ===
7760
7959
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
7761
7960
 
7762
7961
 
@@ -8026,8 +8225,8 @@ $h͏_once.applyTransforms(applyTransforms);const transforms=freeze({
8026
8225
  });$h͏_once.transforms(transforms);
8027
8226
  })()
8028
8227
  ,
8029
- // === 32. ses ./src/scope-constants.js ===
8030
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
8228
+ // === 34. ses ./src/scope-constants.js ===
8229
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let arrayFilter,arrayIncludes,getOwnPropertyDescriptor,getOwnPropertyNames,hasOwn,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)]],["hasOwn",[$h͏_a => (hasOwn = $h͏_a)]],["regexpTest",[$h͏_a => (regexpTest = $h͏_a)]]]]]);
8031
8230
 
8032
8231
 
8033
8232
 
@@ -8160,7 +8359,7 @@ function isImmutableDataProperty(obj, name) {
8160
8359
  // can't have accessors and value properties at the same time, therefore
8161
8360
  // this check is sufficient. Using explicit own property deal with the
8162
8361
  // case where Object.prototype has been poisoned.
8163
- objectHasOwnProperty(desc, 'value')
8362
+ hasOwn(desc, 'value')
8164
8363
  );
8165
8364
  }
8166
8365
 
@@ -8209,7 +8408,7 @@ function isImmutableDataProperty(obj, name) {
8209
8408
  };$h͏_once.getScopeConstants(getScopeConstants);
8210
8409
  })()
8211
8410
  ,
8212
- // === 33. ses ./src/make-evaluate.js ===
8411
+ // === 35. ses ./src/make-evaluate.js ===
8213
8412
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
8214
8413
 
8215
8414
 
@@ -8322,7 +8521,7 @@ function buildOptimizer(constants, name) {
8322
8521
  };$h͏_once.makeEvaluate(makeEvaluate);
8323
8522
  })()
8324
8523
  ,
8325
- // === 34. ses ./src/make-safe-evaluator.js ===
8524
+ // === 36. ses ./src/make-safe-evaluator.js ===
8326
8525
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let apply,arrayFlatMap,freeze,identity,strictScopeTerminator,createSloppyGlobalsScopeTerminator,makeEvalScopeKit,applyTransforms,mandatoryTransforms,makeEvaluate,assert;$h͏_imports([["./commons.js", [["apply",[$h͏_a => (apply = $h͏_a)]],["arrayFlatMap",[$h͏_a => (arrayFlatMap = $h͏_a)]],["freeze",[$h͏_a => (freeze = $h͏_a)]],["identity",[$h͏_a => (identity = $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)]]]]]);
8327
8526
 
8328
8527
 
@@ -8437,7 +8636,7 @@ const { Fail } = assert;
8437
8636
  };$h͏_once.makeSafeEvaluator(makeSafeEvaluator);
8438
8637
  })()
8439
8638
  ,
8440
- // === 35. ses ./src/tame-function-tostring.js ===
8639
+ // === 37. ses ./src/tame-function-tostring.js ===
8441
8640
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
8442
8641
 
8443
8642
 
@@ -8490,7 +8689,7 @@ let markVirtualizedNativeFunction;
8490
8689
  };$h͏_once.tameFunctionToString(tameFunctionToString);
8491
8690
  })()
8492
8691
  ,
8493
- // === 36. ses ./src/tame-domains.js ===
8692
+ // === 38. ses ./src/tame-domains.js ===
8494
8693
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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);
8495
8694
 
8496
8695
 
@@ -8534,7 +8733,7 @@ let markVirtualizedNativeFunction;
8534
8733
  }
8535
8734
  })()
8536
8735
  ,
8537
- // === 37. ses ./src/tame-module-source.js ===
8736
+ // === 39. ses ./src/tame-module-source.js ===
8538
8737
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let functionPrototype,getPrototypeOf,globalThis,objectPrototype,setPrototypeOf;$h͏_imports([["./commons.js", [["functionPrototype",[$h͏_a => (functionPrototype = $h͏_a)]],["getPrototypeOf",[$h͏_a => (getPrototypeOf = $h͏_a)]],["globalThis",[$h͏_a => (globalThis = $h͏_a)]],["objectPrototype",[$h͏_a => (objectPrototype = $h͏_a)]],["setPrototypeOf",[$h͏_a => (setPrototypeOf = $h͏_a)]]]]]);
8539
8738
 
8540
8739
 
@@ -8588,7 +8787,7 @@ let markVirtualizedNativeFunction;
8588
8787
  };$h͏_once.tameModuleSource(tameModuleSource);
8589
8788
  })()
8590
8789
  ,
8591
- // === 38. ses ./src/error/console.js ===
8790
+ // === 40. ses ./src/error/console.js ===
8592
8791
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let WeakSet,arrayFilter,arrayFlatMap,arrayMap,arrayPop,arrayPush,defineProperty,freeze,fromEntries,isError,stringEndsWith,stringIncludes,stringSplit,weaksetAdd,weaksetHas;$h͏_imports([["../commons.js", [["WeakSet",[$h͏_a => (WeakSet = $h͏_a)]],["arrayFilter",[$h͏_a => (arrayFilter = $h͏_a)]],["arrayFlatMap",[$h͏_a => (arrayFlatMap = $h͏_a)]],["arrayMap",[$h͏_a => (arrayMap = $h͏_a)]],["arrayPop",[$h͏_a => (arrayPop = $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)]],["stringIncludes",[$h͏_a => (stringIncludes = $h͏_a)]],["stringSplit",[$h͏_a => (stringSplit = $h͏_a)]],["weaksetAdd",[$h͏_a => (weaksetAdd = $h͏_a)]],["weaksetHas",[$h͏_a => (weaksetHas = $h͏_a)]]]]]);
8593
8792
 
8594
8793
 
@@ -9132,7 +9331,7 @@ freeze(defineCausalConsoleFromLogger);
9132
9331
  freeze(filterConsole);
9133
9332
  })()
9134
9333
  ,
9135
- // === 39. ses ./src/error/unhandled-rejection.js ===
9334
+ // === 41. ses ./src/error/unhandled-rejection.js ===
9136
9335
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
9137
9336
 
9138
9337
 
@@ -9257,7 +9456,7 @@ freeze(filterConsole);
9257
9456
  };$h͏_once.makeRejectionHandlers(makeRejectionHandlers);
9258
9457
  })()
9259
9458
  ,
9260
- // === 40. ses ./src/error/tame-console.js ===
9459
+ // === 42. ses ./src/error/tame-console.js ===
9261
9460
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let TypeError,apply,defineProperty,freeze,globalThis,defaultHandler,makeCausalConsole,makeRejectionHandlers;$h͏_imports([["../commons.js", [["TypeError",[$h͏_a => (TypeError = $h͏_a)]],["apply",[$h͏_a => (apply = $h͏_a)]],["defineProperty",[$h͏_a => (defineProperty = $h͏_a)]],["freeze",[$h͏_a => (freeze = $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)]]]]]);
9262
9461
 
9263
9462
 
@@ -9457,7 +9656,7 @@ const wrapLogger = (logger, thisArg) =>
9457
9656
  };$h͏_once.tameConsole(tameConsole);
9458
9657
  })()
9459
9658
  ,
9460
- // === 41. ses ./src/error/tame-v8-error-constructor.js ===
9659
+ // === 43. ses ./src/error/tame-v8-error-constructor.js ===
9461
9660
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let WeakMap,WeakSet,apply,arrayFilter,arrayJoin,arrayMap,arraySlice,create,defineProperties,fromEntries,reflectSet,regexpExec,regexpTest,weakmapGet,weakmapSet,weaksetAdd,weaksetHas,TypeError;$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)]],["TypeError",[$h͏_a => (TypeError = $h͏_a)]]]]]);
9462
9661
 
9463
9662
 
@@ -9846,7 +10045,7 @@ const CALLSITE_PATTERNS = [
9846
10045
  };$h͏_once.tameV8ErrorConstructor(tameV8ErrorConstructor);
9847
10046
  })()
9848
10047
  ,
9849
- // === 42. ses ./src/error/tame-error-constructor.js ===
10048
+ // === 44. ses ./src/error/tame-error-constructor.js ===
9850
10049
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let FERAL_ERROR,apply,construct,defineProperties,setPrototypeOf,getOwnPropertyDescriptor,defineProperty,getOwnPropertyDescriptors,NativeErrors,tameV8ErrorConstructor;$h͏_imports([["../commons.js", [["FERAL_ERROR",[$h͏_a => (FERAL_ERROR = $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)]],["getOwnPropertyDescriptors",[$h͏_a => (getOwnPropertyDescriptors = $h͏_a)]]]],["../permits.js", [["NativeErrors",[$h͏_a => (NativeErrors = $h͏_a)]]]],["./tame-v8-error-constructor.js", [["tameV8ErrorConstructor",[$h͏_a => (tameV8ErrorConstructor = $h͏_a)]]]]]);
9851
10050
 
9852
10051
 
@@ -10133,8 +10332,8 @@ let initialGetStackString = tamedMethods.getStackString;
10133
10332
  }$h͏_once.default( tameErrorConstructor);
10134
10333
  })()
10135
10334
  ,
10136
- // === 43. ses ./src/module-load.js ===
10137
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let getenv,Map,Set,TypeError,arrayJoin,arrayMap,arrayPush,arraySome,create,freeze,generatorNext,generatorThrow,getOwnPropertyNames,isArray,isObject,mapGet,mapHas,mapSet,promiseThen,setAdd,values,weakmapGet,weakmapHas,makeError,annotateError,q,b,X;$h͏_imports([["@endo/env-options", [["getEnvironmentOption",[$h͏_a => (getenv = $h͏_a)]]]],["./commons.js", [["Map",[$h͏_a => (Map = $h͏_a)]],["Set",[$h͏_a => (Set = $h͏_a)]],["TypeError",[$h͏_a => (TypeError = $h͏_a)]],["arrayJoin",[$h͏_a => (arrayJoin = $h͏_a)]],["arrayMap",[$h͏_a => (arrayMap = $h͏_a)]],["arrayPush",[$h͏_a => (arrayPush = $h͏_a)]],["arraySome",[$h͏_a => (arraySome = $h͏_a)]],["create",[$h͏_a => (create = $h͏_a)]],["freeze",[$h͏_a => (freeze = $h͏_a)]],["generatorNext",[$h͏_a => (generatorNext = $h͏_a)]],["generatorThrow",[$h͏_a => (generatorThrow = $h͏_a)]],["getOwnPropertyNames",[$h͏_a => (getOwnPropertyNames = $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)]],["promiseThen",[$h͏_a => (promiseThen = $h͏_a)]],["setAdd",[$h͏_a => (setAdd = $h͏_a)]],["values",[$h͏_a => (values = $h͏_a)]],["weakmapGet",[$h͏_a => (weakmapGet = $h͏_a)]],["weakmapHas",[$h͏_a => (weakmapHas = $h͏_a)]]]],["./error/assert.js", [["makeError",[$h͏_a => (makeError = $h͏_a)]],["annotateError",[$h͏_a => (annotateError = $h͏_a)]],["q",[$h͏_a => (q = $h͏_a)]],["b",[$h͏_a => (b = $h͏_a)]],["X",[$h͏_a => (X = $h͏_a)]]]]]);
10335
+ // === 45. ses ./src/module-load.js ===
10336
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let getenv,Map,Set,TypeError,arrayJoin,arrayMap,arrayPush,arraySome,create,freeze,generatorNext,generatorThrow,getOwnPropertyNames,isArray,isPrimitive,mapGet,mapHas,mapSet,promiseThen,setAdd,values,weakmapGet,weakmapHas,makeError,annotateError,q,b,X;$h͏_imports([["@endo/env-options", [["getEnvironmentOption",[$h͏_a => (getenv = $h͏_a)]]]],["./commons.js", [["Map",[$h͏_a => (Map = $h͏_a)]],["Set",[$h͏_a => (Set = $h͏_a)]],["TypeError",[$h͏_a => (TypeError = $h͏_a)]],["arrayJoin",[$h͏_a => (arrayJoin = $h͏_a)]],["arrayMap",[$h͏_a => (arrayMap = $h͏_a)]],["arrayPush",[$h͏_a => (arrayPush = $h͏_a)]],["arraySome",[$h͏_a => (arraySome = $h͏_a)]],["create",[$h͏_a => (create = $h͏_a)]],["freeze",[$h͏_a => (freeze = $h͏_a)]],["generatorNext",[$h͏_a => (generatorNext = $h͏_a)]],["generatorThrow",[$h͏_a => (generatorThrow = $h͏_a)]],["getOwnPropertyNames",[$h͏_a => (getOwnPropertyNames = $h͏_a)]],["isArray",[$h͏_a => (isArray = $h͏_a)]],["isPrimitive",[$h͏_a => (isPrimitive = $h͏_a)]],["mapGet",[$h͏_a => (mapGet = $h͏_a)]],["mapHas",[$h͏_a => (mapHas = $h͏_a)]],["mapSet",[$h͏_a => (mapSet = $h͏_a)]],["promiseThen",[$h͏_a => (promiseThen = $h͏_a)]],["setAdd",[$h͏_a => (setAdd = $h͏_a)]],["values",[$h͏_a => (values = $h͏_a)]],["weakmapGet",[$h͏_a => (weakmapGet = $h͏_a)]],["weakmapHas",[$h͏_a => (weakmapHas = $h͏_a)]]]],["./error/assert.js", [["makeError",[$h͏_a => (makeError = $h͏_a)]],["annotateError",[$h͏_a => (annotateError = $h͏_a)]],["q",[$h͏_a => (q = $h͏_a)]],["b",[$h͏_a => (b = $h͏_a)]],["X",[$h͏_a => (X = $h͏_a)]]]]]);
10138
10337
 
10139
10338
 
10140
10339
 
@@ -10322,7 +10521,7 @@ function* loadWithoutErrorAnnotation(
10322
10521
  )} in parent compartment, use {source} module descriptor`,
10323
10522
  TypeError,
10324
10523
  );
10325
- } else if (isObject(moduleDescriptor)) {
10524
+ } else if (!isPrimitive(moduleDescriptor)) {
10326
10525
  // In this shim (and not in XS, and not in the standard we imagine), we
10327
10526
  // allow a module namespace object to stand in for a module descriptor that
10328
10527
  // describes its original {compartment, specifier} so that it can be used
@@ -10345,7 +10544,7 @@ function* loadWithoutErrorAnnotation(
10345
10544
  namespace: aliasSpecifier,
10346
10545
  } = moduleDescriptor;
10347
10546
  if (
10348
- !isObject(aliasCompartment) ||
10547
+ isPrimitive(aliasCompartment) ||
10349
10548
  !weakmapHas(compartmentPrivateFields, aliasCompartment)
10350
10549
  ) {
10351
10550
  throw makeError(
@@ -10369,7 +10568,7 @@ function* loadWithoutErrorAnnotation(
10369
10568
 
10370
10569
  // All remaining objects must either be a module namespace, or be
10371
10570
  // promoted into a module namespace with a virtual module source.
10372
- if (isObject(moduleDescriptor.namespace)) {
10571
+ if (!isPrimitive(moduleDescriptor.namespace)) {
10373
10572
  const { namespace } = moduleDescriptor;
10374
10573
  // Brand-check SES shim module exports namespaces:
10375
10574
  aliasDescriptor = weakmapGet(moduleAliases, namespace);
@@ -10542,7 +10741,7 @@ function* loadWithoutErrorAnnotation(
10542
10741
  moduleDescriptor.specifier !== undefined
10543
10742
  ) {
10544
10743
  if (
10545
- !isObject(moduleDescriptor.compartment) ||
10744
+ isPrimitive(moduleDescriptor.compartment) ||
10546
10745
  !weakmapHas(compartmentPrivateFields, moduleDescriptor.compartment) ||
10547
10746
  typeof moduleDescriptor.specifier !== 'string'
10548
10747
  ) {
@@ -10643,7 +10842,12 @@ const memoizedLoadWithErrorAnnotation = (
10643
10842
  return moduleLoading;
10644
10843
  };
10645
10844
 
10646
- const asyncJobQueue = (errors = []) => {
10845
+ /**
10846
+ * If `aggregateErrors` is `false`, the `errors` property of the fulfilled object
10847
+ * will always be empty.
10848
+ * @param {{errors?: Error[], noAggregateErrors?: boolean}} [options]
10849
+ */
10850
+ const asyncJobQueue = ({ errors = [], noAggregateErrors = false } = {}) => {
10647
10851
  /** @type {Set<Promise<undefined>>} */
10648
10852
  const pendingJobs = new Set();
10649
10853
 
@@ -10659,7 +10863,11 @@ const asyncJobQueue = (errors = []) => {
10659
10863
  setAdd(
10660
10864
  pendingJobs,
10661
10865
  promiseThen(func(...args), noop, error => {
10662
- arrayPush(errors, error);
10866
+ if (noAggregateErrors) {
10867
+ throw error;
10868
+ } else {
10869
+ arrayPush(errors, error);
10870
+ }
10663
10871
  }),
10664
10872
  );
10665
10873
  };
@@ -10676,7 +10884,12 @@ const asyncJobQueue = (errors = []) => {
10676
10884
  return { enqueueJob, drainQueue, errors };
10677
10885
  };
10678
10886
 
10679
- const syncJobQueue = (errors = []) => {
10887
+ /**
10888
+ * If `aggregateErrors` is `false`, the `errors` property of the returned object
10889
+ * will always be empty.
10890
+ * @param {{errors?: Error[], noAggregateErrors?: boolean}} [options]
10891
+ */
10892
+ const syncJobQueue = ({ errors = [], noAggregateErrors = false } = {}) => {
10680
10893
  let current = [];
10681
10894
  let next = [];
10682
10895
 
@@ -10700,7 +10913,11 @@ const syncJobQueue = (errors = []) => {
10700
10913
  try {
10701
10914
  func(...args);
10702
10915
  } catch (error) {
10703
- arrayPush(errors, error);
10916
+ if (noAggregateErrors) {
10917
+ throw error;
10918
+ } else {
10919
+ arrayPush(errors, error);
10920
+ }
10704
10921
  }
10705
10922
  }
10706
10923
  current = next;
@@ -10733,18 +10950,24 @@ const throwAggregateError = ({ errors, errorPrefix }) => {
10733
10950
  const preferSync = (_asyncImpl, syncImpl) => syncImpl;
10734
10951
  const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10735
10952
 
10736
- /*
10953
+ /**
10737
10954
  * `load` asynchronously gathers the module records for a module and its
10738
10955
  * transitive dependencies.
10739
10956
  * The module records refer to each other by a reference to the dependency's
10740
10957
  * compartment and the specifier of the module within its own compartment.
10741
10958
  * This graph is then ready to be synchronously linked and executed.
10959
+ * @param {WeakMap<Compartment, any>} compartmentPrivateFields
10960
+ * @param {WeakMap<object, object>} moduleAliases
10961
+ * @param {Compartment} compartment
10962
+ * @param {string} moduleSpecifier - The module specifier to load.
10963
+ * @param {{ noAggregateErrors?: boolean}} options
10742
10964
  */
10743
10965
  const load = async (
10744
10966
  compartmentPrivateFields,
10745
10967
  moduleAliases,
10746
10968
  compartment,
10747
10969
  moduleSpecifier,
10970
+ { noAggregateErrors = false } = {},
10748
10971
  ) => {
10749
10972
  const { name: compartmentName } = weakmapGet(
10750
10973
  compartmentPrivateFields,
@@ -10754,7 +10977,9 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10754
10977
  /** @type {Map<object, Map<string, Promise<Record<any, any>>>>} */
10755
10978
  const moduleLoads = new Map();
10756
10979
 
10757
- const { enqueueJob, drainQueue, errors } = asyncJobQueue();
10980
+ const { enqueueJob, drainQueue, errors } = asyncJobQueue({
10981
+ noAggregateErrors,
10982
+ });
10758
10983
 
10759
10984
  enqueueJob(memoizedLoadWithErrorAnnotation, [
10760
10985
  compartmentPrivateFields,
@@ -10776,18 +11001,25 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10776
11001
  });
10777
11002
  };
10778
11003
 
10779
- /*
11004
+ /**
10780
11005
  * `loadNow` synchronously gathers the module records for a specified module
10781
11006
  * and its transitive dependencies.
10782
11007
  * The module records refer to each other by a reference to the dependency's
10783
11008
  * compartment and the specifier of the module within its own compartment.
10784
11009
  * This graph is then ready to be synchronously linked and executed.
11010
+ * @param {WeakMap<Compartment, any>} compartmentPrivateFields
11011
+ * @param {WeakMap<object, object>} moduleAliases
11012
+ * @param {Compartment} compartment
11013
+ * @param {string} moduleSpecifier - The module specifier to load.
11014
+ * @param {{ noAggregateErrors?: boolean}} options
10785
11015
  */$h͏_once.load(load);
11016
+
10786
11017
  const loadNow = (
10787
11018
  compartmentPrivateFields,
10788
11019
  moduleAliases,
10789
11020
  compartment,
10790
11021
  moduleSpecifier,
11022
+ { noAggregateErrors = false } = {},
10791
11023
  ) => {
10792
11024
  const { name: compartmentName } = weakmapGet(
10793
11025
  compartmentPrivateFields,
@@ -10797,7 +11029,9 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10797
11029
  /** @type {Map<object, Map<string, Promise<Record<any, any>>>>} */
10798
11030
  const moduleLoads = new Map();
10799
11031
 
10800
- const { enqueueJob, drainQueue, errors } = syncJobQueue();
11032
+ const { enqueueJob, drainQueue, errors } = syncJobQueue({
11033
+ noAggregateErrors,
11034
+ });
10801
11035
 
10802
11036
  enqueueJob(memoizedLoadWithErrorAnnotation, [
10803
11037
  compartmentPrivateFields,
@@ -10820,7 +11054,7 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10820
11054
  };$h͏_once.loadNow(loadNow);
10821
11055
  })()
10822
11056
  ,
10823
- // === 44. ses ./src/module-proxy.js ===
11057
+ // === 46. ses ./src/module-proxy.js ===
10824
11058
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let makeAlias,Proxy,TypeError,create,freeze,mapGet,mapHas,mapSet,ownKeys,reflectGet,reflectGetOwnPropertyDescriptor,reflectHas,reflectIsExtensible,reflectPreventExtensions,toStringTagSymbol,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)]],["toStringTagSymbol",[$h͏_a => (toStringTagSymbol = $h͏_a)]],["weakmapSet",[$h͏_a => (weakmapSet = $h͏_a)]]]],["./error/assert.js", [["assert",[$h͏_a => (assert = $h͏_a)]]]]]);
10825
11059
 
10826
11060
 
@@ -11023,7 +11257,7 @@ const { quote: q } = assert;
11023
11257
  };$h͏_once.getDeferredExports(getDeferredExports);
11024
11258
  })()
11025
11259
  ,
11026
- // === 45. ses ./src/compartment-evaluate.js ===
11260
+ // === 47. ses ./src/compartment-evaluate.js ===
11027
11261
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
11028
11262
 
11029
11263
 
@@ -11119,7 +11353,7 @@ const { quote: q } = assert;
11119
11353
  };$h͏_once.compartmentEvaluate(compartmentEvaluate);
11120
11354
  })()
11121
11355
  ,
11122
- // === 46. ses ./src/module-instance.js ===
11356
+ // === 48. ses ./src/module-instance.js ===
11123
11357
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';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)]]]]]);
11124
11358
 
11125
11359
 
@@ -11619,8 +11853,8 @@ $h͏_once.makeVirtualModuleInstance(makeVirtualModuleInstance);const makeModuleI
11619
11853
  };$h͏_once.makeModuleInstance(makeModuleInstance);
11620
11854
  })()
11621
11855
  ,
11622
- // === 47. ses ./src/module-link.js ===
11623
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let assert,makeModuleInstance,makeVirtualModuleInstance,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)]],["makeVirtualModuleInstance",[$h͏_a => (makeVirtualModuleInstance = $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)]]]]]);
11856
+ // === 49. ses ./src/module-link.js ===
11857
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let assert,makeModuleInstance,makeVirtualModuleInstance,Map,ReferenceError,TypeError,entries,isArray,isPrimitive,mapGet,mapHas,mapSet,weakmapGet;$h͏_imports([["./error/assert.js", [["assert",[$h͏_a => (assert = $h͏_a)]]]],["./module-instance.js", [["makeModuleInstance",[$h͏_a => (makeModuleInstance = $h͏_a)]],["makeVirtualModuleInstance",[$h͏_a => (makeVirtualModuleInstance = $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)]],["isPrimitive",[$h͏_a => (isPrimitive = $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)]]]]]);
11624
11858
 
11625
11859
 
11626
11860
 
@@ -11681,11 +11915,11 @@ function mayBePrecompiledModuleSource(moduleSource) {
11681
11915
 
11682
11916
  function validatePrecompiledModuleSource(moduleSource, moduleSpecifier) {
11683
11917
  const { __fixedExportMap__, __liveExportMap__ } = moduleSource;
11684
- isObject(__fixedExportMap__) ||
11918
+ !isPrimitive(__fixedExportMap__) ||
11685
11919
  Fail`Property '__fixedExportMap__' of a precompiled module source must be an object, got ${q(
11686
11920
  __fixedExportMap__,
11687
11921
  )}, for module ${q(moduleSpecifier)}`;
11688
- isObject(__liveExportMap__) ||
11922
+ !isPrimitive(__liveExportMap__) ||
11689
11923
  Fail`Property '__liveExportMap__' of a precompiled module source must be an object, got ${q(
11690
11924
  __liveExportMap__,
11691
11925
  )}, for module ${q(moduleSpecifier)}`;
@@ -11704,7 +11938,7 @@ function validateVirtualModuleSource(moduleSource, moduleSpecifier) {
11704
11938
  }
11705
11939
 
11706
11940
  function validateModuleSource(moduleSource, moduleSpecifier) {
11707
- isObject(moduleSource) ||
11941
+ !isPrimitive(moduleSource) ||
11708
11942
  Fail`Invalid module source: must be of type object, got ${q(
11709
11943
  moduleSource,
11710
11944
  )}, for module ${q(moduleSpecifier)}`;
@@ -11781,7 +12015,7 @@ function validateModuleSource(moduleSource, moduleSpecifier) {
11781
12015
  };$h͏_once.instantiate(instantiate);
11782
12016
  })()
11783
12017
  ,
11784
- // === 48. ses ./src/compartment.js ===
12018
+ // === 50. ses ./src/compartment.js ===
11785
12019
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let Map,TypeError,WeakMap,arrayFlatMap,assign,defineProperties,identity,promiseThen,toStringTagSymbol,weakmapGet,weakmapSet,setGlobalObjectSymbolUnscopables,setGlobalObjectConstantProperties,setGlobalObjectMutableProperties,setGlobalObjectEvaluators,assert,assertEqual,q,sharedGlobalPropertyNames,load,loadNow,link,getDeferredExports,compartmentEvaluate,makeSafeEvaluator;$h͏_imports([["./commons.js", [["Map",[$h͏_a => (Map = $h͏_a)]],["TypeError",[$h͏_a => (TypeError = $h͏_a)]],["WeakMap",[$h͏_a => (WeakMap = $h͏_a)]],["arrayFlatMap",[$h͏_a => (arrayFlatMap = $h͏_a)]],["assign",[$h͏_a => (assign = $h͏_a)]],["defineProperties",[$h͏_a => (defineProperties = $h͏_a)]],["identity",[$h͏_a => (identity = $h͏_a)]],["promiseThen",[$h͏_a => (promiseThen = $h͏_a)]],["toStringTagSymbol",[$h͏_a => (toStringTagSymbol = $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)]]]],["./error/assert.js", [["assert",[$h͏_a => (assert = $h͏_a)]],["assertEqual",[$h͏_a => (assertEqual = $h͏_a)]],["q",[$h͏_a => (q = $h͏_a)]]]],["./permits.js", [["sharedGlobalPropertyNames",[$h͏_a => (sharedGlobalPropertyNames = $h͏_a)]]]],["./module-load.js", [["load",[$h͏_a => (load = $h͏_a)]],["loadNow",[$h͏_a => (loadNow = $h͏_a)]]]],["./module-link.js", [["link",[$h͏_a => (link = $h͏_a)]]]],["./module-proxy.js", [["getDeferredExports",[$h͏_a => (getDeferredExports = $h͏_a)]]]],["./compartment-evaluate.js", [["compartmentEvaluate",[$h͏_a => (compartmentEvaluate = $h͏_a)]]]],["./make-safe-evaluator.js", [["makeSafeEvaluator",[$h͏_a => (makeSafeEvaluator = $h͏_a)]]]]]);
11786
12020
 
11787
12021
 
@@ -11888,6 +12122,7 @@ const moduleAliases = new WeakMap();
11888
12122
  * @property {Compartment} [parentCompartment]
11889
12123
  * @property {boolean} noNamespaceBox
11890
12124
  * @property {(fullSpecifier: string) => Promise<ModuleExportsNamespace>} compartmentImport
12125
+ * @property {boolean} [noAggregateLoadErrors]
11891
12126
  */
11892
12127
 
11893
12128
  /**
@@ -11957,16 +12192,17 @@ const compartmentImportNow = (compartment, specifier) => {
11957
12192
  },
11958
12193
 
11959
12194
  async import(specifier) {
11960
- const { noNamespaceBox } = /** @type {CompartmentFields} */ (
11961
- weakmapGet(privateFields, this)
11962
- );
12195
+ const { noNamespaceBox, noAggregateLoadErrors } =
12196
+ /** @type {CompartmentFields} */ (weakmapGet(privateFields, this));
11963
12197
 
11964
12198
  if (typeof specifier !== 'string') {
11965
12199
  throw TypeError('first argument of import() must be a string');
11966
12200
  }
11967
12201
 
11968
12202
  return promiseThen(
11969
- load(privateFields, moduleAliases, this, specifier),
12203
+ load(privateFields, moduleAliases, this, specifier, {
12204
+ noAggregateErrors: noAggregateLoadErrors,
12205
+ }),
11970
12206
  () => {
11971
12207
  // The namespace box is a contentious design and likely to be a breaking
11972
12208
  // change in an appropriately numbered future version.
@@ -11989,16 +12225,27 @@ const compartmentImportNow = (compartment, specifier) => {
11989
12225
  throw TypeError('first argument of load() must be a string');
11990
12226
  }
11991
12227
 
11992
- return load(privateFields, moduleAliases, this, specifier);
12228
+ const { noAggregateLoadErrors } = /** @type {CompartmentFields} */ (
12229
+ weakmapGet(privateFields, this)
12230
+ );
12231
+
12232
+ return load(privateFields, moduleAliases, this, specifier, {
12233
+ noAggregateErrors: noAggregateLoadErrors,
12234
+ });
11993
12235
  },
11994
12236
 
11995
12237
  importNow(specifier) {
11996
12238
  if (typeof specifier !== 'string') {
11997
12239
  throw TypeError('first argument of importNow() must be a string');
11998
12240
  }
12241
+ const { noAggregateLoadErrors } = /** @type {CompartmentFields} */ (
12242
+ weakmapGet(privateFields, this)
12243
+ );
11999
12244
 
12000
- loadNow(privateFields, moduleAliases, this, specifier);
12001
- return compartmentImportNow(this, specifier);
12245
+ loadNow(privateFields, moduleAliases, this, specifier, {
12246
+ noAggregateErrors: noAggregateLoadErrors,
12247
+ });
12248
+ return compartmentImportNow(/** @type {Compartment} */ (this), specifier);
12002
12249
  },
12003
12250
  };
12004
12251
 
@@ -12129,6 +12376,7 @@ defineProperties(InertCompartment, {
12129
12376
  moduleMapHook,
12130
12377
  importMetaHook,
12131
12378
  __noNamespaceBox__: noNamespaceBox = false,
12379
+ noAggregateLoadErrors = false,
12132
12380
  } = compartmentOptions(...args);
12133
12381
  const globalTransforms = arrayFlatMap(
12134
12382
  [transforms, __shimTransforms__],
@@ -12206,7 +12454,9 @@ defineProperties(InertCompartment, {
12206
12454
  `Compartment does not support dynamic import: no configured resolveHook for compartment ${q(name)}`,
12207
12455
  );
12208
12456
  }
12209
- await load(privateFields, moduleAliases, compartment, fullSpecifier);
12457
+ await load(privateFields, moduleAliases, compartment, fullSpecifier, {
12458
+ noAggregateErrors: noAggregateLoadErrors,
12459
+ });
12210
12460
  const { execute, exportsProxy } = link(
12211
12461
  privateFields,
12212
12462
  moduleAliases,
@@ -12235,6 +12485,7 @@ defineProperties(InertCompartment, {
12235
12485
  parentCompartment,
12236
12486
  noNamespaceBox,
12237
12487
  compartmentImport,
12488
+ noAggregateLoadErrors,
12238
12489
  });
12239
12490
  }
12240
12491
 
@@ -12244,7 +12495,7 @@ defineProperties(InertCompartment, {
12244
12495
  };$h͏_once.makeCompartmentConstructor(makeCompartmentConstructor);
12245
12496
  })()
12246
12497
  ,
12247
- // === 49. ses ./src/get-anonymous-intrinsics.js ===
12498
+ // === 51. ses ./src/get-anonymous-intrinsics.js ===
12248
12499
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let FERAL_FUNCTION,Float32Array,Map,Set,String,getOwnPropertyDescriptor,getPrototypeOf,iterateArray,iterateMap,iterateSet,iterateString,matchAllRegExp,matchAllSymbol,regexpPrototype,globalThis,assign,AsyncGeneratorFunctionInstance,ArrayBuffer,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)]],["globalThis",[$h͏_a => (globalThis = $h͏_a)]],["assign",[$h͏_a => (assign = $h͏_a)]],["AsyncGeneratorFunctionInstance",[$h͏_a => (AsyncGeneratorFunctionInstance = $h͏_a)]],["ArrayBuffer",[$h͏_a => (ArrayBuffer = $h͏_a)]]]],["./compartment.js", [["InertCompartment",[$h͏_a => (InertCompartment = $h͏_a)]]]]]);
12249
12500
 
12250
12501
 
@@ -12428,7 +12679,7 @@ function makeArguments() {
12428
12679
  };$h͏_once.getAnonymousIntrinsics(getAnonymousIntrinsics);
12429
12680
  })()
12430
12681
  ,
12431
- // === 50. ses ./src/tame-harden.js ===
12682
+ // === 52. ses ./src/tame-harden.js ===
12432
12683
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let freeze;$h͏_imports([["./commons.js", [["freeze",[$h͏_a => (freeze = $h͏_a)]]]]]);
12433
12684
 
12434
12685
 
@@ -12460,7 +12711,7 @@ function makeArguments() {
12460
12711
  freeze(tameHarden);
12461
12712
  })()
12462
12713
  ,
12463
- // === 51. ses ./src/tame-symbol-constructor.js ===
12714
+ // === 53. ses ./src/tame-symbol-constructor.js ===
12464
12715
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let Symbol,entries,fromEntries,getOwnPropertyDescriptors,defineProperties,arrayMap,functionBind;$h͏_imports([["./commons.js", [["Symbol",[$h͏_a => (Symbol = $h͏_a)]],["entries",[$h͏_a => (entries = $h͏_a)]],["fromEntries",[$h͏_a => (fromEntries = $h͏_a)]],["getOwnPropertyDescriptors",[$h͏_a => (getOwnPropertyDescriptors = $h͏_a)]],["defineProperties",[$h͏_a => (defineProperties = $h͏_a)]],["arrayMap",[$h͏_a => (arrayMap = $h͏_a)]],["functionBind",[$h͏_a => (functionBind = $h͏_a)]]]]]);
12465
12716
 
12466
12717
 
@@ -12527,7 +12778,7 @@ freeze(tameHarden);
12527
12778
  };$h͏_once.tameSymbolConstructor(tameSymbolConstructor);
12528
12779
  })()
12529
12780
  ,
12530
- // === 52. ses ./src/tame-faux-data-properties.js ===
12781
+ // === 54. ses ./src/tame-faux-data-properties.js ===
12531
12782
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let getOwnPropertyDescriptor,apply,defineProperty,toStringTagSymbol;$h͏_imports([["./commons.js", [["getOwnPropertyDescriptor",[$h͏_a => (getOwnPropertyDescriptor = $h͏_a)]],["apply",[$h͏_a => (apply = $h͏_a)]],["defineProperty",[$h͏_a => (defineProperty = $h͏_a)]],["toStringTagSymbol",[$h͏_a => (toStringTagSymbol = $h͏_a)]]]]]);
12532
12783
 
12533
12784
 
@@ -12740,8 +12991,8 @@ const throws = thunk => {
12740
12991
  };$h͏_once.tameFauxDataProperties(tameFauxDataProperties);
12741
12992
  })()
12742
12993
  ,
12743
- // === 53. ses ./src/tame-regenerator-runtime.js ===
12744
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let defineProperty,iteratorPrototype,iteratorSymbol,objectHasOwnProperty;$h͏_imports([["./commons.js", [["defineProperty",[$h͏_a => (defineProperty = $h͏_a)]],["iteratorPrototype",[$h͏_a => (iteratorPrototype = $h͏_a)]],["iteratorSymbol",[$h͏_a => (iteratorSymbol = $h͏_a)]],["objectHasOwnProperty",[$h͏_a => (objectHasOwnProperty = $h͏_a)]]]]]);
12994
+ // === 55. ses ./src/tame-regenerator-runtime.js ===
12995
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let defineProperty,iteratorPrototype,iteratorSymbol,hasOwn;$h͏_imports([["./commons.js", [["defineProperty",[$h͏_a => (defineProperty = $h͏_a)]],["iteratorPrototype",[$h͏_a => (iteratorPrototype = $h͏_a)]],["iteratorSymbol",[$h͏_a => (iteratorSymbol = $h͏_a)]],["hasOwn",[$h͏_a => (hasOwn = $h͏_a)]]]]]);
12745
12996
 
12746
12997
 
12747
12998
 
@@ -12758,7 +13009,7 @@ const throws = thunk => {
12758
13009
  set(value) {
12759
13010
  // ignore the assignment on IteratorPrototype
12760
13011
  if (this === iteratorPrototype) return;
12761
- if (objectHasOwnProperty(this, iteratorSymbol)) {
13012
+ if (hasOwn(this, iteratorSymbol)) {
12762
13013
  this[iteratorSymbol] = value;
12763
13014
  }
12764
13015
  defineProperty(this, iteratorSymbol, {
@@ -12772,7 +13023,7 @@ const throws = thunk => {
12772
13023
  };$h͏_once.tameRegeneratorRuntime(tameRegeneratorRuntime);
12773
13024
  })()
12774
13025
  ,
12775
- // === 54. ses ./src/shim-arraybuffer-transfer.js ===
13026
+ // === 56. ses ./src/shim-arraybuffer-transfer.js ===
12776
13027
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let ArrayBuffer,arrayBufferPrototype,arrayBufferSlice,arrayBufferGetByteLength,Uint8Array,typedArraySet,globalThis,TypeError,defineProperty;$h͏_imports([["./commons.js", [["ArrayBuffer",[$h͏_a => (ArrayBuffer = $h͏_a)]],["arrayBufferPrototype",[$h͏_a => (arrayBufferPrototype = $h͏_a)]],["arrayBufferSlice",[$h͏_a => (arrayBufferSlice = $h͏_a)]],["arrayBufferGetByteLength",[$h͏_a => (arrayBufferGetByteLength = $h͏_a)]],["Uint8Array",[$h͏_a => (Uint8Array = $h͏_a)]],["typedArraySet",[$h͏_a => (typedArraySet = $h͏_a)]],["globalThis",[$h͏_a => (globalThis = $h͏_a)]],["TypeError",[$h͏_a => (TypeError = $h͏_a)]],["defineProperty",[$h͏_a => (defineProperty = $h͏_a)]]]]]);
12777
13028
 
12778
13029
 
@@ -12860,7 +13111,7 @@ const throws = thunk => {
12860
13111
  };$h͏_once.shimArrayBufferTransfer(shimArrayBufferTransfer);
12861
13112
  })()
12862
13113
  ,
12863
- // === 55. ses ./src/reporting.js ===
13114
+ // === 57. ses ./src/reporting.js ===
12864
13115
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let functionBind,globalThis,assert;$h͏_imports([["./commons.js", [["functionBind",[$h͏_a => (functionBind = $h͏_a)]],["globalThis",[$h͏_a => (globalThis = $h͏_a)]]]],["./error/assert.js", [["assert",[$h͏_a => (assert = $h͏_a)]]]]]);
12865
13116
 
12866
13117
 
@@ -12968,7 +13219,7 @@ const mute = () => {};
12968
13219
  };$h͏_once.reportInGroup(reportInGroup);
12969
13220
  })()
12970
13221
  ,
12971
- // === 56. ses ./src/lockdown.js ===
13222
+ // === 58. ses ./src/lockdown.js ===
12972
13223
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let getenv,FERAL_FUNCTION,FERAL_EVAL,TypeError,arrayFilter,globalThis,is,ownKeys,stringSplit,noEvalEvaluate,getOwnPropertyNames,getPrototypeOf,makeHardener,makeIntrinsicsCollector,removeUnpermittedIntrinsics,tameFunctionConstructors,tameDateConstructor,tameMathObject,tameRegExpConstructor,enablePropertyOverrides,tameLocaleMethods,setGlobalObjectConstantProperties,setGlobalObjectMutableProperties,setGlobalObjectEvaluators,makeSafeEvaluator,initialGlobalPropertyNames,tameFunctionToString,tameDomains,tameModuleSource,tameConsole,tameErrorConstructor,assert,makeAssert,getAnonymousIntrinsics,makeCompartmentConstructor,tameHarden,tameSymbolConstructor,tameFauxDataProperties,tameRegeneratorRuntime,shimArrayBufferTransfer,reportInGroup,chooseReporter;$h͏_imports([["@endo/env-options", [["getEnvironmentOption",[$h͏_a => (getenv = $h͏_a)]]]],["@endo/immutable-arraybuffer/shim.js", []],["./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)]],["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)]],["getOwnPropertyNames",[$h͏_a => (getOwnPropertyNames = $h͏_a)]],["getPrototypeOf",[$h͏_a => (getPrototypeOf = $h͏_a)]]]],["./make-hardener.js", [["makeHardener",[$h͏_a => (makeHardener = $h͏_a)]]]],["./intrinsics.js", [["makeIntrinsicsCollector",[$h͏_a => (makeIntrinsicsCollector = $h͏_a)]]]],["./permits-intrinsics.js", [["default",[$h͏_a => (removeUnpermittedIntrinsics = $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)]]]],["./permits.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)]]]],["./tame-module-source.js", [["tameModuleSource",[$h͏_a => (tameModuleSource = $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)]]]],["./get-anonymous-intrinsics.js", [["getAnonymousIntrinsics",[$h͏_a => (getAnonymousIntrinsics = $h͏_a)]]]],["./compartment.js", [["makeCompartmentConstructor",[$h͏_a => (makeCompartmentConstructor = $h͏_a)]]]],["./tame-harden.js", [["tameHarden",[$h͏_a => (tameHarden = $h͏_a)]]]],["./tame-symbol-constructor.js", [["tameSymbolConstructor",[$h͏_a => (tameSymbolConstructor = $h͏_a)]]]],["./tame-faux-data-properties.js", [["tameFauxDataProperties",[$h͏_a => (tameFauxDataProperties = $h͏_a)]]]],["./tame-regenerator-runtime.js", [["tameRegeneratorRuntime",[$h͏_a => (tameRegeneratorRuntime = $h͏_a)]]]],["./shim-arraybuffer-transfer.js", [["shimArrayBufferTransfer",[$h͏_a => (shimArrayBufferTransfer = $h͏_a)]]]],["./reporting.js", [["reportInGroup",[$h͏_a => (reportInGroup = $h͏_a)]],["chooseReporter",[$h͏_a => (chooseReporter = $h͏_a)]]]]]);
12973
13224
 
12974
13225
 
@@ -13529,7 +13780,7 @@ const probeHostEvaluators = () => {
13529
13780
  };$h͏_once.repairIntrinsics(repairIntrinsics);
13530
13781
  })()
13531
13782
  ,
13532
- // === 57. ses ./src/lockdown-shim.js ===
13783
+ // === 59. ses ./src/lockdown-shim.js ===
13533
13784
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let globalThis,repairIntrinsics;$h͏_imports([["./assert-sloppy-mode.js", []],["./commons.js", [["globalThis",[$h͏_a => (globalThis = $h͏_a)]]]],["./lockdown.js", [["repairIntrinsics",[$h͏_a => (repairIntrinsics = $h͏_a)]]]]]);
13534
13785
 
13535
13786
 
@@ -13569,7 +13820,7 @@ globalThis.repairIntrinsics = options => {
13569
13820
  };
13570
13821
  })()
13571
13822
  ,
13572
- // === 58. ses ./src/compartment-shim.js ===
13823
+ // === 60. ses ./src/compartment-shim.js ===
13573
13824
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let globalThis,makeCompartmentConstructor,tameFunctionToString,getGlobalIntrinsics,chooseReporter;$h͏_imports([["./commons.js", [["globalThis",[$h͏_a => (globalThis = $h͏_a)]]]],["./compartment.js", [["makeCompartmentConstructor",[$h͏_a => (makeCompartmentConstructor = $h͏_a)]]]],["./tame-function-tostring.js", [["tameFunctionToString",[$h͏_a => (tameFunctionToString = $h͏_a)]]]],["./intrinsics.js", [["getGlobalIntrinsics",[$h͏_a => (getGlobalIntrinsics = $h͏_a)]]]],["./reporting.js", [["chooseReporter",[$h͏_a => (chooseReporter = $h͏_a)]]]]]);
13574
13825
 
13575
13826
 
@@ -13594,14 +13845,14 @@ globalThis.Compartment = makeCompartmentConstructor(
13594
13845
  );
13595
13846
  })()
13596
13847
  ,
13597
- // === 59. ses ./src/assert-shim.js ===
13848
+ // === 61. ses ./src/assert-shim.js ===
13598
13849
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let globalThis,assert;$h͏_imports([["./commons.js", [["globalThis",[$h͏_a => (globalThis = $h͏_a)]]]],["./error/assert.js", [["assert",[$h͏_a => (assert = $h͏_a)]]]]]);
13599
13850
 
13600
13851
 
13601
13852
  globalThis.assert = assert;
13602
13853
  })()
13603
13854
  ,
13604
- // === 60. ses ./src/console-shim.js ===
13855
+ // === 62. ses ./src/console-shim.js ===
13605
13856
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let symbolFor,globalThis,defineCausalConsoleFromLogger,loggedErrorHandler;$h͏_imports([["./commons.js", [["symbolFor",[$h͏_a => (symbolFor = $h͏_a)]],["globalThis",[$h͏_a => (globalThis = $h͏_a)]]]],["./error/console.js", [["defineCausalConsoleFromLogger",[$h͏_a => (defineCausalConsoleFromLogger = $h͏_a)]]]],["./error/assert.js", [["loggedErrorHandler",[$h͏_a => (loggedErrorHandler = $h͏_a)]]]]]);
13606
13857
 
13607
13858
 
@@ -13654,7 +13905,7 @@ globalThis[MAKE_CAUSAL_CONSOLE_FROM_LOGGER_KEY_FOR_SES_AVA] =
13654
13905
  makeCausalConsoleFromLoggerForSesAva;
13655
13906
  })()
13656
13907
  ,
13657
- // === 61. ses ./index.js ===
13908
+ // === 63. ses ./index.js ===
13658
13909
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([["./src/lockdown-shim.js", []],["./src/compartment-shim.js", []],["./src/assert-shim.js", []],["./src/console-shim.js", []]]);
13659
13910
  })()
13660
13911
  ,