@metamask/snaps-execution-environments 8.2.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/dist/common/BaseSnapExecutor.cjs +79 -61
  3. package/dist/common/BaseSnapExecutor.cjs.map +1 -1
  4. package/dist/common/BaseSnapExecutor.mjs +79 -61
  5. package/dist/common/BaseSnapExecutor.mjs.map +1 -1
  6. package/dist/common/endowments/crypto.cjs +5 -15
  7. package/dist/common/endowments/crypto.cjs.map +1 -1
  8. package/dist/common/endowments/crypto.d.cts +10 -4
  9. package/dist/common/endowments/crypto.d.cts.map +1 -1
  10. package/dist/common/endowments/crypto.d.mts +10 -4
  11. package/dist/common/endowments/crypto.d.mts.map +1 -1
  12. package/dist/common/endowments/crypto.mjs +5 -17
  13. package/dist/common/endowments/crypto.mjs.map +1 -1
  14. package/dist/common/endowments/network.cjs +39 -52
  15. package/dist/common/endowments/network.cjs.map +1 -1
  16. package/dist/common/endowments/network.mjs +39 -52
  17. package/dist/common/endowments/network.mjs.map +1 -1
  18. package/dist/proxy/ProxySnapExecutor.cjs +72 -69
  19. package/dist/proxy/ProxySnapExecutor.cjs.map +1 -1
  20. package/dist/proxy/ProxySnapExecutor.mjs +71 -68
  21. package/dist/proxy/ProxySnapExecutor.mjs.map +1 -1
  22. package/dist/webpack/iframe/bundle.js +1 -1
  23. package/dist/webpack/iframe/index.html +854 -406
  24. package/dist/webpack/node-process/bundle.js +1 -1
  25. package/dist/webpack/node-thread/bundle.js +1 -1
  26. package/dist/webpack/webview/index.html +855 -407
  27. package/dist/webview/WebViewExecutorStream.cjs +9 -22
  28. package/dist/webview/WebViewExecutorStream.cjs.map +1 -1
  29. package/dist/webview/WebViewExecutorStream.mjs +9 -22
  30. package/dist/webview/WebViewExecutorStream.mjs.map +1 -1
  31. package/package.json +7 -7
@@ -1,4 +1,4 @@
1
- <!doctype html><html><head><meta charset="utf-8"/><title>MetaMask Snaps Execution Environment</title><script>// ses@1.12.0
1
+ <!doctype html><html><head><meta charset="utf-8"/><title>MetaMask Snaps Execution Environment</title><script>// ses@1.13.0
2
2
  (functors => options => {
3
3
  'use strict';
4
4
 
@@ -206,6 +206,13 @@
206
206
  },
207
207
  {
208
208
  },
209
+ {
210
+ transferBufferToImmutable: cell("transferBufferToImmutable"),
211
+ isBufferImmutable: cell("isBufferImmutable"),
212
+ sliceBufferToImmutable: cell("sliceBufferToImmutable"),
213
+ },
214
+ {
215
+ },
209
216
  {
210
217
  an: cell("an"),
211
218
  bestEffortStringify: cell("bestEffortStringify"),
@@ -651,20 +658,20 @@ function observeImports(map, importName, importIndex) {
651
658
  functors[4]({
652
659
  imports(entries) {
653
660
  const map = new Map(entries);
654
- observeImports(map, "../commons.js", 0);
655
661
  },
656
662
  liveVar: {
657
663
  },
658
664
  onceVar: {
659
- an: cells[4].an.set,
660
- bestEffortStringify: cells[4].bestEffortStringify.set,
661
- enJoin: cells[4].enJoin.set,
665
+ transferBufferToImmutable: cells[4].transferBufferToImmutable.set,
666
+ isBufferImmutable: cells[4].isBufferImmutable.set,
667
+ sliceBufferToImmutable: cells[4].sliceBufferToImmutable.set,
662
668
  },
663
669
  importMeta: {},
664
670
  });
665
671
  functors[5]({
666
672
  imports(entries) {
667
673
  const map = new Map(entries);
674
+ observeImports(map, "./index.js", 4);
668
675
  },
669
676
  liveVar: {
670
677
  },
@@ -675,10 +682,14 @@ function observeImports(map, importName, importIndex) {
675
682
  functors[6]({
676
683
  imports(entries) {
677
684
  const map = new Map(entries);
685
+ observeImports(map, "../commons.js", 0);
678
686
  },
679
687
  liveVar: {
680
688
  },
681
689
  onceVar: {
690
+ an: cells[6].an.set,
691
+ bestEffortStringify: cells[6].bestEffortStringify.set,
692
+ enJoin: cells[6].enJoin.set,
682
693
  },
683
694
  importMeta: {},
684
695
  });
@@ -689,71 +700,65 @@ function observeImports(map, importName, importIndex) {
689
700
  liveVar: {
690
701
  },
691
702
  onceVar: {
692
- makeLRUCacheMap: cells[7].makeLRUCacheMap.set,
693
703
  },
694
704
  importMeta: {},
695
705
  });
696
706
  functors[8]({
697
707
  imports(entries) {
698
708
  const map = new Map(entries);
699
- observeImports(map, "../make-lru-cachemap.js", 7);
700
709
  },
701
710
  liveVar: {
702
711
  },
703
712
  onceVar: {
704
- makeNoteLogArgsArrayKit: cells[8].makeNoteLogArgsArrayKit.set,
705
713
  },
706
714
  importMeta: {},
707
715
  });
708
716
  functors[9]({
709
717
  imports(entries) {
710
718
  const map = new Map(entries);
711
- observeImports(map, "../commons.js", 0);
712
- observeImports(map, "./stringify-utils.js", 4);
713
- observeImports(map, "./types.js", 5);
714
- observeImports(map, "./internal-types.js", 6);
715
- observeImports(map, "./note-log-args.js", 8);
716
719
  },
717
720
  liveVar: {
718
721
  },
719
722
  onceVar: {
720
- quote: cells[9].q.set,
721
- bare: cells[9].b.set,
722
- redactedDetails: cells[9].X.set,
723
- unredactedDetails: cells[9].unredactedDetails.set,
724
- makeError: cells[9].makeError.set,
725
- note: cells[9].annotateError.set,
726
- loggedErrorHandler: cells[9].loggedErrorHandler.set,
727
- makeAssert: cells[9].makeAssert.set,
728
- assert: cells[9].assert.set,
729
- assertEqual: cells[9].assertEqual.set,
730
- sanitizeError: cells[9].sanitizeError.set,
723
+ makeLRUCacheMap: cells[9].makeLRUCacheMap.set,
731
724
  },
732
725
  importMeta: {},
733
726
  });
734
727
  functors[10]({
735
728
  imports(entries) {
736
729
  const map = new Map(entries);
737
- observeImports(map, "./commons.js", 0);
738
- observeImports(map, "./error/assert.js", 9);
730
+ observeImports(map, "../make-lru-cachemap.js", 9);
739
731
  },
740
732
  liveVar: {
741
733
  },
742
734
  onceVar: {
743
- isTypedArray: cells[10].isTypedArray.set,
744
- makeHardener: cells[10].makeHardener.set,
735
+ makeNoteLogArgsArrayKit: cells[10].makeNoteLogArgsArrayKit.set,
745
736
  },
746
737
  importMeta: {},
747
738
  });
748
739
  functors[11]({
749
740
  imports(entries) {
750
741
  const map = new Map(entries);
751
- observeImports(map, "./commons.js", 0);
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);
752
747
  },
753
748
  liveVar: {
754
749
  },
755
750
  onceVar: {
756
- cauterizeProperty: cells[11].cauterizeProperty.set,
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,
757
762
  },
758
763
  importMeta: {},
759
764
  });
@@ -761,68 +766,70 @@ function observeImports(map, importName, importIndex) {
761
766
  imports(entries) {
762
767
  const map = new Map(entries);
763
768
  observeImports(map, "./commons.js", 0);
769
+ observeImports(map, "./error/assert.js", 11);
764
770
  },
765
771
  liveVar: {
766
772
  },
767
773
  onceVar: {
768
- NativeErrors: cells[12].NativeErrors.set,
769
- constantProperties: cells[12].constantProperties.set,
770
- universalPropertyNames: cells[12].universalPropertyNames.set,
771
- initialGlobalPropertyNames: cells[12].initialGlobalPropertyNames.set,
772
- sharedGlobalPropertyNames: cells[12].sharedGlobalPropertyNames.set,
773
- uniqueGlobalPropertyNames: cells[12].uniqueGlobalPropertyNames.set,
774
- FunctionInstance: cells[12].FunctionInstance.set,
775
- AsyncFunctionInstance: cells[12].AsyncFunctionInstance.set,
776
- isAccessorPermit: cells[12].isAccessorPermit.set,
777
- permitted: cells[12].permitted.set,
774
+ isTypedArray: cells[12].isTypedArray.set,
775
+ makeHardener: cells[12].makeHardener.set,
778
776
  },
779
777
  importMeta: {},
780
778
  });
781
779
  functors[13]({
782
780
  imports(entries) {
783
781
  const map = new Map(entries);
784
- observeImports(map, "./cauterize-property.js", 11);
785
782
  observeImports(map, "./commons.js", 0);
786
- observeImports(map, "./permits.js", 12);
787
783
  },
788
784
  liveVar: {
789
785
  },
790
786
  onceVar: {
791
- makeIntrinsicsCollector: cells[13].makeIntrinsicsCollector.set,
792
- getGlobalIntrinsics: cells[13].getGlobalIntrinsics.set,
787
+ cauterizeProperty: cells[13].cauterizeProperty.set,
793
788
  },
794
789
  importMeta: {},
795
790
  });
796
791
  functors[14]({
797
792
  imports(entries) {
798
793
  const map = new Map(entries);
799
- observeImports(map, "./permits.js", 12);
800
794
  observeImports(map, "./commons.js", 0);
801
- observeImports(map, "./cauterize-property.js", 11);
802
795
  },
803
796
  liveVar: {
804
797
  },
805
798
  onceVar: {
806
- default: cells[14].default.set,
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,
807
809
  },
808
810
  importMeta: {},
809
811
  });
810
812
  functors[15]({
811
813
  imports(entries) {
812
814
  const map = new Map(entries);
815
+ observeImports(map, "./cauterize-property.js", 13);
813
816
  observeImports(map, "./commons.js", 0);
817
+ observeImports(map, "./permits.js", 14);
814
818
  },
815
819
  liveVar: {
816
820
  },
817
821
  onceVar: {
818
- default: cells[15].default.set,
822
+ makeIntrinsicsCollector: cells[15].makeIntrinsicsCollector.set,
823
+ getGlobalIntrinsics: cells[15].getGlobalIntrinsics.set,
819
824
  },
820
825
  importMeta: {},
821
826
  });
822
827
  functors[16]({
823
828
  imports(entries) {
824
829
  const map = new Map(entries);
830
+ observeImports(map, "./permits.js", 14);
825
831
  observeImports(map, "./commons.js", 0);
832
+ observeImports(map, "./cauterize-property.js", 13);
826
833
  },
827
834
  liveVar: {
828
835
  },
@@ -863,9 +870,7 @@ function observeImports(map, importName, importIndex) {
863
870
  liveVar: {
864
871
  },
865
872
  onceVar: {
866
- minEnablements: cells[19].minEnablements.set,
867
- moderateEnablements: cells[19].moderateEnablements.set,
868
- severeEnablements: cells[19].severeEnablements.set,
873
+ default: cells[19].default.set,
869
874
  },
870
875
  importMeta: {},
871
876
  });
@@ -873,7 +878,6 @@ function observeImports(map, importName, importIndex) {
873
878
  imports(entries) {
874
879
  const map = new Map(entries);
875
880
  observeImports(map, "./commons.js", 0);
876
- observeImports(map, "./enablements.js", 19);
877
881
  },
878
882
  liveVar: {
879
883
  },
@@ -886,23 +890,26 @@ function observeImports(map, importName, importIndex) {
886
890
  imports(entries) {
887
891
  const map = new Map(entries);
888
892
  observeImports(map, "./commons.js", 0);
889
- observeImports(map, "./error/assert.js", 9);
890
893
  },
891
894
  liveVar: {
892
895
  },
893
896
  onceVar: {
894
- default: cells[21].default.set,
897
+ minEnablements: cells[21].minEnablements.set,
898
+ moderateEnablements: cells[21].moderateEnablements.set,
899
+ severeEnablements: cells[21].severeEnablements.set,
895
900
  },
896
901
  importMeta: {},
897
902
  });
898
903
  functors[22]({
899
904
  imports(entries) {
900
905
  const map = new Map(entries);
906
+ observeImports(map, "./commons.js", 0);
907
+ observeImports(map, "./enablements.js", 21);
901
908
  },
902
909
  liveVar: {
903
910
  },
904
911
  onceVar: {
905
- makeEvalFunction: cells[22].makeEvalFunction.set,
912
+ default: cells[22].default.set,
906
913
  },
907
914
  importMeta: {},
908
915
  });
@@ -910,30 +917,23 @@ function observeImports(map, importName, importIndex) {
910
917
  imports(entries) {
911
918
  const map = new Map(entries);
912
919
  observeImports(map, "./commons.js", 0);
913
- observeImports(map, "./error/assert.js", 9);
920
+ observeImports(map, "./error/assert.js", 11);
914
921
  },
915
922
  liveVar: {
916
923
  },
917
924
  onceVar: {
918
- makeFunctionConstructor: cells[23].makeFunctionConstructor.set,
925
+ default: cells[23].default.set,
919
926
  },
920
927
  importMeta: {},
921
928
  });
922
929
  functors[24]({
923
930
  imports(entries) {
924
931
  const map = new Map(entries);
925
- observeImports(map, "./commons.js", 0);
926
- observeImports(map, "./make-eval-function.js", 22);
927
- observeImports(map, "./make-function-constructor.js", 23);
928
- observeImports(map, "./permits.js", 12);
929
932
  },
930
933
  liveVar: {
931
934
  },
932
935
  onceVar: {
933
- setGlobalObjectSymbolUnscopables: cells[24].setGlobalObjectSymbolUnscopables.set,
934
- setGlobalObjectConstantProperties: cells[24].setGlobalObjectConstantProperties.set,
935
- setGlobalObjectMutableProperties: cells[24].setGlobalObjectMutableProperties.set,
936
- setGlobalObjectEvaluators: cells[24].setGlobalObjectEvaluators.set,
936
+ makeEvalFunction: cells[24].makeEvalFunction.set,
937
937
  },
938
938
  importMeta: {},
939
939
  });
@@ -941,14 +941,12 @@ function observeImports(map, importName, importIndex) {
941
941
  imports(entries) {
942
942
  const map = new Map(entries);
943
943
  observeImports(map, "./commons.js", 0);
944
- observeImports(map, "./error/assert.js", 9);
944
+ observeImports(map, "./error/assert.js", 11);
945
945
  },
946
946
  liveVar: {
947
947
  },
948
948
  onceVar: {
949
- alwaysThrowHandler: cells[25].alwaysThrowHandler.set,
950
- strictScopeTerminatorHandler: cells[25].strictScopeTerminatorHandler.set,
951
- strictScopeTerminator: cells[25].strictScopeTerminator.set,
949
+ makeFunctionConstructor: cells[25].makeFunctionConstructor.set,
952
950
  },
953
951
  importMeta: {},
954
952
  });
@@ -956,12 +954,17 @@ function observeImports(map, importName, importIndex) {
956
954
  imports(entries) {
957
955
  const map = new Map(entries);
958
956
  observeImports(map, "./commons.js", 0);
959
- observeImports(map, "./strict-scope-terminator.js", 25);
957
+ observeImports(map, "./make-eval-function.js", 24);
958
+ observeImports(map, "./make-function-constructor.js", 25);
959
+ observeImports(map, "./permits.js", 14);
960
960
  },
961
961
  liveVar: {
962
962
  },
963
963
  onceVar: {
964
- createSloppyGlobalsScopeTerminator: cells[26].createSloppyGlobalsScopeTerminator.set,
964
+ setGlobalObjectSymbolUnscopables: cells[26].setGlobalObjectSymbolUnscopables.set,
965
+ setGlobalObjectConstantProperties: cells[26].setGlobalObjectConstantProperties.set,
966
+ setGlobalObjectMutableProperties: cells[26].setGlobalObjectMutableProperties.set,
967
+ setGlobalObjectEvaluators: cells[26].setGlobalObjectEvaluators.set,
965
968
  },
966
969
  importMeta: {},
967
970
  });
@@ -969,12 +972,14 @@ function observeImports(map, importName, importIndex) {
969
972
  imports(entries) {
970
973
  const map = new Map(entries);
971
974
  observeImports(map, "./commons.js", 0);
972
- observeImports(map, "./error/assert.js", 9);
975
+ observeImports(map, "./error/assert.js", 11);
973
976
  },
974
977
  liveVar: {
975
978
  },
976
979
  onceVar: {
977
- makeEvalScopeKit: cells[27].makeEvalScopeKit.set,
980
+ alwaysThrowHandler: cells[27].alwaysThrowHandler.set,
981
+ strictScopeTerminatorHandler: cells[27].strictScopeTerminatorHandler.set,
982
+ strictScopeTerminator: cells[27].strictScopeTerminator.set,
978
983
  },
979
984
  importMeta: {},
980
985
  });
@@ -982,11 +987,12 @@ function observeImports(map, importName, importIndex) {
982
987
  imports(entries) {
983
988
  const map = new Map(entries);
984
989
  observeImports(map, "./commons.js", 0);
990
+ observeImports(map, "./strict-scope-terminator.js", 27);
985
991
  },
986
992
  liveVar: {
987
993
  },
988
994
  onceVar: {
989
- getSourceURL: cells[28].getSourceURL.set,
995
+ createSloppyGlobalsScopeTerminator: cells[28].createSloppyGlobalsScopeTerminator.set,
990
996
  },
991
997
  importMeta: {},
992
998
  });
@@ -994,19 +1000,12 @@ function observeImports(map, importName, importIndex) {
994
1000
  imports(entries) {
995
1001
  const map = new Map(entries);
996
1002
  observeImports(map, "./commons.js", 0);
997
- observeImports(map, "./get-source-url.js", 28);
1003
+ observeImports(map, "./error/assert.js", 11);
998
1004
  },
999
1005
  liveVar: {
1000
1006
  },
1001
1007
  onceVar: {
1002
- rejectHtmlComments: cells[29].rejectHtmlComments.set,
1003
- evadeHtmlCommentTest: cells[29].evadeHtmlCommentTest.set,
1004
- rejectImportExpressions: cells[29].rejectImportExpressions.set,
1005
- evadeImportExpressionTest: cells[29].evadeImportExpressionTest.set,
1006
- rejectSomeDirectEvalExpressions: cells[29].rejectSomeDirectEvalExpressions.set,
1007
- mandatoryTransforms: cells[29].mandatoryTransforms.set,
1008
- applyTransforms: cells[29].applyTransforms.set,
1009
- transforms: cells[29].transforms.set,
1008
+ makeEvalScopeKit: cells[29].makeEvalScopeKit.set,
1010
1009
  },
1011
1010
  importMeta: {},
1012
1011
  });
@@ -1018,8 +1017,7 @@ function observeImports(map, importName, importIndex) {
1018
1017
  liveVar: {
1019
1018
  },
1020
1019
  onceVar: {
1021
- isValidIdentifierName: cells[30].isValidIdentifierName.set,
1022
- getScopeConstants: cells[30].getScopeConstants.set,
1020
+ getSourceURL: cells[30].getSourceURL.set,
1023
1021
  },
1024
1022
  importMeta: {},
1025
1023
  });
@@ -1027,12 +1025,19 @@ function observeImports(map, importName, importIndex) {
1027
1025
  imports(entries) {
1028
1026
  const map = new Map(entries);
1029
1027
  observeImports(map, "./commons.js", 0);
1030
- observeImports(map, "./scope-constants.js", 30);
1028
+ observeImports(map, "./get-source-url.js", 30);
1031
1029
  },
1032
1030
  liveVar: {
1033
1031
  },
1034
1032
  onceVar: {
1035
- makeEvaluate: cells[31].makeEvaluate.set,
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,
1036
1041
  },
1037
1042
  importMeta: {},
1038
1043
  });
@@ -1040,17 +1045,12 @@ function observeImports(map, importName, importIndex) {
1040
1045
  imports(entries) {
1041
1046
  const map = new Map(entries);
1042
1047
  observeImports(map, "./commons.js", 0);
1043
- observeImports(map, "./strict-scope-terminator.js", 25);
1044
- observeImports(map, "./sloppy-globals-scope-terminator.js", 26);
1045
- observeImports(map, "./eval-scope.js", 27);
1046
- observeImports(map, "./transforms.js", 29);
1047
- observeImports(map, "./make-evaluate.js", 31);
1048
- observeImports(map, "./error/assert.js", 9);
1049
1048
  },
1050
1049
  liveVar: {
1051
1050
  },
1052
1051
  onceVar: {
1053
- makeSafeEvaluator: cells[32].makeSafeEvaluator.set,
1052
+ isValidIdentifierName: cells[32].isValidIdentifierName.set,
1053
+ getScopeConstants: cells[32].getScopeConstants.set,
1054
1054
  },
1055
1055
  importMeta: {},
1056
1056
  });
@@ -1058,11 +1058,12 @@ function observeImports(map, importName, importIndex) {
1058
1058
  imports(entries) {
1059
1059
  const map = new Map(entries);
1060
1060
  observeImports(map, "./commons.js", 0);
1061
+ observeImports(map, "./scope-constants.js", 32);
1061
1062
  },
1062
1063
  liveVar: {
1063
1064
  },
1064
1065
  onceVar: {
1065
- tameFunctionToString: cells[33].tameFunctionToString.set,
1066
+ makeEvaluate: cells[33].makeEvaluate.set,
1066
1067
  },
1067
1068
  importMeta: {},
1068
1069
  });
@@ -1070,11 +1071,17 @@ function observeImports(map, importName, importIndex) {
1070
1071
  imports(entries) {
1071
1072
  const map = new Map(entries);
1072
1073
  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);
1073
1080
  },
1074
1081
  liveVar: {
1075
1082
  },
1076
1083
  onceVar: {
1077
- tameDomains: cells[34].tameDomains.set,
1084
+ makeSafeEvaluator: cells[34].makeSafeEvaluator.set,
1078
1085
  },
1079
1086
  importMeta: {},
1080
1087
  });
@@ -1086,37 +1093,31 @@ function observeImports(map, importName, importIndex) {
1086
1093
  liveVar: {
1087
1094
  },
1088
1095
  onceVar: {
1089
- tameModuleSource: cells[35].tameModuleSource.set,
1096
+ tameFunctionToString: cells[35].tameFunctionToString.set,
1090
1097
  },
1091
1098
  importMeta: {},
1092
1099
  });
1093
1100
  functors[36]({
1094
1101
  imports(entries) {
1095
1102
  const map = new Map(entries);
1096
- observeImports(map, "../commons.js", 0);
1103
+ observeImports(map, "./commons.js", 0);
1097
1104
  },
1098
1105
  liveVar: {
1099
1106
  },
1100
1107
  onceVar: {
1101
- consoleLevelMethods: cells[36].consoleLevelMethods.set,
1102
- consoleOtherMethods: cells[36].consoleOtherMethods.set,
1103
- makeLoggingConsoleKit: cells[36].makeLoggingConsoleKit.set,
1104
- pumpLogToConsole: cells[36].pumpLogToConsole.set,
1105
- makeCausalConsole: cells[36].makeCausalConsole.set,
1106
- defineCausalConsoleFromLogger: cells[36].defineCausalConsoleFromLogger.set,
1107
- filterConsole: cells[36].filterConsole.set,
1108
+ tameDomains: cells[36].tameDomains.set,
1108
1109
  },
1109
1110
  importMeta: {},
1110
1111
  });
1111
1112
  functors[37]({
1112
1113
  imports(entries) {
1113
1114
  const map = new Map(entries);
1114
- observeImports(map, "../commons.js", 0);
1115
+ observeImports(map, "./commons.js", 0);
1115
1116
  },
1116
1117
  liveVar: {
1117
1118
  },
1118
1119
  onceVar: {
1119
- makeRejectionHandlers: cells[37].makeRejectionHandlers.set,
1120
+ tameModuleSource: cells[37].tameModuleSource.set,
1120
1121
  },
1121
1122
  importMeta: {},
1122
1123
  });
@@ -1124,14 +1125,17 @@ function observeImports(map, importName, importIndex) {
1124
1125
  imports(entries) {
1125
1126
  const map = new Map(entries);
1126
1127
  observeImports(map, "../commons.js", 0);
1127
- observeImports(map, "./assert.js", 9);
1128
- observeImports(map, "./console.js", 36);
1129
- observeImports(map, "./unhandled-rejection.js", 37);
1130
1128
  },
1131
1129
  liveVar: {
1132
1130
  },
1133
1131
  onceVar: {
1134
- tameConsole: cells[38].tameConsole.set,
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,
1135
1139
  },
1136
1140
  importMeta: {},
1137
1141
  });
@@ -1143,9 +1147,7 @@ function observeImports(map, importName, importIndex) {
1143
1147
  liveVar: {
1144
1148
  },
1145
1149
  onceVar: {
1146
- filterFileName: cells[39].filterFileName.set,
1147
- shortenCallSiteString: cells[39].shortenCallSiteString.set,
1148
- tameV8ErrorConstructor: cells[39].tameV8ErrorConstructor.set,
1150
+ makeRejectionHandlers: cells[39].makeRejectionHandlers.set,
1149
1151
  },
1150
1152
  importMeta: {},
1151
1153
  });
@@ -1153,126 +1155,119 @@ function observeImports(map, importName, importIndex) {
1153
1155
  imports(entries) {
1154
1156
  const map = new Map(entries);
1155
1157
  observeImports(map, "../commons.js", 0);
1156
- observeImports(map, "../permits.js", 12);
1157
- observeImports(map, "./tame-v8-error-constructor.js", 39);
1158
+ observeImports(map, "./assert.js", 11);
1159
+ observeImports(map, "./console.js", 38);
1160
+ observeImports(map, "./unhandled-rejection.js", 39);
1158
1161
  },
1159
1162
  liveVar: {
1160
1163
  },
1161
1164
  onceVar: {
1162
- default: cells[40].default.set,
1165
+ tameConsole: cells[40].tameConsole.set,
1163
1166
  },
1164
1167
  importMeta: {},
1165
1168
  });
1166
1169
  functors[41]({
1167
1170
  imports(entries) {
1168
1171
  const map = new Map(entries);
1169
- observeImports(map, "@endo/env-options", 3);
1170
- observeImports(map, "./commons.js", 0);
1171
- observeImports(map, "./error/assert.js", 9);
1172
+ observeImports(map, "../commons.js", 0);
1172
1173
  },
1173
1174
  liveVar: {
1174
1175
  },
1175
1176
  onceVar: {
1176
- makeAlias: cells[41].makeAlias.set,
1177
- load: cells[41].load.set,
1178
- loadNow: cells[41].loadNow.set,
1177
+ filterFileName: cells[41].filterFileName.set,
1178
+ shortenCallSiteString: cells[41].shortenCallSiteString.set,
1179
+ tameV8ErrorConstructor: cells[41].tameV8ErrorConstructor.set,
1179
1180
  },
1180
1181
  importMeta: {},
1181
1182
  });
1182
1183
  functors[42]({
1183
1184
  imports(entries) {
1184
1185
  const map = new Map(entries);
1185
- observeImports(map, "./module-load.js", 41);
1186
- observeImports(map, "./commons.js", 0);
1187
- observeImports(map, "./error/assert.js", 9);
1186
+ observeImports(map, "../commons.js", 0);
1187
+ observeImports(map, "../permits.js", 14);
1188
+ observeImports(map, "./tame-v8-error-constructor.js", 41);
1188
1189
  },
1189
1190
  liveVar: {
1190
1191
  },
1191
1192
  onceVar: {
1192
- deferExports: cells[42].deferExports.set,
1193
- getDeferredExports: cells[42].getDeferredExports.set,
1193
+ default: cells[42].default.set,
1194
1194
  },
1195
1195
  importMeta: {},
1196
1196
  });
1197
1197
  functors[43]({
1198
1198
  imports(entries) {
1199
1199
  const map = new Map(entries);
1200
+ observeImports(map, "@endo/env-options", 3);
1200
1201
  observeImports(map, "./commons.js", 0);
1201
- observeImports(map, "./transforms.js", 29);
1202
- observeImports(map, "./make-safe-evaluator.js", 32);
1202
+ observeImports(map, "./error/assert.js", 11);
1203
1203
  },
1204
1204
  liveVar: {
1205
1205
  },
1206
1206
  onceVar: {
1207
- provideCompartmentEvaluator: cells[43].provideCompartmentEvaluator.set,
1208
- compartmentEvaluate: cells[43].compartmentEvaluate.set,
1207
+ makeAlias: cells[43].makeAlias.set,
1208
+ load: cells[43].load.set,
1209
+ loadNow: cells[43].loadNow.set,
1209
1210
  },
1210
1211
  importMeta: {},
1211
1212
  });
1212
1213
  functors[44]({
1213
1214
  imports(entries) {
1214
1215
  const map = new Map(entries);
1215
- observeImports(map, "./error/assert.js", 9);
1216
- observeImports(map, "./module-proxy.js", 42);
1216
+ observeImports(map, "./module-load.js", 43);
1217
1217
  observeImports(map, "./commons.js", 0);
1218
- observeImports(map, "./compartment-evaluate.js", 43);
1218
+ observeImports(map, "./error/assert.js", 11);
1219
1219
  },
1220
1220
  liveVar: {
1221
1221
  },
1222
1222
  onceVar: {
1223
- makeVirtualModuleInstance: cells[44].makeVirtualModuleInstance.set,
1224
- makeModuleInstance: cells[44].makeModuleInstance.set,
1223
+ deferExports: cells[44].deferExports.set,
1224
+ getDeferredExports: cells[44].getDeferredExports.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, "./error/assert.js", 9);
1232
- observeImports(map, "./module-instance.js", 44);
1233
1231
  observeImports(map, "./commons.js", 0);
1232
+ observeImports(map, "./transforms.js", 31);
1233
+ observeImports(map, "./make-safe-evaluator.js", 34);
1234
1234
  },
1235
1235
  liveVar: {
1236
1236
  },
1237
1237
  onceVar: {
1238
- link: cells[45].link.set,
1239
- instantiate: cells[45].instantiate.set,
1238
+ provideCompartmentEvaluator: cells[45].provideCompartmentEvaluator.set,
1239
+ compartmentEvaluate: cells[45].compartmentEvaluate.set,
1240
1240
  },
1241
1241
  importMeta: {},
1242
1242
  });
1243
1243
  functors[46]({
1244
1244
  imports(entries) {
1245
1245
  const map = new Map(entries);
1246
+ observeImports(map, "./error/assert.js", 11);
1247
+ observeImports(map, "./module-proxy.js", 44);
1246
1248
  observeImports(map, "./commons.js", 0);
1247
- observeImports(map, "./global-object.js", 24);
1248
- observeImports(map, "./error/assert.js", 9);
1249
- observeImports(map, "./permits.js", 12);
1250
- observeImports(map, "./module-load.js", 41);
1251
- observeImports(map, "./module-link.js", 45);
1252
- observeImports(map, "./module-proxy.js", 42);
1253
- observeImports(map, "./compartment-evaluate.js", 43);
1254
- observeImports(map, "./make-safe-evaluator.js", 32);
1249
+ observeImports(map, "./compartment-evaluate.js", 45);
1255
1250
  },
1256
1251
  liveVar: {
1257
1252
  },
1258
1253
  onceVar: {
1259
- InertCompartment: cells[46].InertCompartment.set,
1260
- CompartmentPrototype: cells[46].CompartmentPrototype.set,
1261
- compartmentOptions: cells[46].compartmentOptions.set,
1262
- makeCompartmentConstructor: cells[46].makeCompartmentConstructor.set,
1254
+ makeVirtualModuleInstance: cells[46].makeVirtualModuleInstance.set,
1255
+ makeModuleInstance: cells[46].makeModuleInstance.set,
1263
1256
  },
1264
1257
  importMeta: {},
1265
1258
  });
1266
1259
  functors[47]({
1267
1260
  imports(entries) {
1268
1261
  const map = new Map(entries);
1262
+ observeImports(map, "./error/assert.js", 11);
1263
+ observeImports(map, "./module-instance.js", 46);
1269
1264
  observeImports(map, "./commons.js", 0);
1270
- observeImports(map, "./compartment.js", 46);
1271
1265
  },
1272
1266
  liveVar: {
1273
1267
  },
1274
1268
  onceVar: {
1275
- getAnonymousIntrinsics: cells[47].getAnonymousIntrinsics.set,
1269
+ link: cells[47].link.set,
1270
+ instantiate: cells[47].instantiate.set,
1276
1271
  },
1277
1272
  importMeta: {},
1278
1273
  });
@@ -1280,11 +1275,22 @@ function observeImports(map, importName, importIndex) {
1280
1275
  imports(entries) {
1281
1276
  const map = new Map(entries);
1282
1277
  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);
1283
1286
  },
1284
1287
  liveVar: {
1285
1288
  },
1286
1289
  onceVar: {
1287
- tameHarden: cells[48].tameHarden.set,
1290
+ InertCompartment: cells[48].InertCompartment.set,
1291
+ CompartmentPrototype: cells[48].CompartmentPrototype.set,
1292
+ compartmentOptions: cells[48].compartmentOptions.set,
1293
+ makeCompartmentConstructor: cells[48].makeCompartmentConstructor.set,
1288
1294
  },
1289
1295
  importMeta: {},
1290
1296
  });
@@ -1292,11 +1298,12 @@ function observeImports(map, importName, importIndex) {
1292
1298
  imports(entries) {
1293
1299
  const map = new Map(entries);
1294
1300
  observeImports(map, "./commons.js", 0);
1301
+ observeImports(map, "./compartment.js", 48);
1295
1302
  },
1296
1303
  liveVar: {
1297
1304
  },
1298
1305
  onceVar: {
1299
- tameSymbolConstructor: cells[49].tameSymbolConstructor.set,
1306
+ getAnonymousIntrinsics: cells[49].getAnonymousIntrinsics.set,
1300
1307
  },
1301
1308
  importMeta: {},
1302
1309
  });
@@ -1308,8 +1315,7 @@ function observeImports(map, importName, importIndex) {
1308
1315
  liveVar: {
1309
1316
  },
1310
1317
  onceVar: {
1311
- tameFauxDataProperty: cells[50].tameFauxDataProperty.set,
1312
- tameFauxDataProperties: cells[50].tameFauxDataProperties.set,
1318
+ tameHarden: cells[50].tameHarden.set,
1313
1319
  },
1314
1320
  importMeta: {},
1315
1321
  });
@@ -1321,7 +1327,7 @@ function observeImports(map, importName, importIndex) {
1321
1327
  liveVar: {
1322
1328
  },
1323
1329
  onceVar: {
1324
- tameRegeneratorRuntime: cells[51].tameRegeneratorRuntime.set,
1330
+ tameSymbolConstructor: cells[51].tameSymbolConstructor.set,
1325
1331
  },
1326
1332
  importMeta: {},
1327
1333
  });
@@ -1333,7 +1339,8 @@ function observeImports(map, importName, importIndex) {
1333
1339
  liveVar: {
1334
1340
  },
1335
1341
  onceVar: {
1336
- shimArrayBufferTransfer: cells[52].shimArrayBufferTransfer.set,
1342
+ tameFauxDataProperty: cells[52].tameFauxDataProperty.set,
1343
+ tameFauxDataProperties: cells[52].tameFauxDataProperties.set,
1337
1344
  },
1338
1345
  importMeta: {},
1339
1346
  });
@@ -1341,88 +1348,86 @@ function observeImports(map, importName, importIndex) {
1341
1348
  imports(entries) {
1342
1349
  const map = new Map(entries);
1343
1350
  observeImports(map, "./commons.js", 0);
1344
- observeImports(map, "./error/assert.js", 9);
1345
1351
  },
1346
1352
  liveVar: {
1347
1353
  },
1348
1354
  onceVar: {
1349
- chooseReporter: cells[53].chooseReporter.set,
1350
- reportInGroup: cells[53].reportInGroup.set,
1355
+ tameRegeneratorRuntime: cells[53].tameRegeneratorRuntime.set,
1351
1356
  },
1352
1357
  importMeta: {},
1353
1358
  });
1354
1359
  functors[54]({
1355
1360
  imports(entries) {
1356
1361
  const map = new Map(entries);
1357
- observeImports(map, "@endo/env-options", 3);
1358
1362
  observeImports(map, "./commons.js", 0);
1359
- observeImports(map, "./make-hardener.js", 10);
1360
- observeImports(map, "./intrinsics.js", 13);
1361
- observeImports(map, "./permits-intrinsics.js", 14);
1362
- observeImports(map, "./tame-function-constructors.js", 15);
1363
- observeImports(map, "./tame-date-constructor.js", 16);
1364
- observeImports(map, "./tame-math-object.js", 17);
1365
- observeImports(map, "./tame-regexp-constructor.js", 18);
1366
- observeImports(map, "./enable-property-overrides.js", 20);
1367
- observeImports(map, "./tame-locale-methods.js", 21);
1368
- observeImports(map, "./global-object.js", 24);
1369
- observeImports(map, "./make-safe-evaluator.js", 32);
1370
- observeImports(map, "./permits.js", 12);
1371
- observeImports(map, "./tame-function-tostring.js", 33);
1372
- observeImports(map, "./tame-domains.js", 34);
1373
- observeImports(map, "./tame-module-source.js", 35);
1374
- observeImports(map, "./error/tame-console.js", 38);
1375
- observeImports(map, "./error/tame-error-constructor.js", 40);
1376
- observeImports(map, "./error/assert.js", 9);
1377
- observeImports(map, "./get-anonymous-intrinsics.js", 47);
1378
- observeImports(map, "./compartment.js", 46);
1379
- observeImports(map, "./tame-harden.js", 48);
1380
- observeImports(map, "./tame-symbol-constructor.js", 49);
1381
- observeImports(map, "./tame-faux-data-properties.js", 50);
1382
- observeImports(map, "./tame-regenerator-runtime.js", 51);
1383
- observeImports(map, "./shim-arraybuffer-transfer.js", 52);
1384
- observeImports(map, "./reporting.js", 53);
1385
1363
  },
1386
1364
  liveVar: {
1387
1365
  },
1388
1366
  onceVar: {
1389
- repairIntrinsics: cells[54].repairIntrinsics.set,
1367
+ shimArrayBufferTransfer: cells[54].shimArrayBufferTransfer.set,
1390
1368
  },
1391
1369
  importMeta: {},
1392
1370
  });
1393
1371
  functors[55]({
1394
1372
  imports(entries) {
1395
1373
  const map = new Map(entries);
1396
- observeImports(map, "./assert-sloppy-mode.js", 1);
1397
1374
  observeImports(map, "./commons.js", 0);
1398
- observeImports(map, "./lockdown.js", 54);
1375
+ observeImports(map, "./error/assert.js", 11);
1399
1376
  },
1400
1377
  liveVar: {
1401
1378
  },
1402
1379
  onceVar: {
1380
+ chooseReporter: cells[55].chooseReporter.set,
1381
+ reportInGroup: cells[55].reportInGroup.set,
1403
1382
  },
1404
1383
  importMeta: {},
1405
1384
  });
1406
1385
  functors[56]({
1407
1386
  imports(entries) {
1408
1387
  const map = new Map(entries);
1388
+ observeImports(map, "@endo/env-options", 3);
1389
+ observeImports(map, "@endo/immutable-arraybuffer/shim.js", 5);
1409
1390
  observeImports(map, "./commons.js", 0);
1410
- observeImports(map, "./compartment.js", 46);
1411
- observeImports(map, "./tame-function-tostring.js", 33);
1412
- observeImports(map, "./intrinsics.js", 13);
1413
- observeImports(map, "./reporting.js", 53);
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);
1414
1417
  },
1415
1418
  liveVar: {
1416
1419
  },
1417
1420
  onceVar: {
1421
+ repairIntrinsics: cells[56].repairIntrinsics.set,
1418
1422
  },
1419
1423
  importMeta: {},
1420
1424
  });
1421
1425
  functors[57]({
1422
1426
  imports(entries) {
1423
1427
  const map = new Map(entries);
1428
+ observeImports(map, "./assert-sloppy-mode.js", 1);
1424
1429
  observeImports(map, "./commons.js", 0);
1425
- observeImports(map, "./error/assert.js", 9);
1430
+ observeImports(map, "./lockdown.js", 56);
1426
1431
  },
1427
1432
  liveVar: {
1428
1433
  },
@@ -1434,8 +1439,10 @@ function observeImports(map, importName, importIndex) {
1434
1439
  imports(entries) {
1435
1440
  const map = new Map(entries);
1436
1441
  observeImports(map, "./commons.js", 0);
1437
- observeImports(map, "./error/console.js", 36);
1438
- observeImports(map, "./error/assert.js", 9);
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);
1439
1446
  },
1440
1447
  liveVar: {
1441
1448
  },
@@ -1446,10 +1453,35 @@ function observeImports(map, importName, importIndex) {
1446
1453
  functors[59]({
1447
1454
  imports(entries) {
1448
1455
  const map = new Map(entries);
1449
- observeImports(map, "./src/lockdown-shim.js", 55);
1450
- observeImports(map, "./src/compartment-shim.js", 56);
1451
- observeImports(map, "./src/assert-shim.js", 57);
1452
- observeImports(map, "./src/console-shim.js", 58);
1456
+ observeImports(map, "./commons.js", 0);
1457
+ observeImports(map, "./error/assert.js", 11);
1458
+ },
1459
+ liveVar: {
1460
+ },
1461
+ onceVar: {
1462
+ },
1463
+ importMeta: {},
1464
+ });
1465
+ functors[60]({
1466
+ imports(entries) {
1467
+ const map = new Map(entries);
1468
+ observeImports(map, "./commons.js", 0);
1469
+ observeImports(map, "./error/console.js", 38);
1470
+ observeImports(map, "./error/assert.js", 11);
1471
+ },
1472
+ liveVar: {
1473
+ },
1474
+ onceVar: {
1475
+ },
1476
+ importMeta: {},
1477
+ });
1478
+ functors[61]({
1479
+ imports(entries) {
1480
+ 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);
1453
1485
  },
1454
1486
  liveVar: {
1455
1487
  },
@@ -1462,7 +1494,7 @@ function observeImports(map, importName, importIndex) {
1462
1494
  })([
1463
1495
  // === 0. ses ./src/commons.js ===
1464
1496
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);/**
1465
- * @module Captures native intrinsics during initialization, so vetted shims
1497
+ * Captures native intrinsics during initialization, so vetted shims
1466
1498
  * (running between initialization of SES and calling lockdown) are free to
1467
1499
  * modify the environment without compromising the integrity of SES. For
1468
1500
  * example, a vetted shim can modify Object.assign because we capture and
@@ -1472,6 +1504,8 @@ function observeImports(map, importName, importIndex) {
1472
1504
  * This pattern of use is enforced by eslint rules no-restricted-globals and
1473
1505
  * no-polymorphic-call.
1474
1506
  * We maintain the list of restricted globals in ../package.json.
1507
+ *
1508
+ * @module
1475
1509
  */
1476
1510
 
1477
1511
  /* global globalThis */
@@ -1946,6 +1980,7 @@ const Fail = (literals, ...args) => {
1946
1980
  * names used.
1947
1981
  */
1948
1982
  const makeEnvironmentCaptor = (aGlobal, dropNames = false) => {
1983
+ /** @type {string[]} */
1949
1984
  const capturedEnvironmentOptionNames = [];
1950
1985
 
1951
1986
  /**
@@ -2002,8 +2037,9 @@ const Fail = (literals, ...args) => {
2002
2037
  freeze(getEnvironmentOption);
2003
2038
 
2004
2039
  /**
2040
+ * @template {string} [T=string]
2005
2041
  * @param {string} optionName
2006
- * @returns {string[]}
2042
+ * @returns {T[]}
2007
2043
  */
2008
2044
  const getEnvironmentOptionsList = optionName => {
2009
2045
  const option = getEnvironmentOption(optionName, '');
@@ -2011,6 +2047,12 @@ const Fail = (literals, ...args) => {
2011
2047
  };
2012
2048
  freeze(getEnvironmentOptionsList);
2013
2049
 
2050
+ /**
2051
+ * @template {string} [T=string]
2052
+ * @param {string} optionName
2053
+ * @param {T} element
2054
+ * @returns {boolean}
2055
+ */
2014
2056
  const environmentOptionsListHas = (optionName, element) =>
2015
2057
  arrayIncludes(getEnvironmentOptionsList(optionName), element);
2016
2058
 
@@ -2043,7 +2085,291 @@ freeze(makeEnvironmentCaptor);
2043
2085
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([["./src/env-options.js", []]]);
2044
2086
  })()
2045
2087
  ,
2046
- // === 4. ses ./src/error/stringify-utils.js ===
2088
+ // === 4. immutable-arraybuffer ./index.js ===
2089
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);/* global globalThis */
2090
+
2091
+ const { setPrototypeOf, getOwnPropertyDescriptors } = Object;
2092
+ const { apply } = Reflect;
2093
+ const { prototype: arrayBufferPrototype } = ArrayBuffer;
2094
+
2095
+ const {
2096
+ slice,
2097
+ // TODO used to be a-ts-expect-error, but my local IDE's TS server
2098
+ // seems to use a more recent definition of the `ArrayBuffer` type.
2099
+ // @ts-ignore At the time of this writing, the `ArrayBuffer` type built
2100
+ // into TypeScript does not know about the recent standard `transfer` method.
2101
+ // Indeed, the `transfer` method is absent from Node <= 20.
2102
+ transfer,
2103
+ } = arrayBufferPrototype;
2104
+
2105
+ /**
2106
+ * Enforces that `arrayBuffer` is a genuine `ArrayBuffer` exotic object.
2107
+ *
2108
+ * @param {ArrayBuffer} arrayBuffer
2109
+ * @param {number} [start]
2110
+ * @param {number} [end]
2111
+ * @returns {ArrayBuffer}
2112
+ */
2113
+ const arrayBufferSlice = (arrayBuffer, start = undefined, end = undefined) =>
2114
+ apply(slice, arrayBuffer, [start, end]);
2115
+
2116
+ /**
2117
+ * Enforces that `arrayBuffer` is a genuine `ArrayBuffer` exotic object.
2118
+ * Return a new fresh `ArrayBuffer` exotic object, where the contents of the
2119
+ * original `arrayBuffer` has been moved into the new one, and the original
2120
+ * `arrayBuffer` has been detached.
2121
+ *
2122
+ * @param {ArrayBuffer} arrayBuffer
2123
+ * @returns {ArrayBuffer}
2124
+ */
2125
+ let arrayBufferTransfer;
2126
+
2127
+ if (transfer) {
2128
+ arrayBufferTransfer = arrayBuffer => apply(transfer, arrayBuffer, []);
2129
+ } else if (globalThis.structuredClone) {
2130
+ arrayBufferTransfer = arrayBuffer => {
2131
+ // Hopefully, a zero-length slice is cheap, but still enforces that
2132
+ // `arrayBuffer` is a genuine `ArrayBuffer` exotic object.
2133
+ arrayBufferSlice(arrayBuffer, 0, 0);
2134
+ return globalThis.structuredClone(arrayBuffer, { transfer: [arrayBuffer] });
2135
+ };
2136
+ } else {
2137
+ // Indeed, Node <= 16 has neither.
2138
+ throw TypeError(
2139
+ `Can only emulate immutable ArrayBuffer on a platform with either "structuredClone" or "ArrayBuffer.prototype.transfer"`,
2140
+ );
2141
+ }
2142
+
2143
+ /**
2144
+ * This class only exists as an artifact of this ponyfill and shim,
2145
+ * as a convenience for imperfectly emulating the
2146
+ * *Immutable ArrayBuffer* proposal, which would not have this class.
2147
+ * In the proposal,
2148
+ * `transferToImmutable` makes a new `ArrayBuffer` that inherits directly from
2149
+ * `ArrayBuffer.prototype` as you'd expect. In the ponyfill and shim,
2150
+ * `transferToImmutable` makes a normal object that inherits directly from
2151
+ * `immutableArrayBufferPrototype`, which has been surgically
2152
+ * altered to inherit directly from `ArrayBuffer.prototype`. The constructor is
2153
+ * captured for use internal to this module, and is made otherwise inaccessible.
2154
+ * Therefore, `immutableArrayBufferPrototype` and all its methods
2155
+ * and accessor functions effectively become hidden intrinsics.
2156
+ * They are not encapsulated. Rather, they are trivially discoverable if you
2157
+ * know how, but are not discoverable merely by enumerating naming paths.
2158
+ */
2159
+ class ImmutableArrayBufferInternal {
2160
+ /** @type {ArrayBuffer} */
2161
+ #buffer;
2162
+
2163
+ constructor(buffer) {
2164
+ // This constructor is deleted from the prototype below.
2165
+ this.#buffer = arrayBufferTransfer(buffer);
2166
+ }
2167
+
2168
+ get byteLength() {
2169
+ return this.#buffer.byteLength;
2170
+ }
2171
+
2172
+ get detached() {
2173
+ this.#buffer; // shim brand check
2174
+ return false;
2175
+ }
2176
+
2177
+ get maxByteLength() {
2178
+ // Not underlying maxByteLength, which is irrelevant
2179
+ return this.#buffer.byteLength;
2180
+ }
2181
+
2182
+ get resizable() {
2183
+ this.#buffer; // shim brand check
2184
+ return false;
2185
+ }
2186
+
2187
+ get immutable() {
2188
+ this.#buffer; // shim brand check
2189
+ return true;
2190
+ }
2191
+
2192
+ slice(start = undefined, end = undefined) {
2193
+ return arrayBufferSlice(this.#buffer, start, end);
2194
+ }
2195
+
2196
+ sliceToImmutable(start = undefined, end = undefined) {
2197
+ // eslint-disable-next-line no-use-before-define
2198
+ return sliceBufferToImmutable(this.#buffer, start, end);
2199
+ }
2200
+
2201
+ resize(_newByteLength = undefined) {
2202
+ this.#buffer; // shim brand check
2203
+ throw TypeError('Cannot resize an immutable ArrayBuffer');
2204
+ }
2205
+
2206
+ transfer(_newLength = undefined) {
2207
+ this.#buffer; // shim brand check
2208
+ throw TypeError('Cannot detach an immutable ArrayBuffer');
2209
+ }
2210
+
2211
+ transferToFixedLength(_newLength = undefined) {
2212
+ this.#buffer; // shim brand check
2213
+ throw TypeError('Cannot detach an immutable ArrayBuffer');
2214
+ }
2215
+
2216
+ transferToImmutable(_newLength = undefined) {
2217
+ this.#buffer; // shim brand check
2218
+ throw TypeError('Cannot detach an immutable ArrayBuffer');
2219
+ }
2220
+ }
2221
+
2222
+ const immutableArrayBufferPrototype = ImmutableArrayBufferInternal.prototype;
2223
+ // @ts-expect-error can only delete optionals
2224
+ delete immutableArrayBufferPrototype.constructor;
2225
+
2226
+ const {
2227
+ slice: { value: sliceOfImmutable },
2228
+ immutable: { get: isImmutableGetter },
2229
+ } = getOwnPropertyDescriptors(immutableArrayBufferPrototype);
2230
+
2231
+ setPrototypeOf(immutableArrayBufferPrototype, arrayBufferPrototype);
2232
+
2233
+ /**
2234
+ * Transfer the contents to a new Immutable ArrayBuffer
2235
+ *
2236
+ * @param {ArrayBuffer} buffer The original buffer.
2237
+ * @param {number} [newLength] The start index.
2238
+ * @returns {ArrayBuffer}
2239
+ */
2240
+ const transferBufferToImmutable = (buffer, newLength = undefined) => {
2241
+ if (newLength !== undefined) {
2242
+ if (transfer) {
2243
+ buffer = apply(transfer, buffer, [newLength]);
2244
+ } else {
2245
+ buffer = arrayBufferTransfer(buffer);
2246
+ const oldLength = buffer.byteLength;
2247
+ // eslint-disable-next-line @endo/restrict-comparison-operands
2248
+ if (newLength <= oldLength) {
2249
+ buffer = arrayBufferSlice(buffer, 0, newLength);
2250
+ } else {
2251
+ const oldTA = new Uint8Array(buffer);
2252
+ const newTA = new Uint8Array(newLength);
2253
+ newTA.set(oldTA);
2254
+ buffer = newTA.buffer;
2255
+ }
2256
+ }
2257
+ }
2258
+ const result = new ImmutableArrayBufferInternal(buffer);
2259
+ return /** @type {ArrayBuffer} */ (/** @type {unknown} */ (result));
2260
+ };$h͏_once.transferBufferToImmutable(transferBufferToImmutable);
2261
+
2262
+ const isBufferImmutable = buffer => {
2263
+ try {
2264
+ // @ts-expect-error Getter should be typed as this-sensitive
2265
+ return apply(isImmutableGetter, buffer, []);
2266
+ } catch (err) {
2267
+ if (err instanceof TypeError) {
2268
+ // Enforce that `buffer` is a genuine ArrayBuffer before returning.
2269
+ arrayBufferSlice(buffer, 0, 0);
2270
+ return false;
2271
+ }
2272
+ throw err;
2273
+ }
2274
+ };
2275
+
2276
+ /**
2277
+ * Enforces that `arrayBuffer` is a genuine `ArrayBuffer` exotic object.
2278
+ *
2279
+ * @param {ArrayBuffer} buffer
2280
+ * @param {number} [start]
2281
+ * @param {number} [end]
2282
+ * @returns {ArrayBuffer}
2283
+ */$h͏_once.isBufferImmutable(isBufferImmutable);
2284
+ const sliceBuffer = (buffer, start = undefined, end = undefined) => {
2285
+ try {
2286
+ // @ts-expect-error We know it is really there
2287
+ return apply(sliceOfImmutable, buffer, [start, end]);
2288
+ } catch (err) {
2289
+ if (err instanceof TypeError) {
2290
+ return arrayBufferSlice(buffer, start, end);
2291
+ }
2292
+ throw err;
2293
+ }
2294
+ };
2295
+
2296
+ /**
2297
+ * Creates an immutable slice of the given buffer.
2298
+ *
2299
+ * @param {ArrayBuffer} buffer The original buffer.
2300
+ * @param {number} [start] The start index.
2301
+ * @param {number} [end] The end index.
2302
+ * @returns {ArrayBuffer} The sliced immutable ArrayBuffer.
2303
+ */
2304
+ const sliceBufferToImmutable = (
2305
+ buffer,
2306
+ start = undefined,
2307
+ end = undefined,
2308
+ ) => transferBufferToImmutable(sliceBuffer(buffer, start, end));$h͏_once.sliceBufferToImmutable(sliceBufferToImmutable);
2309
+ })()
2310
+ ,
2311
+ // === 5. immutable-arraybuffer ./shim.js ===
2312
+ ({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)]]]]]);
2313
+
2314
+
2315
+
2316
+
2317
+
2318
+ const { getOwnPropertyDescriptors, defineProperties } = Object;
2319
+ const { prototype: arrayBufferPrototype } = ArrayBuffer;
2320
+
2321
+ const arrayBufferMethods = {
2322
+ /**
2323
+ * Transfer the contents to a new Immutable ArrayBuffer
2324
+ *
2325
+ * @this {ArrayBuffer} buffer The original buffer.
2326
+ * @param {number} [newLength] The start index.
2327
+ * @returns {ArrayBuffer} The sliced immutable ArrayBuffer.
2328
+ */
2329
+ transferToImmutable(newLength = undefined) {
2330
+ return transferBufferToImmutable(this, newLength);
2331
+ },
2332
+
2333
+ /**
2334
+ * Creates an immutable slice of the given buffer.
2335
+ *
2336
+ * @this {ArrayBuffer} buffer The original buffer.
2337
+ * @param {number} [start] The start index.
2338
+ * @param {number} [end] The end index.
2339
+ * @returns {ArrayBuffer} The sliced immutable ArrayBuffer.
2340
+ */
2341
+ sliceToImmutable(start = undefined, end = undefined) {
2342
+ return sliceBufferToImmutable(this, start, end);
2343
+ },
2344
+
2345
+ get immutable() {
2346
+ return isBufferImmutable(this);
2347
+ },
2348
+ };
2349
+
2350
+ if ('sliceToImmutable' in arrayBufferPrototype) {
2351
+ // Modern shim practice frowns on conditional installation, at least for
2352
+ // proposals prior to stage 3. This is so changes to the proposal since
2353
+ // an old shim was distributed don't need to worry about the proposal
2354
+ // breaking old code depending on the old shim. Thus, if we detect that
2355
+ // we're about to overwrite a prior installation, we simply issue this
2356
+ // warning and continue.
2357
+ //
2358
+ // TODO, if the primordials are frozen after the prior implementation, such as
2359
+ // by `lockdown`, then this precludes overwriting as expected. However, for
2360
+ // this case, the following warning text will be confusing.
2361
+ console.warn(
2362
+ 'About to overwrite a prior implementation of "sliceToImmutable"',
2363
+ );
2364
+ }
2365
+
2366
+ defineProperties(
2367
+ arrayBufferPrototype,
2368
+ getOwnPropertyDescriptors(arrayBufferMethods),
2369
+ );
2370
+ })()
2371
+ ,
2372
+ // === 6. ses ./src/error/stringify-utils.js ===
2047
2373
  ({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)]]]]]);
2048
2374
 
2049
2375
 
@@ -2240,7 +2566,7 @@ const bestEffortStringify = (payload, spaces = undefined) => {
2240
2566
  freeze(bestEffortStringify);
2241
2567
  })()
2242
2568
  ,
2243
- // === 5. ses ./src/error/types.js ===
2569
+ // === 7. ses ./src/error/types.js ===
2244
2570
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);// @ts-check
2245
2571
 
2246
2572
  /** @import {GenericErrorConstructor, AssertMakeErrorOptions, DetailsToken, StringablePayload} from '../../types.js' */
@@ -2302,7 +2628,7 @@ freeze(bestEffortStringify);
2302
2628
  */
2303
2629
  })()
2304
2630
  ,
2305
- // === 6. ses ./src/error/internal-types.js ===
2631
+ // === 8. ses ./src/error/internal-types.js ===
2306
2632
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);// @ts-check
2307
2633
 
2308
2634
  /**
@@ -2403,7 +2729,7 @@ freeze(bestEffortStringify);
2403
2729
  */
2404
2730
  })()
2405
2731
  ,
2406
- // === 7. ses ./src/make-lru-cachemap.js ===
2732
+ // === 9. ses ./src/make-lru-cachemap.js ===
2407
2733
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);// @ts-check
2408
2734
  /* eslint-disable @endo/no-polymorphic-call */
2409
2735
 
@@ -2627,7 +2953,7 @@ const spliceOut = cell => {
2627
2953
  freeze(makeLRUCacheMap);
2628
2954
  })()
2629
2955
  ,
2630
- // === 8. ses ./src/error/note-log-args.js ===
2956
+ // === 10. ses ./src/error/note-log-args.js ===
2631
2957
  ({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)]]]]]);
2632
2958
 
2633
2959
 
@@ -2706,7 +3032,7 @@ const defaultArgsPerErrorBudget = 100;
2706
3032
  freeze(makeNoteLogArgsArrayKit);
2707
3033
  })()
2708
3034
  ,
2709
- // === 9. ses ./src/error/assert.js ===
3035
+ // === 11. ses ./src/error/assert.js ===
2710
3036
  ({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)]]]]]);
2711
3037
 
2712
3038
 
@@ -3284,7 +3610,7 @@ const assert = makeAssert();$h͏_once.assert(assert);
3284
3610
  const assertEqual = assert.equal;$h͏_once.assertEqual(assertEqual);
3285
3611
  })()
3286
3612
  ,
3287
- // === 10. ses ./src/make-hardener.js ===
3613
+ // === 12. ses ./src/make-hardener.js ===
3288
3614
  ({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)]]]]]);
3289
3615
 
3290
3616
 
@@ -3562,7 +3888,7 @@ const freezeTypedArray = array => {
3562
3888
  };$h͏_once.makeHardener(makeHardener);
3563
3889
  })()
3564
3890
  ,
3565
- // === 11. ses ./src/cauterize-property.js ===
3891
+ // === 13. ses ./src/cauterize-property.js ===
3566
3892
  ({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)]]]]]);
3567
3893
 
3568
3894
  /**
@@ -3634,7 +3960,7 @@ const freezeTypedArray = array => {
3634
3960
  };$h͏_once.cauterizeProperty(cauterizeProperty);
3635
3961
  })()
3636
3962
  ,
3637
- // === 12. ses ./src/permits.js ===
3963
+ // === 14. ses ./src/permits.js ===
3638
3964
  ({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)]]]]]);
3639
3965
 
3640
3966
 
@@ -3643,12 +3969,14 @@ const freezeTypedArray = array => {
3643
3969
  /** @import {GenericErrorConstructor} from '../types.js' */
3644
3970
 
3645
3971
  /**
3646
- * @module Exports {@code permits}, a recursively defined
3972
+ * Exports {@code permits}, a recursively defined
3647
3973
  * JSON record enumerating all intrinsics and their properties
3648
3974
  * according to ECMA specs.
3649
3975
  *
3650
3976
  * @author JF Paradis
3651
3977
  * @author Mark S. Miller
3978
+ *
3979
+ * @module
3652
3980
  */
3653
3981
 
3654
3982
  /**
@@ -4993,6 +5321,33 @@ const CommonMath = {
4993
5321
  // https://github.com/tc39/proposal-arraybuffer-transfer
4994
5322
  transferToFixedLength: fn,
4995
5323
  detached: getter,
5324
+ // https://github.com/endojs/endo/pull/2309#issuecomment-2155513240
5325
+ // to be proposed
5326
+ transferToImmutable: fn,
5327
+ sliceToImmutable: fn,
5328
+ immutable: getter,
5329
+ },
5330
+
5331
+ // If this exists, it is purely an artifact of how we currently shim
5332
+ // `transferToImmutable`. As natively implemented, there would be no
5333
+ // such extra prototype.
5334
+ '%ImmutableArrayBufferPrototype%': {
5335
+ '[[Proto]]': '%ArrayBufferPrototype%',
5336
+ byteLength: getter,
5337
+ slice: fn,
5338
+ // See https://github.com/tc39/proposal-resizablearraybuffer
5339
+ transfer: fn,
5340
+ resize: fn,
5341
+ resizable: getter,
5342
+ maxByteLength: getter,
5343
+ // https://github.com/tc39/proposal-arraybuffer-transfer
5344
+ transferToFixedLength: fn,
5345
+ detached: getter,
5346
+ // https://github.com/endojs/endo/pull/2309#issuecomment-2155513240
5347
+ // to be proposed
5348
+ transferToImmutable: fn,
5349
+ sliceToImmutable: fn,
5350
+ immutable: getter,
4996
5351
  },
4997
5352
 
4998
5353
  // SharedArrayBuffer Objects
@@ -5367,7 +5722,7 @@ const CommonMath = {
5367
5722
  };$h͏_once.permitted(permitted);
5368
5723
  })()
5369
5724
  ,
5370
- // === 13. ses ./src/intrinsics.js ===
5725
+ // === 15. ses ./src/intrinsics.js ===
5371
5726
  ({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)]]]]]);
5372
5727
 
5373
5728
 
@@ -5562,7 +5917,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
5562
5917
  };$h͏_once.getGlobalIntrinsics(getGlobalIntrinsics);
5563
5918
  })()
5564
5919
  ,
5565
- // === 14. ses ./src/permits-intrinsics.js ===
5920
+ // === 16. ses ./src/permits-intrinsics.js ===
5566
5921
  ({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)]]]]]);
5567
5922
 
5568
5923
 
@@ -5856,7 +6211,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
5856
6211
  }$h͏_once.default( removeUnpermittedIntrinsics);
5857
6212
  })()
5858
6213
  ,
5859
- // === 15. ses ./src/tame-function-constructors.js ===
6214
+ // === 17. ses ./src/tame-function-constructors.js ===
5860
6215
  ({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)]]]]]);
5861
6216
 
5862
6217
 
@@ -5999,7 +6354,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
5999
6354
  }$h͏_once.default( tameFunctionConstructors);
6000
6355
  })()
6001
6356
  ,
6002
- // === 16. ses ./src/tame-date-constructor.js ===
6357
+ // === 18. ses ./src/tame-date-constructor.js ===
6003
6358
  ({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)]]]]]);
6004
6359
 
6005
6360
 
@@ -6129,7 +6484,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6129
6484
  }$h͏_once.default( tameDateConstructor);
6130
6485
  })()
6131
6486
  ,
6132
- // === 17. ses ./src/tame-math-object.js ===
6487
+ // === 19. ses ./src/tame-math-object.js ===
6133
6488
  ({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)]]]]]);
6134
6489
 
6135
6490
 
@@ -6173,7 +6528,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6173
6528
  }$h͏_once.default( tameMathObject);
6174
6529
  })()
6175
6530
  ,
6176
- // === 18. ses ./src/tame-regexp-constructor.js ===
6531
+ // === 20. ses ./src/tame-regexp-constructor.js ===
6177
6532
  ({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)]]]]]);
6178
6533
 
6179
6534
 
@@ -6184,9 +6539,6 @@ function sampleGlobals(globalObject, newPropertyNames) {
6184
6539
 
6185
6540
 
6186
6541
  function tameRegExpConstructor(regExpTaming = 'safe') {
6187
- if (regExpTaming !== 'safe' && regExpTaming !== 'unsafe') {
6188
- throw TypeError(`unrecognized regExpTaming ${regExpTaming}`);
6189
- }
6190
6542
  const RegExpPrototype = FERAL_REG_EXP.prototype;
6191
6543
 
6192
6544
  const makeRegExpConstructor = (_ = {}) => {
@@ -6244,17 +6596,19 @@ function sampleGlobals(globalObject, newPropertyNames) {
6244
6596
  }$h͏_once.default( tameRegExpConstructor);
6245
6597
  })()
6246
6598
  ,
6247
- // === 19. ses ./src/enablements.js ===
6599
+ // === 21. ses ./src/enablements.js ===
6248
6600
  ({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)]]]]]);
6249
6601
 
6250
6602
  /**
6251
- * @module Exports {@code enablements}, a recursively defined
6603
+ * Exports {@code enablements}, a recursively defined
6252
6604
  * JSON record defining the optimum set of intrinsics properties
6253
6605
  * that need to be "repaired" before hardening is applied on
6254
6606
  * enviromments subject to the override mistake.
6255
6607
  *
6256
6608
  * @author JF Paradis
6257
6609
  * @author Mark S. Miller
6610
+ *
6611
+ * @module
6258
6612
  */
6259
6613
 
6260
6614
  /**
@@ -6489,7 +6843,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6489
6843
  };$h͏_once.severeEnablements(severeEnablements);
6490
6844
  })()
6491
6845
  ,
6492
- // === 20. ses ./src/enable-property-overrides.js ===
6846
+ // === 22. ses ./src/enable-property-overrides.js ===
6493
6847
  ({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)]]]]]);
6494
6848
 
6495
6849
 
@@ -6703,7 +7057,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6703
7057
  }$h͏_once.default( enablePropertyOverrides);
6704
7058
  })()
6705
7059
  ,
6706
- // === 21. ses ./src/tame-locale-methods.js ===
7060
+ // === 23. ses ./src/tame-locale-methods.js ===
6707
7061
  ({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)]]]]]);
6708
7062
 
6709
7063
 
@@ -6750,9 +7104,6 @@ const nonLocaleCompare = tamedMethods.localeCompare;
6750
7104
  const numberToString = tamedMethods.toString;
6751
7105
 
6752
7106
  function tameLocaleMethods(intrinsics, localeTaming = 'safe') {
6753
- if (localeTaming !== 'safe' && localeTaming !== 'unsafe') {
6754
- throw TypeError(`unrecognized localeTaming ${localeTaming}`);
6755
- }
6756
7107
  if (localeTaming === 'unsafe') {
6757
7108
  return;
6758
7109
  }
@@ -6787,15 +7138,16 @@ const numberToString = tamedMethods.toString;
6787
7138
  }$h͏_once.default( tameLocaleMethods);
6788
7139
  })()
6789
7140
  ,
6790
- // === 22. ses ./src/make-eval-function.js ===
7141
+ // === 24. ses ./src/make-eval-function.js ===
6791
7142
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);/**
6792
7143
  * makeEvalFunction()
6793
7144
  * A safe version of the native eval function which relies on
6794
- * the safety of safeEvaluate for confinement.
7145
+ * the safety of `safe-eval` for confinement, unless `no-eval`
7146
+ * is specified (then a TypeError is thrown on use).
6795
7147
  *
6796
- * @param {Function} safeEvaluate
7148
+ * @param {Function} evaluator
6797
7149
  */
6798
- const makeEvalFunction = safeEvaluate => {
7150
+ const makeEvalFunction = evaluator => {
6799
7151
  // We use the concise method syntax to create an eval without a
6800
7152
  // [[Construct]] behavior (such that the invocation "new eval()" throws
6801
7153
  // TypeError: eval is not a constructor"), but which still accepts a
@@ -6809,7 +7161,7 @@ const numberToString = tamedMethods.toString;
6809
7161
  // rule. Track.
6810
7162
  return source;
6811
7163
  }
6812
- return safeEvaluate(source);
7164
+ return evaluator(source);
6813
7165
  },
6814
7166
  }.eval;
6815
7167
 
@@ -6817,7 +7169,7 @@ const numberToString = tamedMethods.toString;
6817
7169
  };$h͏_once.makeEvalFunction(makeEvalFunction);
6818
7170
  })()
6819
7171
  ,
6820
- // === 23. ses ./src/make-function-constructor.js ===
7172
+ // === 25. ses ./src/make-function-constructor.js ===
6821
7173
  ({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)]]]]]);
6822
7174
 
6823
7175
 
@@ -6832,9 +7184,10 @@ const { Fail } = assert;
6832
7184
  /*
6833
7185
  * makeFunctionConstructor()
6834
7186
  * A safe version of the native Function which relies on
6835
- * the safety of safeEvaluate for confinement.
7187
+ * the safety of `safe-eval` for confinement, unless `no-eval`
7188
+ * is specified (then a TypeError is thrown on use).
6836
7189
  */
6837
- const makeFunctionConstructor = safeEvaluate => {
7190
+ const makeFunctionConstructor = evaluator => {
6838
7191
  // Define an unused parameter to ensure Function.length === 1
6839
7192
  const newFunction = function Function(_body) {
6840
7193
  // Sanitize all parameters at the entry point.
@@ -6874,7 +7227,7 @@ const { Fail } = assert;
6874
7227
  // TODO: since we create an anonymous function, the 'this' value
6875
7228
  // isn't bound to the global object as per specs, but set as undefined.
6876
7229
  const src = `(function anonymous(${parameters}\n) {\n${bodyText}\n})`;
6877
- return safeEvaluate(src);
7230
+ return evaluator(src);
6878
7231
  };
6879
7232
 
6880
7233
  defineProperties(newFunction, {
@@ -6892,13 +7245,13 @@ const { Fail } = assert;
6892
7245
  getPrototypeOf(FERAL_FUNCTION) === FERAL_FUNCTION.prototype ||
6893
7246
  Fail`Function prototype is the same accross compartments`;
6894
7247
  getPrototypeOf(newFunction) === FERAL_FUNCTION.prototype ||
6895
- Fail`Function constructor prototype is the same accross compartments`;
7248
+ Fail`Function constructor prototype is the same across compartments`;
6896
7249
 
6897
7250
  return newFunction;
6898
7251
  };$h͏_once.makeFunctionConstructor(makeFunctionConstructor);
6899
7252
  })()
6900
7253
  ,
6901
- // === 24. ses ./src/global-object.js ===
7254
+ // === 26. ses ./src/global-object.js ===
6902
7255
  ({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)]]]]]);
6903
7256
 
6904
7257
 
@@ -7076,7 +7429,7 @@ const { Fail } = assert;
7076
7429
  };$h͏_once.setGlobalObjectEvaluators(setGlobalObjectEvaluators);
7077
7430
  })()
7078
7431
  ,
7079
- // === 25. ses ./src/strict-scope-terminator.js ===
7432
+ // === 27. ses ./src/strict-scope-terminator.js ===
7080
7433
  ({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)]]]]]);
7081
7434
 
7082
7435
 
@@ -7178,7 +7531,7 @@ const scopeProxyHandlerProperties = {
7178
7531
  );$h͏_once.strictScopeTerminator(strictScopeTerminator);
7179
7532
  })()
7180
7533
  ,
7181
- // === 26. ses ./src/sloppy-globals-scope-terminator.js ===
7534
+ // === 28. ses ./src/sloppy-globals-scope-terminator.js ===
7182
7535
  ({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)]]]]]);
7183
7536
 
7184
7537
 
@@ -7242,7 +7595,7 @@ const objTarget = freeze({ __proto__: null });
7242
7595
  freeze(createSloppyGlobalsScopeTerminator);
7243
7596
  })()
7244
7597
  ,
7245
- // === 27. ses ./src/eval-scope.js ===
7598
+ // === 29. ses ./src/eval-scope.js ===
7246
7599
  ({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)]]]]]);
7247
7600
 
7248
7601
 
@@ -7334,7 +7687,7 @@ const { Fail } = assert;
7334
7687
  };$h͏_once.makeEvalScopeKit(makeEvalScopeKit);
7335
7688
  })()
7336
7689
  ,
7337
- // === 28. ses ./src/get-source-url.js ===
7690
+ // === 30. ses ./src/get-source-url.js ===
7338
7691
  ({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)]]]]]);
7339
7692
 
7340
7693
  // Captures a key and value of the form #key=value or @key=value
@@ -7387,7 +7740,7 @@ const sourceMetaEntriesRegExp = new FERAL_REG_EXP(
7387
7740
  };$h͏_once.getSourceURL(getSourceURL);
7388
7741
  })()
7389
7742
  ,
7390
- // === 29. ses ./src/transforms.js ===
7743
+ // === 31. ses ./src/transforms.js ===
7391
7744
  ({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)]]]]]);
7392
7745
 
7393
7746
 
@@ -7657,7 +8010,7 @@ $h͏_once.applyTransforms(applyTransforms);const transforms=freeze({
7657
8010
  });$h͏_once.transforms(transforms);
7658
8011
  })()
7659
8012
  ,
7660
- // === 30. ses ./src/scope-constants.js ===
8013
+ // === 32. ses ./src/scope-constants.js ===
7661
8014
  ({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)]]]]]);
7662
8015
 
7663
8016
 
@@ -7840,7 +8193,7 @@ function isImmutableDataProperty(obj, name) {
7840
8193
  };$h͏_once.getScopeConstants(getScopeConstants);
7841
8194
  })()
7842
8195
  ,
7843
- // === 31. ses ./src/make-evaluate.js ===
8196
+ // === 33. ses ./src/make-evaluate.js ===
7844
8197
  ({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)]]]]]);
7845
8198
 
7846
8199
 
@@ -7953,7 +8306,7 @@ function buildOptimizer(constants, name) {
7953
8306
  };$h͏_once.makeEvaluate(makeEvaluate);
7954
8307
  })()
7955
8308
  ,
7956
- // === 32. ses ./src/make-safe-evaluator.js ===
8309
+ // === 34. ses ./src/make-safe-evaluator.js ===
7957
8310
  ({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)]]]]]);
7958
8311
 
7959
8312
 
@@ -8068,7 +8421,7 @@ const { Fail } = assert;
8068
8421
  };$h͏_once.makeSafeEvaluator(makeSafeEvaluator);
8069
8422
  })()
8070
8423
  ,
8071
- // === 33. ses ./src/tame-function-tostring.js ===
8424
+ // === 35. ses ./src/tame-function-tostring.js ===
8072
8425
  ({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)]]]]]);
8073
8426
 
8074
8427
 
@@ -8121,7 +8474,7 @@ let markVirtualizedNativeFunction;
8121
8474
  };$h͏_once.tameFunctionToString(tameFunctionToString);
8122
8475
  })()
8123
8476
  ,
8124
- // === 34. ses ./src/tame-domains.js ===
8477
+ // === 36. ses ./src/tame-domains.js ===
8125
8478
  ({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);
8126
8479
 
8127
8480
 
@@ -8132,10 +8485,6 @@ let markVirtualizedNativeFunction;
8132
8485
 
8133
8486
 
8134
8487
  function tameDomains(domainTaming = 'safe') {
8135
- if (domainTaming !== 'safe' && domainTaming !== 'unsafe') {
8136
- throw TypeError(`unrecognized domainTaming ${domainTaming}`);
8137
- }
8138
-
8139
8488
  if (domainTaming === 'unsafe') {
8140
8489
  return;
8141
8490
  }
@@ -8169,7 +8518,7 @@ let markVirtualizedNativeFunction;
8169
8518
  }
8170
8519
  })()
8171
8520
  ,
8172
- // === 35. ses ./src/tame-module-source.js ===
8521
+ // === 37. ses ./src/tame-module-source.js ===
8173
8522
  ({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)]]]]]);
8174
8523
 
8175
8524
 
@@ -8223,7 +8572,7 @@ let markVirtualizedNativeFunction;
8223
8572
  };$h͏_once.tameModuleSource(tameModuleSource);
8224
8573
  })()
8225
8574
  ,
8226
- // === 36. ses ./src/error/console.js ===
8575
+ // === 38. ses ./src/error/console.js ===
8227
8576
  ({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)]]]]]);
8228
8577
 
8229
8578
 
@@ -8767,7 +9116,7 @@ freeze(defineCausalConsoleFromLogger);
8767
9116
  freeze(filterConsole);
8768
9117
  })()
8769
9118
  ,
8770
- // === 37. ses ./src/error/unhandled-rejection.js ===
9119
+ // === 39. ses ./src/error/unhandled-rejection.js ===
8771
9120
  ({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)]]]]]);
8772
9121
 
8773
9122
 
@@ -8892,7 +9241,7 @@ freeze(filterConsole);
8892
9241
  };$h͏_once.makeRejectionHandlers(makeRejectionHandlers);
8893
9242
  })()
8894
9243
  ,
8895
- // === 38. ses ./src/error/tame-console.js ===
9244
+ // === 40. ses ./src/error/tame-console.js ===
8896
9245
  ({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)]]]]]);
8897
9246
 
8898
9247
 
@@ -8936,10 +9285,6 @@ const wrapLogger = (logger, thisArg) =>
8936
9285
  unhandledRejectionTrapping = 'report',
8937
9286
  optGetStackString = undefined,
8938
9287
  ) => {
8939
- consoleTaming === 'safe' ||
8940
- consoleTaming === 'unsafe' ||
8941
- failFast(`unrecognized consoleTaming ${consoleTaming}`);
8942
-
8943
9288
  let loggedErrorHandler;
8944
9289
  if (optGetStackString === undefined) {
8945
9290
  loggedErrorHandler = defaultHandler;
@@ -9096,7 +9441,7 @@ const wrapLogger = (logger, thisArg) =>
9096
9441
  };$h͏_once.tameConsole(tameConsole);
9097
9442
  })()
9098
9443
  ,
9099
- // === 39. ses ./src/error/tame-v8-error-constructor.js ===
9444
+ // === 41. ses ./src/error/tame-v8-error-constructor.js ===
9100
9445
  ({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)]]]]]);
9101
9446
 
9102
9447
 
@@ -9170,10 +9515,9 @@ const FILENAME_NODE_DEPENDENTS_CENSOR = /\/node_modules\//;
9170
9515
  // stack traces.
9171
9516
  const FILENAME_NODE_INTERNALS_CENSOR = /^(?:node:)?internal\//;
9172
9517
 
9173
- // Frames within the `assert.js` package should be dropped from
9174
- // concise stack traces, as these are just steps towards creating the
9175
- // error object in question.
9176
- const FILENAME_ASSERT_CENSOR = /\/packages\/ses\/src\/error\/assert.js$/;
9518
+ // Frames within SES `assert.js` should be dropped from concise stack traces, as
9519
+ // these are just steps towards creating the error object in question.
9520
+ const FILENAME_ASSERT_CENSOR = /\/packages\/ses\/src\/error\/assert\.js$/;
9177
9521
 
9178
9522
  // Frames within the `eventual-send` shim should be dropped so that concise
9179
9523
  // deep stacks omit the internals of the eventual-sending mechanism causing
@@ -9182,6 +9526,10 @@ const FILENAME_ASSERT_CENSOR = /\/packages\/ses\/src\/error\/assert.js$/;
9182
9526
  // Endo, so this rule will be of general interest.
9183
9527
  const FILENAME_EVENTUAL_SEND_CENSOR = /\/packages\/eventual-send\/src\//;
9184
9528
 
9529
+ // Frames within the `ses-ava` package should be dropped from concise stack
9530
+ // traces, as they just support exposing error details to AVA.
9531
+ const FILENAME_SES_AVA_CENSOR = /\/packages\/ses-ava\/src\/ses-ava-test\.js$/;
9532
+
9185
9533
  // Any stack frame whose `fileName` matches any of these censor patterns
9186
9534
  // will be omitted from concise stacks.
9187
9535
  // TODO Enable users to configure FILENAME_CENSORS via `lockdown` options.
@@ -9190,6 +9538,7 @@ const FILENAME_CENSORS = [
9190
9538
  FILENAME_NODE_INTERNALS_CENSOR,
9191
9539
  FILENAME_ASSERT_CENSOR,
9192
9540
  FILENAME_EVENTUAL_SEND_CENSOR,
9541
+ FILENAME_SES_AVA_CENSOR,
9193
9542
  ];
9194
9543
 
9195
9544
  // Should a stack frame with this as its fileName be included in a concise
@@ -9213,34 +9562,64 @@ const FILENAME_CENSORS = [
9213
9562
  // likely url-path prefix, ending in a `/.../` should get dropped.
9214
9563
  // Anything to the left of the likely path text is kept.
9215
9564
  // Everything to the right of `/.../` is kept. Thus
9216
- // `'Object.bar (/vat-v1/.../eventual-send/test/test-deep-send.js:13:21)'`
9565
+ // `'Object.bar (/vat-v1/.../eventual-send/test/deep-send.test.js:13:21)'`
9217
9566
  // simplifies to
9218
- // `'Object.bar (eventual-send/test/test-deep-send.js:13:21)'`.
9567
+ // `'Object.bar (eventual-send/test/deep-send.test.js:13:21)'`.
9219
9568
  //
9220
9569
  // See thread starting at
9221
9570
  // https://github.com/Agoric/agoric-sdk/issues/2326#issuecomment-773020389
9222
- $h͏_once.filterFileName(filterFileName);const CALLSITE_ELLIPSES_PATTERN=/^((?:.*[( ])?)[:/\w_-]*\/\.\.\.\/(.+)$/;
9571
+ $h͏_once.filterFileName(filterFileName);const CALLSITE_ELLIPSIS_PATTERN1=/^((?:.*[( ])?)[:/\w_-]*\/\.\.\.\/(.+)$/;
9572
+
9573
+ // The ad-hoc rule of the current pattern is that any likely-file-path or
9574
+ // likely url-path prefix consisting of `.../` should get dropped.
9575
+ // Anything to the left of the likely path text is kept.
9576
+ // Everything to the right of `.../` is kept. Thus
9577
+ // `'Object.bar (.../eventual-send/test/deep-send.test.js:13:21)'`
9578
+ // simplifies to
9579
+ // `'Object.bar (eventual-send/test/deep-send.test.js:13:21)'`.
9580
+ //
9581
+ // See thread starting at
9582
+ // https://github.com/Agoric/agoric-sdk/issues/2326#issuecomment-773020389
9583
+ const CALLSITE_ELLIPSIS_PATTERN2 = /^((?:.*[( ])?)\.\.\.\/(.+)$/;
9223
9584
 
9224
9585
  // The ad-hoc rule of the current pattern is that any likely-file-path or
9225
9586
  // likely url-path prefix, ending in a `/` and prior to `package/` should get
9226
9587
  // dropped.
9227
9588
  // Anything to the left of the likely path prefix text is kept. `package/` and
9228
9589
  // everything to its right is kept. Thus
9229
- // `'Object.bar (/Users/markmiller/src/ongithub/agoric/agoric-sdk/packages/eventual-send/test/test-deep-send.js:13:21)'`
9590
+ // `'Object.bar (/Users/markmiller/src/ongithub/agoric/agoric-sdk/packages/eventual-send/test/deep-send.test.js:13:21)'`
9230
9591
  // simplifies to
9231
- // `'Object.bar (packages/eventual-send/test/test-deep-send.js:13:21)'`.
9592
+ // `'Object.bar (packages/eventual-send/test/deep-send.test.js:13:21)'`.
9232
9593
  // Note that `/packages/` is a convention for monorepos encouraged by
9233
9594
  // lerna.
9234
9595
  const CALLSITE_PACKAGES_PATTERN = /^((?:.*[( ])?)[:/\w_-]*\/(packages\/.+)$/;
9235
9596
 
9597
+ // The ad-hoc rule of the current pattern is that any likely-file-path or
9598
+ // likely url-path prefix of the form `file://` but not `file:///` gets
9599
+ // dropped.
9600
+ // Anything to the left of the likely path prefix text is kept. Everything to
9601
+ // the right of `file://` is kept. Thus
9602
+ // `'Object.bar (file:///Users/markmiller/src/ongithub/endojs/endo/packages/eventual-send/test/deep-send.test.js:13:21)'` is unchanged but
9603
+ // `'Object.bar (file://test/deep-send.test.js:13:21)'`
9604
+
9605
+ // simplifies to
9606
+ // `'Object.bar (test/deep-send.test.js:13:21)'`.
9607
+ // The reason is that `file:///` usually precedes an absolute path which is
9608
+ // clickable without removing the `file:///`, whereas `file://` usually precedes
9609
+ // a relative path which, for whatever vscode reason, is not clickable until the
9610
+ // `file://` is removed.
9611
+ const CALLSITE_FILE_2SLASH_PATTERN = /^((?:.*[( ])?)file:\/\/([^/].*)$/;
9612
+
9236
9613
  // The use of these callSite patterns below assumes that any match will bind
9237
9614
  // capture groups containing the parts of the original string we want
9238
9615
  // to keep. The parts outside those capture groups will be dropped from concise
9239
9616
  // stacks.
9240
9617
  // TODO Enable users to configure CALLSITE_PATTERNS via `lockdown` options.
9241
9618
  const CALLSITE_PATTERNS = [
9242
- CALLSITE_ELLIPSES_PATTERN,
9619
+ CALLSITE_ELLIPSIS_PATTERN1,
9620
+ CALLSITE_ELLIPSIS_PATTERN2,
9243
9621
  CALLSITE_PACKAGES_PATTERN,
9622
+ CALLSITE_FILE_2SLASH_PATTERN,
9244
9623
  ];
9245
9624
 
9246
9625
  // For a stack frame that should be included in a concise stack trace, if
@@ -9248,6 +9627,9 @@ const CALLSITE_PATTERNS = [
9248
9627
  // possibly-shorter stringified stack frame that should be shown instead.
9249
9628
  // Exported only so it can be unit tested.
9250
9629
  // TODO Move so that it applies not just to v8.
9630
+ /**
9631
+ * @param {string} callSiteString
9632
+ */
9251
9633
  const shortenCallSiteString = callSiteString => {
9252
9634
  for (const filter of CALLSITE_PATTERNS) {
9253
9635
  const match = regexpExec(filter, callSiteString);
@@ -9274,18 +9656,24 @@ const CALLSITE_PATTERNS = [
9274
9656
 
9275
9657
  const originalCaptureStackTrace = OriginalError.captureStackTrace;
9276
9658
 
9659
+ const omitFrames =
9660
+ stackFiltering === 'concise' || stackFiltering === 'omit-frames';
9661
+
9662
+ const shortenPaths =
9663
+ stackFiltering === 'concise' || stackFiltering === 'shorten-paths';
9664
+
9277
9665
  // const callSiteFilter = _callSite => true;
9278
9666
  const callSiteFilter = callSite => {
9279
- if (stackFiltering === 'verbose') {
9280
- return true;
9667
+ if (omitFrames) {
9668
+ // eslint-disable-next-line @endo/no-polymorphic-call
9669
+ return filterFileName(callSite.getFileName());
9281
9670
  }
9282
- // eslint-disable-next-line @endo/no-polymorphic-call
9283
- return filterFileName(callSite.getFileName());
9671
+ return true;
9284
9672
  };
9285
9673
 
9286
9674
  const callSiteStringifier = callSite => {
9287
9675
  let callSiteString = `${callSite}`;
9288
- if (stackFiltering === 'concise') {
9676
+ if (shortenPaths) {
9289
9677
  callSiteString = shortenCallSiteString(callSiteString);
9290
9678
  }
9291
9679
  return `\n at ${callSiteString}`;
@@ -9442,9 +9830,8 @@ const CALLSITE_PATTERNS = [
9442
9830
  };$h͏_once.tameV8ErrorConstructor(tameV8ErrorConstructor);
9443
9831
  })()
9444
9832
  ,
9445
- // === 40. ses ./src/error/tame-error-constructor.js ===
9446
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let FERAL_ERROR,TypeError,apply,construct,defineProperties,setPrototypeOf,getOwnPropertyDescriptor,defineProperty,getOwnPropertyDescriptors,NativeErrors,tameV8ErrorConstructor;$h͏_imports([["../commons.js", [["FERAL_ERROR",[$h͏_a => (FERAL_ERROR = $h͏_a)]],["TypeError",[$h͏_a => (TypeError = $h͏_a)]],["apply",[$h͏_a => (apply = $h͏_a)]],["construct",[$h͏_a => (construct = $h͏_a)]],["defineProperties",[$h͏_a => (defineProperties = $h͏_a)]],["setPrototypeOf",[$h͏_a => (setPrototypeOf = $h͏_a)]],["getOwnPropertyDescriptor",[$h͏_a => (getOwnPropertyDescriptor = $h͏_a)]],["defineProperty",[$h͏_a => (defineProperty = $h͏_a)]],["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)]]]]]);
9447
-
9833
+ // === 42. ses ./src/error/tame-error-constructor.js ===
9834
+ ({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)]]]]]);
9448
9835
 
9449
9836
 
9450
9837
 
@@ -9481,16 +9868,6 @@ let initialGetStackString = tamedMethods.getStackString;
9481
9868
  errorTaming = 'safe',
9482
9869
  stackFiltering = 'concise',
9483
9870
  ) {
9484
- if (
9485
- errorTaming !== 'safe' &&
9486
- errorTaming !== 'unsafe' &&
9487
- errorTaming !== 'unsafe-debug'
9488
- ) {
9489
- throw TypeError(`unrecognized errorTaming ${errorTaming}`);
9490
- }
9491
- if (stackFiltering !== 'concise' && stackFiltering !== 'verbose') {
9492
- throw TypeError(`unrecognized stackFiltering ${stackFiltering}`);
9493
- }
9494
9871
  const ErrorPrototype = FERAL_ERROR.prototype;
9495
9872
 
9496
9873
  const { captureStackTrace: originalCaptureStackTrace } = FERAL_ERROR;
@@ -9740,7 +10117,7 @@ let initialGetStackString = tamedMethods.getStackString;
9740
10117
  }$h͏_once.default( tameErrorConstructor);
9741
10118
  })()
9742
10119
  ,
9743
- // === 41. ses ./src/module-load.js ===
10120
+ // === 43. ses ./src/module-load.js ===
9744
10121
  ({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)]]]]]);
9745
10122
 
9746
10123
 
@@ -10250,18 +10627,17 @@ const memoizedLoadWithErrorAnnotation = (
10250
10627
  return moduleLoading;
10251
10628
  };
10252
10629
 
10253
- const asyncJobQueue = () => {
10630
+ const asyncJobQueue = (errors = []) => {
10254
10631
  /** @type {Set<Promise<undefined>>} */
10255
10632
  const pendingJobs = new Set();
10256
- /** @type {Array<Error>} */
10257
- const errors = [];
10258
10633
 
10259
10634
  /**
10260
10635
  * Enqueues a job that starts immediately but won't be awaited until drainQueue is called.
10261
10636
  *
10262
- * @template {any[]} T
10263
- * @param {(...args: T)=>Promise<*>} func
10264
- * @param {T} args
10637
+ * @template {(...args: any[]) => Promise<void>} F
10638
+ * @param {F} func - An async function to execute
10639
+ * @param {Parameters<F>} args - Arguments to pass to the function
10640
+ * @returns {void}
10265
10641
  */
10266
10642
  const enqueueJob = (func, args) => {
10267
10643
  setAdd(
@@ -10273,8 +10649,6 @@ const asyncJobQueue = () => {
10273
10649
  };
10274
10650
  /**
10275
10651
  * Sequentially awaits pending jobs and returns an array of errors
10276
- *
10277
- * @returns {Promise<Array<Error>>}
10278
10652
  */
10279
10653
  const drainQueue = async () => {
10280
10654
  await null;
@@ -10282,9 +10656,42 @@ const asyncJobQueue = () => {
10282
10656
  // eslint-disable-next-line no-await-in-loop
10283
10657
  await job;
10284
10658
  }
10285
- return errors;
10286
10659
  };
10287
- return { enqueueJob, drainQueue };
10660
+ return { enqueueJob, drainQueue, errors };
10661
+ };
10662
+
10663
+ const syncJobQueue = (errors = []) => {
10664
+ let current = [];
10665
+ let next = [];
10666
+
10667
+ /**
10668
+ * Enqueues a job
10669
+ *
10670
+ * @template {(...args: any[]) => void} F
10671
+ * @param {F} func - An async function to execute
10672
+ * @param {Parameters<F>} args - Arguments to pass to the function
10673
+ * @returns {void}
10674
+ */
10675
+ const enqueueJob = (func, args) => {
10676
+ arrayPush(next, [func, args]);
10677
+ };
10678
+ const drainQueue = () => {
10679
+ // Attention: load bearing flow order. Calling another enqueued function in the
10680
+ // synchronous usecase must happen after the one that enqueued it has finished.
10681
+ // Jobs enqueued in one pass do not interleave with jobs resulting from them.
10682
+ // It's necessary for efficient memoization and to break cycles.
10683
+ for (const [func, args] of current) {
10684
+ try {
10685
+ func(...args);
10686
+ } catch (error) {
10687
+ arrayPush(errors, error);
10688
+ }
10689
+ }
10690
+ current = next;
10691
+ next = [];
10692
+ if (current.length > 0) drainQueue();
10693
+ };
10694
+ return { enqueueJob, drainQueue, errors };
10288
10695
  };
10289
10696
 
10290
10697
  /**
@@ -10296,7 +10703,8 @@ const throwAggregateError = ({ errors, errorPrefix }) => {
10296
10703
  // Throw an aggregate error if there were any errors.
10297
10704
  if (errors.length > 0) {
10298
10705
  const verbose =
10299
- getenv('COMPARTMENT_LOAD_ERRORS', '', ['verbose']) === 'verbose';
10706
+ /** @type {'' | 'verbose'} */
10707
+ (getenv('COMPARTMENT_LOAD_ERRORS', '', ['verbose'])) === 'verbose';
10300
10708
  throw TypeError(
10301
10709
  `${errorPrefix} (${errors.length} underlying failures: ${arrayJoin(
10302
10710
  arrayMap(errors, error => error.message + (verbose ? error.stack : '')),
@@ -10330,7 +10738,7 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10330
10738
  /** @type {Map<object, Map<string, Promise<Record<any, any>>>>} */
10331
10739
  const moduleLoads = new Map();
10332
10740
 
10333
- const { enqueueJob, drainQueue } = asyncJobQueue();
10741
+ const { enqueueJob, drainQueue, errors } = asyncJobQueue();
10334
10742
 
10335
10743
  enqueueJob(memoizedLoadWithErrorAnnotation, [
10336
10744
  compartmentPrivateFields,
@@ -10342,8 +10750,7 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10342
10750
  moduleLoads,
10343
10751
  ]);
10344
10752
 
10345
- // Drain pending jobs queue and throw an aggregate error
10346
- const errors = await drainQueue();
10753
+ await drainQueue();
10347
10754
 
10348
10755
  throwAggregateError({
10349
10756
  errors,
@@ -10374,16 +10781,7 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10374
10781
  /** @type {Map<object, Map<string, Promise<Record<any, any>>>>} */
10375
10782
  const moduleLoads = new Map();
10376
10783
 
10377
- /** @type {Array<Error>} */
10378
- const errors = [];
10379
-
10380
- const enqueueJob = (func, args) => {
10381
- try {
10382
- func(...args);
10383
- } catch (error) {
10384
- arrayPush(errors, error);
10385
- }
10386
- };
10784
+ const { enqueueJob, drainQueue, errors } = syncJobQueue();
10387
10785
 
10388
10786
  enqueueJob(memoizedLoadWithErrorAnnotation, [
10389
10787
  compartmentPrivateFields,
@@ -10395,6 +10793,8 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10395
10793
  moduleLoads,
10396
10794
  ]);
10397
10795
 
10796
+ drainQueue();
10797
+
10398
10798
  throwAggregateError({
10399
10799
  errors,
10400
10800
  errorPrefix: `Failed to load module ${q(moduleSpecifier)} in package ${q(
@@ -10404,7 +10804,7 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10404
10804
  };$h͏_once.loadNow(loadNow);
10405
10805
  })()
10406
10806
  ,
10407
- // === 42. ses ./src/module-proxy.js ===
10807
+ // === 44. ses ./src/module-proxy.js ===
10408
10808
  ({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)]]]]]);
10409
10809
 
10410
10810
 
@@ -10607,7 +11007,7 @@ const { quote: q } = assert;
10607
11007
  };$h͏_once.getDeferredExports(getDeferredExports);
10608
11008
  })()
10609
11009
  ,
10610
- // === 43. ses ./src/compartment-evaluate.js ===
11010
+ // === 45. ses ./src/compartment-evaluate.js ===
10611
11011
  ({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)]]]]]);
10612
11012
 
10613
11013
 
@@ -10703,7 +11103,7 @@ const { quote: q } = assert;
10703
11103
  };$h͏_once.compartmentEvaluate(compartmentEvaluate);
10704
11104
  })()
10705
11105
  ,
10706
- // === 44. ses ./src/module-instance.js ===
11106
+ // === 46. ses ./src/module-instance.js ===
10707
11107
  ({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)]]]]]);
10708
11108
 
10709
11109
 
@@ -11203,7 +11603,7 @@ $h͏_once.makeVirtualModuleInstance(makeVirtualModuleInstance);const makeModuleI
11203
11603
  };$h͏_once.makeModuleInstance(makeModuleInstance);
11204
11604
  })()
11205
11605
  ,
11206
- // === 45. ses ./src/module-link.js ===
11606
+ // === 47. ses ./src/module-link.js ===
11207
11607
  ({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)]]]]]);
11208
11608
 
11209
11609
 
@@ -11365,7 +11765,7 @@ function validateModuleSource(moduleSource, moduleSpecifier) {
11365
11765
  };$h͏_once.instantiate(instantiate);
11366
11766
  })()
11367
11767
  ,
11368
- // === 46. ses ./src/compartment.js ===
11768
+ // === 48. ses ./src/compartment.js ===
11369
11769
  ({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)]]]]]);
11370
11770
 
11371
11771
 
@@ -11431,6 +11831,8 @@ function validateModuleSource(moduleSource, moduleSpecifier) {
11431
11831
 
11432
11832
 
11433
11833
 
11834
+
11835
+
11434
11836
 
11435
11837
 
11436
11838
 
@@ -11775,8 +12177,9 @@ defineProperties(InertCompartment, {
11775
12177
  };$h͏_once.makeCompartmentConstructor(makeCompartmentConstructor);
11776
12178
  })()
11777
12179
  ,
11778
- // === 47. ses ./src/get-anonymous-intrinsics.js ===
11779
- ({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,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)]]]],["./compartment.js", [["InertCompartment",[$h͏_a => (InertCompartment = $h͏_a)]]]]]);
12180
+ // === 49. ses ./src/get-anonymous-intrinsics.js ===
12181
+ ({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)]]]]]);
12182
+
11780
12183
 
11781
12184
 
11782
12185
 
@@ -11944,22 +12347,28 @@ function makeArguments() {
11944
12347
  );
11945
12348
  }
11946
12349
 
12350
+ const ab = new ArrayBuffer(0);
12351
+ // @ts-expect-error TODO How do I add sliceToImmutable to ArrayBuffer type?
12352
+ // eslint-disable-next-line @endo/no-polymorphic-call
12353
+ const iab = ab.sliceToImmutable();
12354
+ const iabProto = getPrototypeOf(iab);
12355
+ if (iabProto !== ArrayBuffer.prototype) {
12356
+ // In a native implementation, these will be the same prototype
12357
+ intrinsics['%ImmutableArrayBufferPrototype%'] = iabProto;
12358
+ }
12359
+
11947
12360
  return intrinsics;
11948
12361
  };$h͏_once.getAnonymousIntrinsics(getAnonymousIntrinsics);
11949
12362
  })()
11950
12363
  ,
11951
- // === 48. ses ./src/tame-harden.js ===
11952
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let TypeError,freeze;$h͏_imports([["./commons.js", [["TypeError",[$h͏_a => (TypeError = $h͏_a)]],["freeze",[$h͏_a => (freeze = $h͏_a)]]]]]);
12364
+ // === 50. ses ./src/tame-harden.js ===
12365
+ ({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)]]]]]);
11953
12366
 
11954
12367
 
11955
12368
  /** @import {Harden} from '../types.js'; */
11956
12369
 
11957
12370
  /** @type {(safeHarden: Harden, hardenTaming: 'safe' | 'unsafe') => Harden} */
11958
12371
  const tameHarden = (safeHarden, hardenTaming) => {
11959
- if (hardenTaming !== 'safe' && hardenTaming !== 'unsafe') {
11960
- throw TypeError(`unrecognized fakeHardenOption ${hardenTaming}`);
11961
- }
11962
-
11963
12372
  if (hardenTaming === 'safe') {
11964
12373
  return safeHarden;
11965
12374
  }
@@ -11984,7 +12393,7 @@ function makeArguments() {
11984
12393
  freeze(tameHarden);
11985
12394
  })()
11986
12395
  ,
11987
- // === 49. ses ./src/tame-symbol-constructor.js ===
12396
+ // === 51. ses ./src/tame-symbol-constructor.js ===
11988
12397
  ({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)]]]]]);
11989
12398
 
11990
12399
 
@@ -12051,7 +12460,7 @@ freeze(tameHarden);
12051
12460
  };$h͏_once.tameSymbolConstructor(tameSymbolConstructor);
12052
12461
  })()
12053
12462
  ,
12054
- // === 50. ses ./src/tame-faux-data-properties.js ===
12463
+ // === 52. ses ./src/tame-faux-data-properties.js ===
12055
12464
  ({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)]]]]]);
12056
12465
 
12057
12466
 
@@ -12264,7 +12673,7 @@ const throws = thunk => {
12264
12673
  };$h͏_once.tameFauxDataProperties(tameFauxDataProperties);
12265
12674
  })()
12266
12675
  ,
12267
- // === 51. ses ./src/tame-regenerator-runtime.js ===
12676
+ // === 53. ses ./src/tame-regenerator-runtime.js ===
12268
12677
  ({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)]]]]]);
12269
12678
 
12270
12679
 
@@ -12296,7 +12705,7 @@ const throws = thunk => {
12296
12705
  };$h͏_once.tameRegeneratorRuntime(tameRegeneratorRuntime);
12297
12706
  })()
12298
12707
  ,
12299
- // === 52. ses ./src/shim-arraybuffer-transfer.js ===
12708
+ // === 54. ses ./src/shim-arraybuffer-transfer.js ===
12300
12709
  ({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)]]]]]);
12301
12710
 
12302
12711
 
@@ -12310,7 +12719,6 @@ const throws = thunk => {
12310
12719
 
12311
12720
 
12312
12721
  const shimArrayBufferTransfer = () => {
12313
- // @ts-expect-error TODO extend ArrayBuffer type to include transfer, etc.
12314
12722
  if (typeof arrayBufferPrototype.transfer === 'function') {
12315
12723
  // Assume already exists so does not need to be shimmed.
12316
12724
  // Such conditional shimming is ok in this case since ArrayBuffer.p.transfer
@@ -12385,8 +12793,8 @@ const throws = thunk => {
12385
12793
  };$h͏_once.shimArrayBufferTransfer(shimArrayBufferTransfer);
12386
12794
  })()
12387
12795
  ,
12388
- // === 53. ses ./src/reporting.js ===
12389
- ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let TypeError,functionBind,globalThis,assert;$h͏_imports([["./commons.js", [["TypeError",[$h͏_a => (TypeError = $h͏_a)]],["functionBind",[$h͏_a => (functionBind = $h͏_a)]],["globalThis",[$h͏_a => (globalThis = $h͏_a)]]]],["./error/assert.js", [["assert",[$h͏_a => (assert = $h͏_a)]]]]]);
12796
+ // === 55. ses ./src/reporting.js ===
12797
+ ({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)]]]]]);
12390
12798
 
12391
12799
 
12392
12800
  /**
@@ -12439,9 +12847,6 @@ const mute = () => {};
12439
12847
  if (reporting === 'none') {
12440
12848
  return makeReportPrinter(mute);
12441
12849
  }
12442
- if (reporting !== 'platform' && reporting !== 'console') {
12443
- throw new TypeError(`Invalid lockdown reporting option: ${reporting}`);
12444
- }
12445
12850
  if (
12446
12851
  reporting === 'console' ||
12447
12852
  globalThis.window === globalThis ||
@@ -12496,8 +12901,9 @@ const mute = () => {};
12496
12901
  };$h͏_once.reportInGroup(reportInGroup);
12497
12902
  })()
12498
12903
  ,
12499
- // === 54. ses ./src/lockdown.js ===
12500
- ({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)]]]],["./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)]]]]]);
12904
+ // === 56. ses ./src/lockdown.js ===
12905
+ ({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)]]]]]);
12906
+
12501
12907
 
12502
12908
 
12503
12909
 
@@ -12599,10 +13005,32 @@ const safeHarden = makeHardener();
12599
13005
  // only ever need to be called once and that simplifying lockdown will improve
12600
13006
  // the quality of audits.
12601
13007
 
12602
- const assertDirectEvalAvailable = () => {
12603
- let allowed = false;
13008
+ const probeHostEvaluators = () => {
13009
+ let functionAllowed;
13010
+ try {
13011
+ functionAllowed = FERAL_FUNCTION('return true')();
13012
+ } catch (_error) {
13013
+ // We reach here if the Function() constructor is outright forbidden by a
13014
+ // strict Content Security Policy (containing either a `default-src` or a
13015
+ // `script-src` directive), not been implemented in the host, or the host
13016
+ // is configured to throw an exception instead of `new Function`.
13017
+ functionAllowed = false;
13018
+ }
13019
+
13020
+ let evalAllowed;
12604
13021
  try {
12605
- allowed = FERAL_FUNCTION(
13022
+ evalAllowed = FERAL_EVAL('true');
13023
+ } catch (_error) {
13024
+ // We reach here if `eval` is outright forbidden by a strict Content Security Policy,
13025
+ // not implemented in the host, or the host is configured to throw an exception.
13026
+ // We allow this for SES usage that delegates the responsibility to isolate
13027
+ // guest code to production code generation.
13028
+ evalAllowed = false;
13029
+ }
13030
+
13031
+ let directEvalAllowed;
13032
+ if (functionAllowed && evalAllowed) {
13033
+ directEvalAllowed = FERAL_FUNCTION(
12606
13034
  'eval',
12607
13035
  'SES_changed',
12608
13036
  `\
@@ -12614,21 +13042,12 @@ const assertDirectEvalAvailable = () => {
12614
13042
  // and indirect, which generally creates a new global.
12615
13043
  // We are going to throw an exception for failing to initialize SES, but
12616
13044
  // good neighbors clean up.
12617
- if (!allowed) {
13045
+ if (!directEvalAllowed) {
12618
13046
  delete globalThis.SES_changed;
12619
13047
  }
12620
- } catch (_error) {
12621
- // We reach here if eval is outright forbidden by a Content Security Policy.
12622
- // We allow this for SES usage that delegates the responsibility to isolate
12623
- // guest code to production code generation.
12624
- allowed = true;
12625
- }
12626
- if (!allowed) {
12627
- // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_DIRECT_EVAL.md
12628
- throw TypeError(
12629
- `SES cannot initialize unless 'eval' is the original intrinsic 'eval', suitable for direct-eval (dynamically scoped eval) (SES_DIRECT_EVAL)`,
12630
- );
12631
13048
  }
13049
+
13050
+ return { functionAllowed, evalAllowed, directEvalAllowed };
12632
13051
  };
12633
13052
 
12634
13053
  /**
@@ -12651,65 +13070,85 @@ const assertDirectEvalAvailable = () => {
12651
13070
  // The `stackFiltering` is not a safety issue. Rather it is a tradeoff
12652
13071
  // between relevance and completeness of the stack frames shown on the
12653
13072
  // console. Setting`stackFiltering` to `'verbose'` applies no filters, providing
12654
- // the raw stack frames that can be quite versbose. Setting
13073
+ // the raw stack frames that can be quite verbose. Setting
12655
13074
  // `stackFrameFiltering` to`'concise'` limits the display to the stack frame
12656
13075
  // information most likely to be relevant, eliminating distracting frames
12657
13076
  // such as those from the infrastructure. However, the bug you're trying to
12658
- // track down might be in the infrastrure, in which case the `'verbose'` setting
13077
+ // track down might be in the infrastructure, in which case the `'verbose'` setting
12659
13078
  // is useful. See
12660
13079
  // [`stackFiltering` options](https://github.com/Agoric/SES-shim/blob/master/packages/ses/docs/lockdown.md#stackfiltering-options)
12661
13080
  // for an explanation.
12662
13081
 
12663
13082
  const {
12664
- errorTaming = getenv('LOCKDOWN_ERROR_TAMING', 'safe'),
12665
- errorTrapping = /** @type {"platform" | "none" | "report" | "abort" | "exit"} */ (
12666
- getenv('LOCKDOWN_ERROR_TRAPPING', 'platform')
13083
+ errorTaming = /** @type {'safe' | 'unsafe' | 'unsafe-debug'} */ (
13084
+ getenv('LOCKDOWN_ERROR_TAMING', 'safe', ['unsafe', 'unsafe-debug'])
12667
13085
  ),
12668
- reporting = /** @type {"platform" | "console" | "none"} */ (
12669
- getenv('LOCKDOWN_REPORTING', 'platform')
13086
+ errorTrapping = /** @type {'platform' | 'none' | 'report' | 'abort' | 'exit'} */ (
13087
+ getenv('LOCKDOWN_ERROR_TRAPPING', 'platform', [
13088
+ 'none',
13089
+ 'report',
13090
+ 'abort',
13091
+ 'exit',
13092
+ ])
12670
13093
  ),
12671
- unhandledRejectionTrapping = /** @type {"none" | "report"} */ (
12672
- getenv('LOCKDOWN_UNHANDLED_REJECTION_TRAPPING', 'report')
13094
+ reporting = /** @type {'platform' | 'console' | 'none'} */ (
13095
+ getenv('LOCKDOWN_REPORTING', 'platform', ['console', 'none'])
13096
+ ),
13097
+ unhandledRejectionTrapping = /** @type {'none' | 'report'} */ (
13098
+ getenv('LOCKDOWN_UNHANDLED_REJECTION_TRAPPING', 'report', ['none'])
13099
+ ),
13100
+ regExpTaming = /** @type {'safe' | 'unsafe'} */ (
13101
+ getenv('LOCKDOWN_REGEXP_TAMING', 'safe', ['unsafe'])
13102
+ ),
13103
+ localeTaming = /** @type {'safe' | 'unsafe'} */ (
13104
+ getenv('LOCKDOWN_LOCALE_TAMING', 'safe', ['unsafe'])
12673
13105
  ),
12674
- regExpTaming = getenv('LOCKDOWN_REGEXP_TAMING', 'safe'),
12675
- localeTaming = getenv('LOCKDOWN_LOCALE_TAMING', 'safe'),
12676
-
12677
13106
  consoleTaming = /** @type {'unsafe' | 'safe'} */ (
12678
- getenv('LOCKDOWN_CONSOLE_TAMING', 'safe')
13107
+ getenv('LOCKDOWN_CONSOLE_TAMING', 'safe', ['unsafe'])
12679
13108
  ),
12680
13109
  overrideTaming = /** @type {'moderate' | 'min' | 'severe'} */ (
12681
- getenv('LOCKDOWN_OVERRIDE_TAMING', 'moderate')
13110
+ getenv('LOCKDOWN_OVERRIDE_TAMING', 'moderate', ['min', 'severe'])
13111
+ ),
13112
+ stackFiltering = /** @type {'concise' | 'omit-frames' | 'shorten-paths' | 'verbose'} */ (
13113
+ getenv('LOCKDOWN_STACK_FILTERING', 'concise', [
13114
+ 'omit-frames',
13115
+ 'shorten-paths',
13116
+ 'verbose',
13117
+ ])
13118
+ ),
13119
+ domainTaming = /** @type {'safe' | 'unsafe'} */ (
13120
+ getenv('LOCKDOWN_DOMAIN_TAMING', 'safe', ['unsafe'])
13121
+ ),
13122
+ evalTaming = /** @type {'safe-eval' | 'unsafe-eval' | 'no-eval'} */ (
13123
+ getenv('LOCKDOWN_EVAL_TAMING', 'safe-eval', [
13124
+ 'unsafe-eval',
13125
+ 'no-eval',
13126
+ // deprecated
13127
+ 'safeEval',
13128
+ 'unsafeEval',
13129
+ 'noEval',
13130
+ ])
12682
13131
  ),
12683
- stackFiltering = getenv('LOCKDOWN_STACK_FILTERING', 'concise'),
12684
- domainTaming = getenv('LOCKDOWN_DOMAIN_TAMING', 'safe'),
12685
- evalTaming = getenv('LOCKDOWN_EVAL_TAMING', 'safe-eval'),
12686
- overrideDebug = arrayFilter(
12687
- stringSplit(getenv('LOCKDOWN_OVERRIDE_DEBUG', ''), ','),
12688
- /** @param {string} debugName */
12689
- debugName => debugName !== '',
13132
+ overrideDebug = /** @type {string[]} */ (
13133
+ arrayFilter(
13134
+ stringSplit(getenv('LOCKDOWN_OVERRIDE_DEBUG', ''), ','),
13135
+ /** @param {string} debugName */
13136
+ debugName => debugName !== '',
13137
+ )
12690
13138
  ),
12691
- legacyRegeneratorRuntimeTaming = getenv(
12692
- 'LOCKDOWN_LEGACY_REGENERATOR_RUNTIME_TAMING',
12693
- 'safe',
13139
+ legacyRegeneratorRuntimeTaming = /** @type {'safe' | 'unsafe-ignore'} */ (
13140
+ getenv('LOCKDOWN_LEGACY_REGENERATOR_RUNTIME_TAMING', 'safe', [
13141
+ 'unsafe-ignore',
13142
+ ])
13143
+ ),
13144
+ __hardenTaming__ = /** @type {'safe' | 'unsafe'} */ (
13145
+ getenv('LOCKDOWN_HARDEN_TAMING', 'safe', ['unsafe'])
12694
13146
  ),
12695
- __hardenTaming__ = getenv('LOCKDOWN_HARDEN_TAMING', 'safe'),
12696
13147
  dateTaming, // deprecated
12697
13148
  mathTaming, // deprecated
12698
13149
  ...extraOptions
12699
13150
  } = options;
12700
13151
 
12701
- legacyRegeneratorRuntimeTaming === 'safe' ||
12702
- legacyRegeneratorRuntimeTaming === 'unsafe-ignore' ||
12703
- Fail`lockdown(): non supported option legacyRegeneratorRuntimeTaming: ${q(legacyRegeneratorRuntimeTaming)}`;
12704
-
12705
- evalTaming === 'unsafe-eval' ||
12706
- evalTaming === 'unsafeEval' || // deprecated
12707
- evalTaming === 'safe-eval' ||
12708
- evalTaming === 'safeEval' || // deprecated
12709
- evalTaming === 'no-eval' ||
12710
- evalTaming === 'noEval' || // deprecated
12711
- Fail`lockdown(): non supported option evalTaming: ${q(evalTaming)}`;
12712
-
12713
13152
  // Assert that only supported options were passed.
12714
13153
  // Use Reflect.ownKeys to reject symbol-named properties as well.
12715
13154
  const extraOptionsNames = ownKeys(extraOptions);
@@ -12720,13 +13159,11 @@ const assertDirectEvalAvailable = () => {
12720
13159
  const { warn } = reporter;
12721
13160
 
12722
13161
  if (dateTaming !== undefined) {
12723
- // eslint-disable-next-line no-console
12724
13162
  warn(
12725
13163
  `SES The 'dateTaming' option is deprecated and does nothing. In the future specifying it will be an error.`,
12726
13164
  );
12727
13165
  }
12728
13166
  if (mathTaming !== undefined) {
12729
- // eslint-disable-next-line no-console
12730
13167
  warn(
12731
13168
  `SES The 'mathTaming' option is deprecated and does nothing. In the future specifying it will be an error.`,
12732
13169
  );
@@ -12744,7 +13181,19 @@ const assertDirectEvalAvailable = () => {
12744
13181
  // trace retained:
12745
13182
  priorRepairIntrinsics.stack;
12746
13183
 
12747
- assertDirectEvalAvailable();
13184
+ const { functionAllowed, evalAllowed, directEvalAllowed } =
13185
+ probeHostEvaluators();
13186
+
13187
+ if (
13188
+ directEvalAllowed === false &&
13189
+ evalTaming === 'safe-eval' &&
13190
+ (functionAllowed || evalAllowed)
13191
+ ) {
13192
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_DIRECT_EVAL.md
13193
+ throw TypeError(
13194
+ "SES cannot initialize unless 'eval' is the original intrinsic 'eval', suitable for direct eval (dynamically scoped eval) (SES_DIRECT_EVAL)",
13195
+ );
13196
+ }
12748
13197
 
12749
13198
  /**
12750
13199
  * Because of packagers and bundlers, etc, multiple invocations of lockdown
@@ -12799,7 +13248,6 @@ const assertDirectEvalAvailable = () => {
12799
13248
  const { addIntrinsics, completePrototypes, finalIntrinsics } =
12800
13249
  makeIntrinsicsCollector(reporter);
12801
13250
 
12802
- // @ts-expect-error __hardenTaming__ could be any string
12803
13251
  const tamedHarden = tameHarden(safeHarden, __hardenTaming__);
12804
13252
  addIntrinsics({ harden: tamedHarden });
12805
13253
 
@@ -13014,7 +13462,7 @@ const assertDirectEvalAvailable = () => {
13014
13462
  };$h͏_once.repairIntrinsics(repairIntrinsics);
13015
13463
  })()
13016
13464
  ,
13017
- // === 55. ses ./src/lockdown-shim.js ===
13465
+ // === 57. ses ./src/lockdown-shim.js ===
13018
13466
  ({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)]]]]]);
13019
13467
 
13020
13468
 
@@ -13054,7 +13502,7 @@ globalThis.repairIntrinsics = options => {
13054
13502
  };
13055
13503
  })()
13056
13504
  ,
13057
- // === 56. ses ./src/compartment-shim.js ===
13505
+ // === 58. ses ./src/compartment-shim.js ===
13058
13506
  ({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)]]]]]);
13059
13507
 
13060
13508
 
@@ -13079,14 +13527,14 @@ globalThis.Compartment = makeCompartmentConstructor(
13079
13527
  );
13080
13528
  })()
13081
13529
  ,
13082
- // === 57. ses ./src/assert-shim.js ===
13530
+ // === 59. ses ./src/assert-shim.js ===
13083
13531
  ({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)]]]]]);
13084
13532
 
13085
13533
 
13086
13534
  globalThis.assert = assert;
13087
13535
  })()
13088
13536
  ,
13089
- // === 58. ses ./src/console-shim.js ===
13537
+ // === 60. ses ./src/console-shim.js ===
13090
13538
  ({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)]]]]]);
13091
13539
 
13092
13540
 
@@ -13139,7 +13587,7 @@ globalThis[MAKE_CAUSAL_CONSOLE_FROM_LOGGER_KEY_FOR_SES_AVA] =
13139
13587
  makeCausalConsoleFromLoggerForSesAva;
13140
13588
  })()
13141
13589
  ,
13142
- // === 59. ses ./index.js ===
13590
+ // === 61. ses ./index.js ===
13143
13591
  ({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", []]]);
13144
13592
  })()
13145
13593
  ,