ses 1.12.0 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- // ses@1.12.0
1
+ // ses@1.13.1
2
2
  (functors => options => {
3
3
  'use strict';
4
4
 
@@ -206,6 +206,12 @@
206
206
  },
207
207
  {
208
208
  },
209
+ {
210
+ isBufferImmutable: cell("isBufferImmutable"),
211
+ sliceBufferToImmutable: cell("sliceBufferToImmutable"),
212
+ },
213
+ {
214
+ },
209
215
  {
210
216
  an: cell("an"),
211
217
  bestEffortStringify: cell("bestEffortStringify"),
@@ -651,20 +657,19 @@ function observeImports(map, importName, importIndex) {
651
657
  functors[4]({
652
658
  imports(entries) {
653
659
  const map = new Map(entries);
654
- observeImports(map, "../commons.js", 0);
655
660
  },
656
661
  liveVar: {
657
662
  },
658
663
  onceVar: {
659
- an: cells[4].an.set,
660
- bestEffortStringify: cells[4].bestEffortStringify.set,
661
- enJoin: cells[4].enJoin.set,
664
+ isBufferImmutable: cells[4].isBufferImmutable.set,
665
+ sliceBufferToImmutable: cells[4].sliceBufferToImmutable.set,
662
666
  },
663
667
  importMeta: {},
664
668
  });
665
669
  functors[5]({
666
670
  imports(entries) {
667
671
  const map = new Map(entries);
672
+ observeImports(map, "./src/limited-pony-for-hermes.js", 4);
668
673
  },
669
674
  liveVar: {
670
675
  },
@@ -675,10 +680,14 @@ function observeImports(map, importName, importIndex) {
675
680
  functors[6]({
676
681
  imports(entries) {
677
682
  const map = new Map(entries);
683
+ observeImports(map, "../commons.js", 0);
678
684
  },
679
685
  liveVar: {
680
686
  },
681
687
  onceVar: {
688
+ an: cells[6].an.set,
689
+ bestEffortStringify: cells[6].bestEffortStringify.set,
690
+ enJoin: cells[6].enJoin.set,
682
691
  },
683
692
  importMeta: {},
684
693
  });
@@ -689,71 +698,65 @@ function observeImports(map, importName, importIndex) {
689
698
  liveVar: {
690
699
  },
691
700
  onceVar: {
692
- makeLRUCacheMap: cells[7].makeLRUCacheMap.set,
693
701
  },
694
702
  importMeta: {},
695
703
  });
696
704
  functors[8]({
697
705
  imports(entries) {
698
706
  const map = new Map(entries);
699
- observeImports(map, "../make-lru-cachemap.js", 7);
700
707
  },
701
708
  liveVar: {
702
709
  },
703
710
  onceVar: {
704
- makeNoteLogArgsArrayKit: cells[8].makeNoteLogArgsArrayKit.set,
705
711
  },
706
712
  importMeta: {},
707
713
  });
708
714
  functors[9]({
709
715
  imports(entries) {
710
716
  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
717
  },
717
718
  liveVar: {
718
719
  },
719
720
  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,
721
+ makeLRUCacheMap: cells[9].makeLRUCacheMap.set,
731
722
  },
732
723
  importMeta: {},
733
724
  });
734
725
  functors[10]({
735
726
  imports(entries) {
736
727
  const map = new Map(entries);
737
- observeImports(map, "./commons.js", 0);
738
- observeImports(map, "./error/assert.js", 9);
728
+ observeImports(map, "../make-lru-cachemap.js", 9);
739
729
  },
740
730
  liveVar: {
741
731
  },
742
732
  onceVar: {
743
- isTypedArray: cells[10].isTypedArray.set,
744
- makeHardener: cells[10].makeHardener.set,
733
+ makeNoteLogArgsArrayKit: cells[10].makeNoteLogArgsArrayKit.set,
745
734
  },
746
735
  importMeta: {},
747
736
  });
748
737
  functors[11]({
749
738
  imports(entries) {
750
739
  const map = new Map(entries);
751
- observeImports(map, "./commons.js", 0);
740
+ observeImports(map, "../commons.js", 0);
741
+ observeImports(map, "./stringify-utils.js", 6);
742
+ observeImports(map, "./types.js", 7);
743
+ observeImports(map, "./internal-types.js", 8);
744
+ observeImports(map, "./note-log-args.js", 10);
752
745
  },
753
746
  liveVar: {
754
747
  },
755
748
  onceVar: {
756
- cauterizeProperty: cells[11].cauterizeProperty.set,
749
+ quote: cells[11].q.set,
750
+ bare: cells[11].b.set,
751
+ redactedDetails: cells[11].X.set,
752
+ unredactedDetails: cells[11].unredactedDetails.set,
753
+ makeError: cells[11].makeError.set,
754
+ note: cells[11].annotateError.set,
755
+ loggedErrorHandler: cells[11].loggedErrorHandler.set,
756
+ makeAssert: cells[11].makeAssert.set,
757
+ assert: cells[11].assert.set,
758
+ assertEqual: cells[11].assertEqual.set,
759
+ sanitizeError: cells[11].sanitizeError.set,
757
760
  },
758
761
  importMeta: {},
759
762
  });
@@ -761,68 +764,70 @@ function observeImports(map, importName, importIndex) {
761
764
  imports(entries) {
762
765
  const map = new Map(entries);
763
766
  observeImports(map, "./commons.js", 0);
767
+ observeImports(map, "./error/assert.js", 11);
764
768
  },
765
769
  liveVar: {
766
770
  },
767
771
  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,
772
+ isTypedArray: cells[12].isTypedArray.set,
773
+ makeHardener: cells[12].makeHardener.set,
778
774
  },
779
775
  importMeta: {},
780
776
  });
781
777
  functors[13]({
782
778
  imports(entries) {
783
779
  const map = new Map(entries);
784
- observeImports(map, "./cauterize-property.js", 11);
785
780
  observeImports(map, "./commons.js", 0);
786
- observeImports(map, "./permits.js", 12);
787
781
  },
788
782
  liveVar: {
789
783
  },
790
784
  onceVar: {
791
- makeIntrinsicsCollector: cells[13].makeIntrinsicsCollector.set,
792
- getGlobalIntrinsics: cells[13].getGlobalIntrinsics.set,
785
+ cauterizeProperty: cells[13].cauterizeProperty.set,
793
786
  },
794
787
  importMeta: {},
795
788
  });
796
789
  functors[14]({
797
790
  imports(entries) {
798
791
  const map = new Map(entries);
799
- observeImports(map, "./permits.js", 12);
800
792
  observeImports(map, "./commons.js", 0);
801
- observeImports(map, "./cauterize-property.js", 11);
802
793
  },
803
794
  liveVar: {
804
795
  },
805
796
  onceVar: {
806
- default: cells[14].default.set,
797
+ NativeErrors: cells[14].NativeErrors.set,
798
+ constantProperties: cells[14].constantProperties.set,
799
+ universalPropertyNames: cells[14].universalPropertyNames.set,
800
+ initialGlobalPropertyNames: cells[14].initialGlobalPropertyNames.set,
801
+ sharedGlobalPropertyNames: cells[14].sharedGlobalPropertyNames.set,
802
+ uniqueGlobalPropertyNames: cells[14].uniqueGlobalPropertyNames.set,
803
+ FunctionInstance: cells[14].FunctionInstance.set,
804
+ AsyncFunctionInstance: cells[14].AsyncFunctionInstance.set,
805
+ isAccessorPermit: cells[14].isAccessorPermit.set,
806
+ permitted: cells[14].permitted.set,
807
807
  },
808
808
  importMeta: {},
809
809
  });
810
810
  functors[15]({
811
811
  imports(entries) {
812
812
  const map = new Map(entries);
813
+ observeImports(map, "./cauterize-property.js", 13);
813
814
  observeImports(map, "./commons.js", 0);
815
+ observeImports(map, "./permits.js", 14);
814
816
  },
815
817
  liveVar: {
816
818
  },
817
819
  onceVar: {
818
- default: cells[15].default.set,
820
+ makeIntrinsicsCollector: cells[15].makeIntrinsicsCollector.set,
821
+ getGlobalIntrinsics: cells[15].getGlobalIntrinsics.set,
819
822
  },
820
823
  importMeta: {},
821
824
  });
822
825
  functors[16]({
823
826
  imports(entries) {
824
827
  const map = new Map(entries);
828
+ observeImports(map, "./permits.js", 14);
825
829
  observeImports(map, "./commons.js", 0);
830
+ observeImports(map, "./cauterize-property.js", 13);
826
831
  },
827
832
  liveVar: {
828
833
  },
@@ -863,9 +868,7 @@ function observeImports(map, importName, importIndex) {
863
868
  liveVar: {
864
869
  },
865
870
  onceVar: {
866
- minEnablements: cells[19].minEnablements.set,
867
- moderateEnablements: cells[19].moderateEnablements.set,
868
- severeEnablements: cells[19].severeEnablements.set,
871
+ default: cells[19].default.set,
869
872
  },
870
873
  importMeta: {},
871
874
  });
@@ -873,7 +876,6 @@ function observeImports(map, importName, importIndex) {
873
876
  imports(entries) {
874
877
  const map = new Map(entries);
875
878
  observeImports(map, "./commons.js", 0);
876
- observeImports(map, "./enablements.js", 19);
877
879
  },
878
880
  liveVar: {
879
881
  },
@@ -886,23 +888,26 @@ function observeImports(map, importName, importIndex) {
886
888
  imports(entries) {
887
889
  const map = new Map(entries);
888
890
  observeImports(map, "./commons.js", 0);
889
- observeImports(map, "./error/assert.js", 9);
890
891
  },
891
892
  liveVar: {
892
893
  },
893
894
  onceVar: {
894
- default: cells[21].default.set,
895
+ minEnablements: cells[21].minEnablements.set,
896
+ moderateEnablements: cells[21].moderateEnablements.set,
897
+ severeEnablements: cells[21].severeEnablements.set,
895
898
  },
896
899
  importMeta: {},
897
900
  });
898
901
  functors[22]({
899
902
  imports(entries) {
900
903
  const map = new Map(entries);
904
+ observeImports(map, "./commons.js", 0);
905
+ observeImports(map, "./enablements.js", 21);
901
906
  },
902
907
  liveVar: {
903
908
  },
904
909
  onceVar: {
905
- makeEvalFunction: cells[22].makeEvalFunction.set,
910
+ default: cells[22].default.set,
906
911
  },
907
912
  importMeta: {},
908
913
  });
@@ -910,30 +915,23 @@ function observeImports(map, importName, importIndex) {
910
915
  imports(entries) {
911
916
  const map = new Map(entries);
912
917
  observeImports(map, "./commons.js", 0);
913
- observeImports(map, "./error/assert.js", 9);
918
+ observeImports(map, "./error/assert.js", 11);
914
919
  },
915
920
  liveVar: {
916
921
  },
917
922
  onceVar: {
918
- makeFunctionConstructor: cells[23].makeFunctionConstructor.set,
923
+ default: cells[23].default.set,
919
924
  },
920
925
  importMeta: {},
921
926
  });
922
927
  functors[24]({
923
928
  imports(entries) {
924
929
  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
930
  },
930
931
  liveVar: {
931
932
  },
932
933
  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,
934
+ makeEvalFunction: cells[24].makeEvalFunction.set,
937
935
  },
938
936
  importMeta: {},
939
937
  });
@@ -941,14 +939,12 @@ function observeImports(map, importName, importIndex) {
941
939
  imports(entries) {
942
940
  const map = new Map(entries);
943
941
  observeImports(map, "./commons.js", 0);
944
- observeImports(map, "./error/assert.js", 9);
942
+ observeImports(map, "./error/assert.js", 11);
945
943
  },
946
944
  liveVar: {
947
945
  },
948
946
  onceVar: {
949
- alwaysThrowHandler: cells[25].alwaysThrowHandler.set,
950
- strictScopeTerminatorHandler: cells[25].strictScopeTerminatorHandler.set,
951
- strictScopeTerminator: cells[25].strictScopeTerminator.set,
947
+ makeFunctionConstructor: cells[25].makeFunctionConstructor.set,
952
948
  },
953
949
  importMeta: {},
954
950
  });
@@ -956,12 +952,17 @@ function observeImports(map, importName, importIndex) {
956
952
  imports(entries) {
957
953
  const map = new Map(entries);
958
954
  observeImports(map, "./commons.js", 0);
959
- observeImports(map, "./strict-scope-terminator.js", 25);
955
+ observeImports(map, "./make-eval-function.js", 24);
956
+ observeImports(map, "./make-function-constructor.js", 25);
957
+ observeImports(map, "./permits.js", 14);
960
958
  },
961
959
  liveVar: {
962
960
  },
963
961
  onceVar: {
964
- createSloppyGlobalsScopeTerminator: cells[26].createSloppyGlobalsScopeTerminator.set,
962
+ setGlobalObjectSymbolUnscopables: cells[26].setGlobalObjectSymbolUnscopables.set,
963
+ setGlobalObjectConstantProperties: cells[26].setGlobalObjectConstantProperties.set,
964
+ setGlobalObjectMutableProperties: cells[26].setGlobalObjectMutableProperties.set,
965
+ setGlobalObjectEvaluators: cells[26].setGlobalObjectEvaluators.set,
965
966
  },
966
967
  importMeta: {},
967
968
  });
@@ -969,12 +970,14 @@ function observeImports(map, importName, importIndex) {
969
970
  imports(entries) {
970
971
  const map = new Map(entries);
971
972
  observeImports(map, "./commons.js", 0);
972
- observeImports(map, "./error/assert.js", 9);
973
+ observeImports(map, "./error/assert.js", 11);
973
974
  },
974
975
  liveVar: {
975
976
  },
976
977
  onceVar: {
977
- makeEvalScopeKit: cells[27].makeEvalScopeKit.set,
978
+ alwaysThrowHandler: cells[27].alwaysThrowHandler.set,
979
+ strictScopeTerminatorHandler: cells[27].strictScopeTerminatorHandler.set,
980
+ strictScopeTerminator: cells[27].strictScopeTerminator.set,
978
981
  },
979
982
  importMeta: {},
980
983
  });
@@ -982,11 +985,12 @@ function observeImports(map, importName, importIndex) {
982
985
  imports(entries) {
983
986
  const map = new Map(entries);
984
987
  observeImports(map, "./commons.js", 0);
988
+ observeImports(map, "./strict-scope-terminator.js", 27);
985
989
  },
986
990
  liveVar: {
987
991
  },
988
992
  onceVar: {
989
- getSourceURL: cells[28].getSourceURL.set,
993
+ createSloppyGlobalsScopeTerminator: cells[28].createSloppyGlobalsScopeTerminator.set,
990
994
  },
991
995
  importMeta: {},
992
996
  });
@@ -994,19 +998,12 @@ function observeImports(map, importName, importIndex) {
994
998
  imports(entries) {
995
999
  const map = new Map(entries);
996
1000
  observeImports(map, "./commons.js", 0);
997
- observeImports(map, "./get-source-url.js", 28);
1001
+ observeImports(map, "./error/assert.js", 11);
998
1002
  },
999
1003
  liveVar: {
1000
1004
  },
1001
1005
  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,
1006
+ makeEvalScopeKit: cells[29].makeEvalScopeKit.set,
1010
1007
  },
1011
1008
  importMeta: {},
1012
1009
  });
@@ -1018,8 +1015,7 @@ function observeImports(map, importName, importIndex) {
1018
1015
  liveVar: {
1019
1016
  },
1020
1017
  onceVar: {
1021
- isValidIdentifierName: cells[30].isValidIdentifierName.set,
1022
- getScopeConstants: cells[30].getScopeConstants.set,
1018
+ getSourceURL: cells[30].getSourceURL.set,
1023
1019
  },
1024
1020
  importMeta: {},
1025
1021
  });
@@ -1027,12 +1023,19 @@ function observeImports(map, importName, importIndex) {
1027
1023
  imports(entries) {
1028
1024
  const map = new Map(entries);
1029
1025
  observeImports(map, "./commons.js", 0);
1030
- observeImports(map, "./scope-constants.js", 30);
1026
+ observeImports(map, "./get-source-url.js", 30);
1031
1027
  },
1032
1028
  liveVar: {
1033
1029
  },
1034
1030
  onceVar: {
1035
- makeEvaluate: cells[31].makeEvaluate.set,
1031
+ rejectHtmlComments: cells[31].rejectHtmlComments.set,
1032
+ evadeHtmlCommentTest: cells[31].evadeHtmlCommentTest.set,
1033
+ rejectImportExpressions: cells[31].rejectImportExpressions.set,
1034
+ evadeImportExpressionTest: cells[31].evadeImportExpressionTest.set,
1035
+ rejectSomeDirectEvalExpressions: cells[31].rejectSomeDirectEvalExpressions.set,
1036
+ mandatoryTransforms: cells[31].mandatoryTransforms.set,
1037
+ applyTransforms: cells[31].applyTransforms.set,
1038
+ transforms: cells[31].transforms.set,
1036
1039
  },
1037
1040
  importMeta: {},
1038
1041
  });
@@ -1040,17 +1043,12 @@ function observeImports(map, importName, importIndex) {
1040
1043
  imports(entries) {
1041
1044
  const map = new Map(entries);
1042
1045
  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
1046
  },
1050
1047
  liveVar: {
1051
1048
  },
1052
1049
  onceVar: {
1053
- makeSafeEvaluator: cells[32].makeSafeEvaluator.set,
1050
+ isValidIdentifierName: cells[32].isValidIdentifierName.set,
1051
+ getScopeConstants: cells[32].getScopeConstants.set,
1054
1052
  },
1055
1053
  importMeta: {},
1056
1054
  });
@@ -1058,11 +1056,12 @@ function observeImports(map, importName, importIndex) {
1058
1056
  imports(entries) {
1059
1057
  const map = new Map(entries);
1060
1058
  observeImports(map, "./commons.js", 0);
1059
+ observeImports(map, "./scope-constants.js", 32);
1061
1060
  },
1062
1061
  liveVar: {
1063
1062
  },
1064
1063
  onceVar: {
1065
- tameFunctionToString: cells[33].tameFunctionToString.set,
1064
+ makeEvaluate: cells[33].makeEvaluate.set,
1066
1065
  },
1067
1066
  importMeta: {},
1068
1067
  });
@@ -1070,11 +1069,17 @@ function observeImports(map, importName, importIndex) {
1070
1069
  imports(entries) {
1071
1070
  const map = new Map(entries);
1072
1071
  observeImports(map, "./commons.js", 0);
1072
+ observeImports(map, "./strict-scope-terminator.js", 27);
1073
+ observeImports(map, "./sloppy-globals-scope-terminator.js", 28);
1074
+ observeImports(map, "./eval-scope.js", 29);
1075
+ observeImports(map, "./transforms.js", 31);
1076
+ observeImports(map, "./make-evaluate.js", 33);
1077
+ observeImports(map, "./error/assert.js", 11);
1073
1078
  },
1074
1079
  liveVar: {
1075
1080
  },
1076
1081
  onceVar: {
1077
- tameDomains: cells[34].tameDomains.set,
1082
+ makeSafeEvaluator: cells[34].makeSafeEvaluator.set,
1078
1083
  },
1079
1084
  importMeta: {},
1080
1085
  });
@@ -1086,37 +1091,31 @@ function observeImports(map, importName, importIndex) {
1086
1091
  liveVar: {
1087
1092
  },
1088
1093
  onceVar: {
1089
- tameModuleSource: cells[35].tameModuleSource.set,
1094
+ tameFunctionToString: cells[35].tameFunctionToString.set,
1090
1095
  },
1091
1096
  importMeta: {},
1092
1097
  });
1093
1098
  functors[36]({
1094
1099
  imports(entries) {
1095
1100
  const map = new Map(entries);
1096
- observeImports(map, "../commons.js", 0);
1101
+ observeImports(map, "./commons.js", 0);
1097
1102
  },
1098
1103
  liveVar: {
1099
1104
  },
1100
1105
  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,
1106
+ tameDomains: cells[36].tameDomains.set,
1108
1107
  },
1109
1108
  importMeta: {},
1110
1109
  });
1111
1110
  functors[37]({
1112
1111
  imports(entries) {
1113
1112
  const map = new Map(entries);
1114
- observeImports(map, "../commons.js", 0);
1113
+ observeImports(map, "./commons.js", 0);
1115
1114
  },
1116
1115
  liveVar: {
1117
1116
  },
1118
1117
  onceVar: {
1119
- makeRejectionHandlers: cells[37].makeRejectionHandlers.set,
1118
+ tameModuleSource: cells[37].tameModuleSource.set,
1120
1119
  },
1121
1120
  importMeta: {},
1122
1121
  });
@@ -1124,14 +1123,17 @@ function observeImports(map, importName, importIndex) {
1124
1123
  imports(entries) {
1125
1124
  const map = new Map(entries);
1126
1125
  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
1126
  },
1131
1127
  liveVar: {
1132
1128
  },
1133
1129
  onceVar: {
1134
- tameConsole: cells[38].tameConsole.set,
1130
+ consoleLevelMethods: cells[38].consoleLevelMethods.set,
1131
+ consoleOtherMethods: cells[38].consoleOtherMethods.set,
1132
+ makeLoggingConsoleKit: cells[38].makeLoggingConsoleKit.set,
1133
+ pumpLogToConsole: cells[38].pumpLogToConsole.set,
1134
+ makeCausalConsole: cells[38].makeCausalConsole.set,
1135
+ defineCausalConsoleFromLogger: cells[38].defineCausalConsoleFromLogger.set,
1136
+ filterConsole: cells[38].filterConsole.set,
1135
1137
  },
1136
1138
  importMeta: {},
1137
1139
  });
@@ -1143,9 +1145,7 @@ function observeImports(map, importName, importIndex) {
1143
1145
  liveVar: {
1144
1146
  },
1145
1147
  onceVar: {
1146
- filterFileName: cells[39].filterFileName.set,
1147
- shortenCallSiteString: cells[39].shortenCallSiteString.set,
1148
- tameV8ErrorConstructor: cells[39].tameV8ErrorConstructor.set,
1148
+ makeRejectionHandlers: cells[39].makeRejectionHandlers.set,
1149
1149
  },
1150
1150
  importMeta: {},
1151
1151
  });
@@ -1153,126 +1153,119 @@ function observeImports(map, importName, importIndex) {
1153
1153
  imports(entries) {
1154
1154
  const map = new Map(entries);
1155
1155
  observeImports(map, "../commons.js", 0);
1156
- observeImports(map, "../permits.js", 12);
1157
- observeImports(map, "./tame-v8-error-constructor.js", 39);
1156
+ observeImports(map, "./assert.js", 11);
1157
+ observeImports(map, "./console.js", 38);
1158
+ observeImports(map, "./unhandled-rejection.js", 39);
1158
1159
  },
1159
1160
  liveVar: {
1160
1161
  },
1161
1162
  onceVar: {
1162
- default: cells[40].default.set,
1163
+ tameConsole: cells[40].tameConsole.set,
1163
1164
  },
1164
1165
  importMeta: {},
1165
1166
  });
1166
1167
  functors[41]({
1167
1168
  imports(entries) {
1168
1169
  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);
1170
+ observeImports(map, "../commons.js", 0);
1172
1171
  },
1173
1172
  liveVar: {
1174
1173
  },
1175
1174
  onceVar: {
1176
- makeAlias: cells[41].makeAlias.set,
1177
- load: cells[41].load.set,
1178
- loadNow: cells[41].loadNow.set,
1175
+ filterFileName: cells[41].filterFileName.set,
1176
+ shortenCallSiteString: cells[41].shortenCallSiteString.set,
1177
+ tameV8ErrorConstructor: cells[41].tameV8ErrorConstructor.set,
1179
1178
  },
1180
1179
  importMeta: {},
1181
1180
  });
1182
1181
  functors[42]({
1183
1182
  imports(entries) {
1184
1183
  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);
1184
+ observeImports(map, "../commons.js", 0);
1185
+ observeImports(map, "../permits.js", 14);
1186
+ observeImports(map, "./tame-v8-error-constructor.js", 41);
1188
1187
  },
1189
1188
  liveVar: {
1190
1189
  },
1191
1190
  onceVar: {
1192
- deferExports: cells[42].deferExports.set,
1193
- getDeferredExports: cells[42].getDeferredExports.set,
1191
+ default: cells[42].default.set,
1194
1192
  },
1195
1193
  importMeta: {},
1196
1194
  });
1197
1195
  functors[43]({
1198
1196
  imports(entries) {
1199
1197
  const map = new Map(entries);
1198
+ observeImports(map, "@endo/env-options", 3);
1200
1199
  observeImports(map, "./commons.js", 0);
1201
- observeImports(map, "./transforms.js", 29);
1202
- observeImports(map, "./make-safe-evaluator.js", 32);
1200
+ observeImports(map, "./error/assert.js", 11);
1203
1201
  },
1204
1202
  liveVar: {
1205
1203
  },
1206
1204
  onceVar: {
1207
- provideCompartmentEvaluator: cells[43].provideCompartmentEvaluator.set,
1208
- compartmentEvaluate: cells[43].compartmentEvaluate.set,
1205
+ makeAlias: cells[43].makeAlias.set,
1206
+ load: cells[43].load.set,
1207
+ loadNow: cells[43].loadNow.set,
1209
1208
  },
1210
1209
  importMeta: {},
1211
1210
  });
1212
1211
  functors[44]({
1213
1212
  imports(entries) {
1214
1213
  const map = new Map(entries);
1215
- observeImports(map, "./error/assert.js", 9);
1216
- observeImports(map, "./module-proxy.js", 42);
1214
+ observeImports(map, "./module-load.js", 43);
1217
1215
  observeImports(map, "./commons.js", 0);
1218
- observeImports(map, "./compartment-evaluate.js", 43);
1216
+ observeImports(map, "./error/assert.js", 11);
1219
1217
  },
1220
1218
  liveVar: {
1221
1219
  },
1222
1220
  onceVar: {
1223
- makeVirtualModuleInstance: cells[44].makeVirtualModuleInstance.set,
1224
- makeModuleInstance: cells[44].makeModuleInstance.set,
1221
+ deferExports: cells[44].deferExports.set,
1222
+ getDeferredExports: cells[44].getDeferredExports.set,
1225
1223
  },
1226
1224
  importMeta: {},
1227
1225
  });
1228
1226
  functors[45]({
1229
1227
  imports(entries) {
1230
1228
  const map = new Map(entries);
1231
- observeImports(map, "./error/assert.js", 9);
1232
- observeImports(map, "./module-instance.js", 44);
1233
1229
  observeImports(map, "./commons.js", 0);
1230
+ observeImports(map, "./transforms.js", 31);
1231
+ observeImports(map, "./make-safe-evaluator.js", 34);
1234
1232
  },
1235
1233
  liveVar: {
1236
1234
  },
1237
1235
  onceVar: {
1238
- link: cells[45].link.set,
1239
- instantiate: cells[45].instantiate.set,
1236
+ provideCompartmentEvaluator: cells[45].provideCompartmentEvaluator.set,
1237
+ compartmentEvaluate: cells[45].compartmentEvaluate.set,
1240
1238
  },
1241
1239
  importMeta: {},
1242
1240
  });
1243
1241
  functors[46]({
1244
1242
  imports(entries) {
1245
1243
  const map = new Map(entries);
1244
+ observeImports(map, "./error/assert.js", 11);
1245
+ observeImports(map, "./module-proxy.js", 44);
1246
1246
  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);
1247
+ observeImports(map, "./compartment-evaluate.js", 45);
1255
1248
  },
1256
1249
  liveVar: {
1257
1250
  },
1258
1251
  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,
1252
+ makeVirtualModuleInstance: cells[46].makeVirtualModuleInstance.set,
1253
+ makeModuleInstance: cells[46].makeModuleInstance.set,
1263
1254
  },
1264
1255
  importMeta: {},
1265
1256
  });
1266
1257
  functors[47]({
1267
1258
  imports(entries) {
1268
1259
  const map = new Map(entries);
1260
+ observeImports(map, "./error/assert.js", 11);
1261
+ observeImports(map, "./module-instance.js", 46);
1269
1262
  observeImports(map, "./commons.js", 0);
1270
- observeImports(map, "./compartment.js", 46);
1271
1263
  },
1272
1264
  liveVar: {
1273
1265
  },
1274
1266
  onceVar: {
1275
- getAnonymousIntrinsics: cells[47].getAnonymousIntrinsics.set,
1267
+ link: cells[47].link.set,
1268
+ instantiate: cells[47].instantiate.set,
1276
1269
  },
1277
1270
  importMeta: {},
1278
1271
  });
@@ -1280,11 +1273,22 @@ function observeImports(map, importName, importIndex) {
1280
1273
  imports(entries) {
1281
1274
  const map = new Map(entries);
1282
1275
  observeImports(map, "./commons.js", 0);
1276
+ observeImports(map, "./global-object.js", 26);
1277
+ observeImports(map, "./error/assert.js", 11);
1278
+ observeImports(map, "./permits.js", 14);
1279
+ observeImports(map, "./module-load.js", 43);
1280
+ observeImports(map, "./module-link.js", 47);
1281
+ observeImports(map, "./module-proxy.js", 44);
1282
+ observeImports(map, "./compartment-evaluate.js", 45);
1283
+ observeImports(map, "./make-safe-evaluator.js", 34);
1283
1284
  },
1284
1285
  liveVar: {
1285
1286
  },
1286
1287
  onceVar: {
1287
- tameHarden: cells[48].tameHarden.set,
1288
+ InertCompartment: cells[48].InertCompartment.set,
1289
+ CompartmentPrototype: cells[48].CompartmentPrototype.set,
1290
+ compartmentOptions: cells[48].compartmentOptions.set,
1291
+ makeCompartmentConstructor: cells[48].makeCompartmentConstructor.set,
1288
1292
  },
1289
1293
  importMeta: {},
1290
1294
  });
@@ -1292,11 +1296,12 @@ function observeImports(map, importName, importIndex) {
1292
1296
  imports(entries) {
1293
1297
  const map = new Map(entries);
1294
1298
  observeImports(map, "./commons.js", 0);
1299
+ observeImports(map, "./compartment.js", 48);
1295
1300
  },
1296
1301
  liveVar: {
1297
1302
  },
1298
1303
  onceVar: {
1299
- tameSymbolConstructor: cells[49].tameSymbolConstructor.set,
1304
+ getAnonymousIntrinsics: cells[49].getAnonymousIntrinsics.set,
1300
1305
  },
1301
1306
  importMeta: {},
1302
1307
  });
@@ -1308,8 +1313,7 @@ function observeImports(map, importName, importIndex) {
1308
1313
  liveVar: {
1309
1314
  },
1310
1315
  onceVar: {
1311
- tameFauxDataProperty: cells[50].tameFauxDataProperty.set,
1312
- tameFauxDataProperties: cells[50].tameFauxDataProperties.set,
1316
+ tameHarden: cells[50].tameHarden.set,
1313
1317
  },
1314
1318
  importMeta: {},
1315
1319
  });
@@ -1321,7 +1325,7 @@ function observeImports(map, importName, importIndex) {
1321
1325
  liveVar: {
1322
1326
  },
1323
1327
  onceVar: {
1324
- tameRegeneratorRuntime: cells[51].tameRegeneratorRuntime.set,
1328
+ tameSymbolConstructor: cells[51].tameSymbolConstructor.set,
1325
1329
  },
1326
1330
  importMeta: {},
1327
1331
  });
@@ -1333,7 +1337,8 @@ function observeImports(map, importName, importIndex) {
1333
1337
  liveVar: {
1334
1338
  },
1335
1339
  onceVar: {
1336
- shimArrayBufferTransfer: cells[52].shimArrayBufferTransfer.set,
1340
+ tameFauxDataProperty: cells[52].tameFauxDataProperty.set,
1341
+ tameFauxDataProperties: cells[52].tameFauxDataProperties.set,
1337
1342
  },
1338
1343
  importMeta: {},
1339
1344
  });
@@ -1341,88 +1346,86 @@ function observeImports(map, importName, importIndex) {
1341
1346
  imports(entries) {
1342
1347
  const map = new Map(entries);
1343
1348
  observeImports(map, "./commons.js", 0);
1344
- observeImports(map, "./error/assert.js", 9);
1345
1349
  },
1346
1350
  liveVar: {
1347
1351
  },
1348
1352
  onceVar: {
1349
- chooseReporter: cells[53].chooseReporter.set,
1350
- reportInGroup: cells[53].reportInGroup.set,
1353
+ tameRegeneratorRuntime: cells[53].tameRegeneratorRuntime.set,
1351
1354
  },
1352
1355
  importMeta: {},
1353
1356
  });
1354
1357
  functors[54]({
1355
1358
  imports(entries) {
1356
1359
  const map = new Map(entries);
1357
- observeImports(map, "@endo/env-options", 3);
1358
1360
  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
1361
  },
1386
1362
  liveVar: {
1387
1363
  },
1388
1364
  onceVar: {
1389
- repairIntrinsics: cells[54].repairIntrinsics.set,
1365
+ shimArrayBufferTransfer: cells[54].shimArrayBufferTransfer.set,
1390
1366
  },
1391
1367
  importMeta: {},
1392
1368
  });
1393
1369
  functors[55]({
1394
1370
  imports(entries) {
1395
1371
  const map = new Map(entries);
1396
- observeImports(map, "./assert-sloppy-mode.js", 1);
1397
1372
  observeImports(map, "./commons.js", 0);
1398
- observeImports(map, "./lockdown.js", 54);
1373
+ observeImports(map, "./error/assert.js", 11);
1399
1374
  },
1400
1375
  liveVar: {
1401
1376
  },
1402
1377
  onceVar: {
1378
+ chooseReporter: cells[55].chooseReporter.set,
1379
+ reportInGroup: cells[55].reportInGroup.set,
1403
1380
  },
1404
1381
  importMeta: {},
1405
1382
  });
1406
1383
  functors[56]({
1407
1384
  imports(entries) {
1408
1385
  const map = new Map(entries);
1386
+ observeImports(map, "@endo/env-options", 3);
1387
+ observeImports(map, "@endo/immutable-arraybuffer/shim-hermes.js", 5);
1409
1388
  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);
1389
+ observeImports(map, "./make-hardener.js", 12);
1390
+ observeImports(map, "./intrinsics.js", 15);
1391
+ observeImports(map, "./permits-intrinsics.js", 16);
1392
+ observeImports(map, "./tame-function-constructors.js", 17);
1393
+ observeImports(map, "./tame-date-constructor.js", 18);
1394
+ observeImports(map, "./tame-math-object.js", 19);
1395
+ observeImports(map, "./tame-regexp-constructor.js", 20);
1396
+ observeImports(map, "./enable-property-overrides.js", 22);
1397
+ observeImports(map, "./tame-locale-methods.js", 23);
1398
+ observeImports(map, "./global-object.js", 26);
1399
+ observeImports(map, "./make-safe-evaluator.js", 34);
1400
+ observeImports(map, "./permits.js", 14);
1401
+ observeImports(map, "./tame-function-tostring.js", 35);
1402
+ observeImports(map, "./tame-domains.js", 36);
1403
+ observeImports(map, "./tame-module-source.js", 37);
1404
+ observeImports(map, "./error/tame-console.js", 40);
1405
+ observeImports(map, "./error/tame-error-constructor.js", 42);
1406
+ observeImports(map, "./error/assert.js", 11);
1407
+ observeImports(map, "./get-anonymous-intrinsics.js", 49);
1408
+ observeImports(map, "./compartment.js", 48);
1409
+ observeImports(map, "./tame-harden.js", 50);
1410
+ observeImports(map, "./tame-symbol-constructor.js", 51);
1411
+ observeImports(map, "./tame-faux-data-properties.js", 52);
1412
+ observeImports(map, "./tame-regenerator-runtime.js", 53);
1413
+ observeImports(map, "./shim-arraybuffer-transfer.js", 54);
1414
+ observeImports(map, "./reporting.js", 55);
1414
1415
  },
1415
1416
  liveVar: {
1416
1417
  },
1417
1418
  onceVar: {
1419
+ repairIntrinsics: cells[56].repairIntrinsics.set,
1418
1420
  },
1419
1421
  importMeta: {},
1420
1422
  });
1421
1423
  functors[57]({
1422
1424
  imports(entries) {
1423
1425
  const map = new Map(entries);
1426
+ observeImports(map, "./assert-sloppy-mode.js", 1);
1424
1427
  observeImports(map, "./commons.js", 0);
1425
- observeImports(map, "./error/assert.js", 9);
1428
+ observeImports(map, "./lockdown.js", 56);
1426
1429
  },
1427
1430
  liveVar: {
1428
1431
  },
@@ -1434,8 +1437,10 @@ function observeImports(map, importName, importIndex) {
1434
1437
  imports(entries) {
1435
1438
  const map = new Map(entries);
1436
1439
  observeImports(map, "./commons.js", 0);
1437
- observeImports(map, "./error/console.js", 36);
1438
- observeImports(map, "./error/assert.js", 9);
1440
+ observeImports(map, "./compartment.js", 48);
1441
+ observeImports(map, "./tame-function-tostring.js", 35);
1442
+ observeImports(map, "./intrinsics.js", 15);
1443
+ observeImports(map, "./reporting.js", 55);
1439
1444
  },
1440
1445
  liveVar: {
1441
1446
  },
@@ -1446,10 +1451,35 @@ function observeImports(map, importName, importIndex) {
1446
1451
  functors[59]({
1447
1452
  imports(entries) {
1448
1453
  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);
1454
+ observeImports(map, "./commons.js", 0);
1455
+ observeImports(map, "./error/assert.js", 11);
1456
+ },
1457
+ liveVar: {
1458
+ },
1459
+ onceVar: {
1460
+ },
1461
+ importMeta: {},
1462
+ });
1463
+ functors[60]({
1464
+ imports(entries) {
1465
+ const map = new Map(entries);
1466
+ observeImports(map, "./commons.js", 0);
1467
+ observeImports(map, "./error/console.js", 38);
1468
+ observeImports(map, "./error/assert.js", 11);
1469
+ },
1470
+ liveVar: {
1471
+ },
1472
+ onceVar: {
1473
+ },
1474
+ importMeta: {},
1475
+ });
1476
+ functors[61]({
1477
+ imports(entries) {
1478
+ const map = new Map(entries);
1479
+ observeImports(map, "./src/lockdown-shim.js", 57);
1480
+ observeImports(map, "./src/compartment-shim.js", 58);
1481
+ observeImports(map, "./src/assert-shim.js", 59);
1482
+ observeImports(map, "./src/console-shim.js", 60);
1453
1483
  },
1454
1484
  liveVar: {
1455
1485
  },
@@ -1462,7 +1492,7 @@ function observeImports(map, importName, importIndex) {
1462
1492
  })([
1463
1493
  // === 0. ses ./src/commons.js ===
1464
1494
  ({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
1495
+ * Captures native intrinsics during initialization, so vetted shims
1466
1496
  * (running between initialization of SES and calling lockdown) are free to
1467
1497
  * modify the environment without compromising the integrity of SES. For
1468
1498
  * example, a vetted shim can modify Object.assign because we capture and
@@ -1472,6 +1502,8 @@ function observeImports(map, importName, importIndex) {
1472
1502
  * This pattern of use is enforced by eslint rules no-restricted-globals and
1473
1503
  * no-polymorphic-call.
1474
1504
  * We maintain the list of restricted globals in ../package.json.
1505
+ *
1506
+ * @module
1475
1507
  */
1476
1508
 
1477
1509
  /* global globalThis */
@@ -1946,6 +1978,7 @@ const Fail = (literals, ...args) => {
1946
1978
  * names used.
1947
1979
  */
1948
1980
  const makeEnvironmentCaptor = (aGlobal, dropNames = false) => {
1981
+ /** @type {string[]} */
1949
1982
  const capturedEnvironmentOptionNames = [];
1950
1983
 
1951
1984
  /**
@@ -2002,8 +2035,9 @@ const Fail = (literals, ...args) => {
2002
2035
  freeze(getEnvironmentOption);
2003
2036
 
2004
2037
  /**
2038
+ * @template {string} [T=string]
2005
2039
  * @param {string} optionName
2006
- * @returns {string[]}
2040
+ * @returns {T[]}
2007
2041
  */
2008
2042
  const getEnvironmentOptionsList = optionName => {
2009
2043
  const option = getEnvironmentOption(optionName, '');
@@ -2011,6 +2045,12 @@ const Fail = (literals, ...args) => {
2011
2045
  };
2012
2046
  freeze(getEnvironmentOptionsList);
2013
2047
 
2048
+ /**
2049
+ * @template {string} [T=string]
2050
+ * @param {string} optionName
2051
+ * @param {T} element
2052
+ * @returns {boolean}
2053
+ */
2014
2054
  const environmentOptionsListHas = (optionName, element) =>
2015
2055
  arrayIncludes(getEnvironmentOptionsList(optionName), element);
2016
2056
 
@@ -2043,7 +2083,181 @@ freeze(makeEnvironmentCaptor);
2043
2083
  ({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
2084
  })()
2045
2085
  ,
2046
- // === 4. ses ./src/error/stringify-utils.js ===
2086
+ // === 4. immutable-arraybuffer ./src/limited-pony-for-hermes.js ===
2087
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);const { apply } = Reflect;
2088
+ const { prototype: arrayBufferPrototype } = ArrayBuffer;
2089
+
2090
+ const { slice } = arrayBufferPrototype;
2091
+
2092
+ // Based on the real `../index.js` but lives within the restrictions of
2093
+ // current Hermes:
2094
+ // - No class syntax, therefore also no private fields
2095
+ // - No `ArrayBuffer.prototype.transfer`
2096
+ // - No `structuredClone`
2097
+ //
2098
+ // Within these restrictions we cannot emulate `transferToImmutable`, so
2099
+ // we omit it from the pony. We can emulate `sliceToImmutable` using
2100
+ // a different technique than used by the original. The omission of
2101
+ // `transferToImmutable` will be visible, enabling feature detection.
2102
+ // We perfectly emulate the `class` with a `function` function.
2103
+ // We perfectly emulate the private `this.#buffer` private field with
2104
+ // the encapsulated `buffers` WeakMap.
2105
+
2106
+ /**
2107
+ * Enforces that `realBuffer` is a genuine `ArrayBuffer` exotic object.
2108
+ *
2109
+ * @param {ArrayBuffer} realBuffer
2110
+ * @param {number} [start]
2111
+ * @param {number} [end]
2112
+ * @returns {ArrayBuffer}
2113
+ */
2114
+ const arrayBufferSlice = (realBuffer, start = undefined, end = undefined) =>
2115
+ apply(slice, realBuffer, [start, end]);
2116
+
2117
+ /**
2118
+ * Emulates the `this.#buffer` private field, including its use as a brand check.
2119
+ * Maps from all and only emulated Immutable ArrayBuffers to real ArrayBuffers.
2120
+ */
2121
+ const buffers = new WeakMap();
2122
+ const getBuffer = immuAB => {
2123
+ const result = buffers.get(immuAB);
2124
+ if (result) {
2125
+ return result;
2126
+ }
2127
+ throw TypeError('Not an emulated Immutable ArrayBuffer');
2128
+ };
2129
+
2130
+ // Omits `constructor` so `Array.prototype.constructor` is inherited.
2131
+ const ImmutableArrayBufferInternalPrototype = {
2132
+ __proto__: arrayBufferPrototype,
2133
+ get byteLength() {
2134
+ return getBuffer(this).byteLength;
2135
+ },
2136
+ get detached() {
2137
+ getBuffer(this); // shim brand check
2138
+ return false;
2139
+ },
2140
+ get maxByteLength() {
2141
+ // Not underlying maxByteLength, which is irrelevant
2142
+ return getBuffer(this).byteLength;
2143
+ },
2144
+ get resizable() {
2145
+ getBuffer(this); // shim brand check
2146
+ return false;
2147
+ },
2148
+ get immutable() {
2149
+ getBuffer(this); // shim brand check
2150
+ return true;
2151
+ },
2152
+ slice(start = undefined, end = undefined) {
2153
+ return arrayBufferSlice(getBuffer(this), start, end);
2154
+ },
2155
+ sliceToImmutable(start = undefined, end = undefined) {
2156
+ // eslint-disable-next-line no-use-before-define
2157
+ return sliceBufferToImmutable(getBuffer(this), start, end);
2158
+ },
2159
+ resize(_newByteLength = undefined) {
2160
+ getBuffer(this); // shim brand check
2161
+ throw TypeError('Cannot resize an immutable ArrayBuffer');
2162
+ },
2163
+ };
2164
+
2165
+ /**
2166
+ * Emulates the encapsulated `ImmutableArrayBufferInternal` class constructor
2167
+ * from the original except this function takes the `realBuffer` which its
2168
+ * result encapsulates. Security demands that this result has exclusive access
2169
+ * to the `realBuffer` it is given, which its callers must ensure.
2170
+ *
2171
+ * @param {ArrayBuffer} realBuffer
2172
+ * @returns {ArrayBuffer}
2173
+ */
2174
+ const makeImmutableArrayBufferInternal = realBuffer => {
2175
+ const result = { __proto__: ImmutableArrayBufferInternalPrototype };
2176
+ buffers.set(result, realBuffer);
2177
+ return /** @type {ArrayBuffer} */ (/** @type {unknown} */ (result));
2178
+ };
2179
+ // Since `makeImmutableArrayBufferInternal` MUST not escape,
2180
+ // this `freeze` is just belt-and-suspenders.
2181
+ Object.freeze(makeImmutableArrayBufferInternal);
2182
+
2183
+ const isBufferImmutable = buffer => buffers.has(buffer);
2184
+
2185
+ /**
2186
+ * Creates an immutable slice of the given buffer.
2187
+ * @param {ArrayBuffer} buffer The original buffer.
2188
+ * @param {number} [start] The start index.
2189
+ * @param {number} [end] The end index.
2190
+ * @returns {ArrayBuffer} The sliced immutable ArrayBuffer.
2191
+ */$h͏_once.isBufferImmutable(isBufferImmutable);
2192
+ const sliceBufferToImmutable = (
2193
+ buffer,
2194
+ start = undefined,
2195
+ end = undefined,
2196
+ ) => {
2197
+ let realBuffer = buffers.get(buffer);
2198
+ if (realBuffer === undefined) {
2199
+ realBuffer = buffer;
2200
+ }
2201
+ return makeImmutableArrayBufferInternal(
2202
+ arrayBufferSlice(realBuffer, start, end),
2203
+ );
2204
+ };$h͏_once.sliceBufferToImmutable(sliceBufferToImmutable);
2205
+ })()
2206
+ ,
2207
+ // === 5. immutable-arraybuffer ./shim-hermes.js ===
2208
+ ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';let isBufferImmutable,sliceBufferToImmutable;$h͏_imports([["./src/limited-pony-for-hermes.js", [["isBufferImmutable",[$h͏_a => (isBufferImmutable = $h͏_a)]],["sliceBufferToImmutable",[$h͏_a => (sliceBufferToImmutable = $h͏_a)]]]]]);
2209
+
2210
+
2211
+
2212
+
2213
+ const { getOwnPropertyDescriptors, defineProperties } = Object;
2214
+ const { prototype: arrayBufferPrototype } = ArrayBuffer;
2215
+
2216
+ const arrayBufferMethods = {
2217
+ /**
2218
+ * Creates an immutable slice of the given buffer.
2219
+ * @this {ArrayBuffer} buffer The original buffer.
2220
+ * @param {number} [start] The start index.
2221
+ * @param {number} [end] The end index.
2222
+ * @returns {ArrayBuffer} The sliced immutable ArrayBuffer.
2223
+ */
2224
+ sliceToImmutable(start = undefined, end = undefined) {
2225
+ return sliceBufferToImmutable(this, start, end);
2226
+ },
2227
+ get immutable() {
2228
+ return isBufferImmutable(this);
2229
+ },
2230
+ };
2231
+
2232
+ if ('transfer' in arrayBufferPrototype) {
2233
+ console.warn(
2234
+ 'Could have used the full shim, rather than the limited one for Hermes',
2235
+ );
2236
+ }
2237
+
2238
+ if ('sliceToImmutable' in arrayBufferPrototype) {
2239
+ // Modern shim practice frowns on conditional installation, at least for
2240
+ // proposals prior to stage 3. This is so changes to the proposal since
2241
+ // an old shim was distributed don't need to worry about the proposal
2242
+ // breaking old code depending on the old shim. Thus, if we detect that
2243
+ // we're about to overwrite a prior installation, we simply issue this
2244
+ // warning and continue.
2245
+ //
2246
+ // TODO, if the primordials are frozen after the prior implementation, such as
2247
+ // by `lockdown`, then this precludes overwriting as expected. However, for
2248
+ // this case, the following warning text will be confusing.
2249
+ console.warn(
2250
+ 'About to overwrite a prior implementation of "sliceToImmutable"',
2251
+ );
2252
+ }
2253
+
2254
+ defineProperties(
2255
+ arrayBufferPrototype,
2256
+ getOwnPropertyDescriptors(arrayBufferMethods),
2257
+ );
2258
+ })()
2259
+ ,
2260
+ // === 6. ses ./src/error/stringify-utils.js ===
2047
2261
  ({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
2262
 
2049
2263
 
@@ -2240,7 +2454,7 @@ const bestEffortStringify = (payload, spaces = undefined) => {
2240
2454
  freeze(bestEffortStringify);
2241
2455
  })()
2242
2456
  ,
2243
- // === 5. ses ./src/error/types.js ===
2457
+ // === 7. ses ./src/error/types.js ===
2244
2458
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);// @ts-check
2245
2459
 
2246
2460
  /** @import {GenericErrorConstructor, AssertMakeErrorOptions, DetailsToken, StringablePayload} from '../../types.js' */
@@ -2302,7 +2516,7 @@ freeze(bestEffortStringify);
2302
2516
  */
2303
2517
  })()
2304
2518
  ,
2305
- // === 6. ses ./src/error/internal-types.js ===
2519
+ // === 8. ses ./src/error/internal-types.js ===
2306
2520
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);// @ts-check
2307
2521
 
2308
2522
  /**
@@ -2403,7 +2617,7 @@ freeze(bestEffortStringify);
2403
2617
  */
2404
2618
  })()
2405
2619
  ,
2406
- // === 7. ses ./src/make-lru-cachemap.js ===
2620
+ // === 9. ses ./src/make-lru-cachemap.js ===
2407
2621
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);// @ts-check
2408
2622
  /* eslint-disable @endo/no-polymorphic-call */
2409
2623
 
@@ -2627,7 +2841,7 @@ const spliceOut = cell => {
2627
2841
  freeze(makeLRUCacheMap);
2628
2842
  })()
2629
2843
  ,
2630
- // === 8. ses ./src/error/note-log-args.js ===
2844
+ // === 10. ses ./src/error/note-log-args.js ===
2631
2845
  ({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
2846
 
2633
2847
 
@@ -2706,7 +2920,7 @@ const defaultArgsPerErrorBudget = 100;
2706
2920
  freeze(makeNoteLogArgsArrayKit);
2707
2921
  })()
2708
2922
  ,
2709
- // === 9. ses ./src/error/assert.js ===
2923
+ // === 11. ses ./src/error/assert.js ===
2710
2924
  ({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
2925
 
2712
2926
 
@@ -3284,7 +3498,7 @@ const assert = makeAssert();$h͏_once.assert(assert);
3284
3498
  const assertEqual = assert.equal;$h͏_once.assertEqual(assertEqual);
3285
3499
  })()
3286
3500
  ,
3287
- // === 10. ses ./src/make-hardener.js ===
3501
+ // === 12. ses ./src/make-hardener.js ===
3288
3502
  ({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
3503
 
3290
3504
 
@@ -3562,7 +3776,7 @@ const freezeTypedArray = array => {
3562
3776
  };$h͏_once.makeHardener(makeHardener);
3563
3777
  })()
3564
3778
  ,
3565
- // === 11. ses ./src/cauterize-property.js ===
3779
+ // === 13. ses ./src/cauterize-property.js ===
3566
3780
  ({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
3781
 
3568
3782
  /**
@@ -3634,7 +3848,7 @@ const freezeTypedArray = array => {
3634
3848
  };$h͏_once.cauterizeProperty(cauterizeProperty);
3635
3849
  })()
3636
3850
  ,
3637
- // === 12. ses ./src/permits.js ===
3851
+ // === 14. ses ./src/permits.js ===
3638
3852
  ({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
3853
 
3640
3854
 
@@ -3643,12 +3857,14 @@ const freezeTypedArray = array => {
3643
3857
  /** @import {GenericErrorConstructor} from '../types.js' */
3644
3858
 
3645
3859
  /**
3646
- * @module Exports {@code permits}, a recursively defined
3860
+ * Exports {@code permits}, a recursively defined
3647
3861
  * JSON record enumerating all intrinsics and their properties
3648
3862
  * according to ECMA specs.
3649
3863
  *
3650
3864
  * @author JF Paradis
3651
3865
  * @author Mark S. Miller
3866
+ *
3867
+ * @module
3652
3868
  */
3653
3869
 
3654
3870
  /**
@@ -4993,6 +5209,35 @@ const CommonMath = {
4993
5209
  // https://github.com/tc39/proposal-arraybuffer-transfer
4994
5210
  transferToFixedLength: fn,
4995
5211
  detached: getter,
5212
+ // https://github.com/endojs/endo/pull/2309#issuecomment-2155513240
5213
+ // to be proposed
5214
+ transferToImmutable: fn,
5215
+ sliceToImmutable: fn,
5216
+ immutable: getter,
5217
+ },
5218
+
5219
+ // If this exists, it is purely an artifact of how we currently shim
5220
+ // `transferToImmutable`. As natively implemented, there would be no
5221
+ // such extra prototype.
5222
+ '%ImmutableArrayBufferPrototype%': {
5223
+ '[[Proto]]': '%ArrayBufferPrototype%',
5224
+ byteLength: getter,
5225
+ slice: fn,
5226
+ // See https://github.com/endojs/endo/tree/master/packages/immutable-arraybuffer#purposeful-violation
5227
+ '@@toStringTag': 'string',
5228
+ // See https://github.com/tc39/proposal-resizablearraybuffer
5229
+ transfer: fn,
5230
+ resize: fn,
5231
+ resizable: getter,
5232
+ maxByteLength: getter,
5233
+ // https://github.com/tc39/proposal-arraybuffer-transfer
5234
+ transferToFixedLength: fn,
5235
+ detached: getter,
5236
+ // https://github.com/endojs/endo/pull/2309#issuecomment-2155513240
5237
+ // to be proposed
5238
+ transferToImmutable: fn,
5239
+ sliceToImmutable: fn,
5240
+ immutable: getter,
4996
5241
  },
4997
5242
 
4998
5243
  // SharedArrayBuffer Objects
@@ -5367,7 +5612,7 @@ const CommonMath = {
5367
5612
  };$h͏_once.permitted(permitted);
5368
5613
  })()
5369
5614
  ,
5370
- // === 13. ses ./src/intrinsics.js ===
5615
+ // === 15. ses ./src/intrinsics.js ===
5371
5616
  ({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
5617
 
5373
5618
 
@@ -5562,7 +5807,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
5562
5807
  };$h͏_once.getGlobalIntrinsics(getGlobalIntrinsics);
5563
5808
  })()
5564
5809
  ,
5565
- // === 14. ses ./src/permits-intrinsics.js ===
5810
+ // === 16. ses ./src/permits-intrinsics.js ===
5566
5811
  ({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
5812
 
5568
5813
 
@@ -5856,7 +6101,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
5856
6101
  }$h͏_once.default( removeUnpermittedIntrinsics);
5857
6102
  })()
5858
6103
  ,
5859
- // === 15. ses ./src/tame-function-constructors.js ===
6104
+ // === 17. ses ./src/tame-function-constructors.js ===
5860
6105
  ({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
6106
 
5862
6107
 
@@ -5999,7 +6244,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
5999
6244
  }$h͏_once.default( tameFunctionConstructors);
6000
6245
  })()
6001
6246
  ,
6002
- // === 16. ses ./src/tame-date-constructor.js ===
6247
+ // === 18. ses ./src/tame-date-constructor.js ===
6003
6248
  ({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
6249
 
6005
6250
 
@@ -6129,7 +6374,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6129
6374
  }$h͏_once.default( tameDateConstructor);
6130
6375
  })()
6131
6376
  ,
6132
- // === 17. ses ./src/tame-math-object.js ===
6377
+ // === 19. ses ./src/tame-math-object.js ===
6133
6378
  ({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
6379
 
6135
6380
 
@@ -6173,7 +6418,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6173
6418
  }$h͏_once.default( tameMathObject);
6174
6419
  })()
6175
6420
  ,
6176
- // === 18. ses ./src/tame-regexp-constructor.js ===
6421
+ // === 20. ses ./src/tame-regexp-constructor.js ===
6177
6422
  ({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
6423
 
6179
6424
 
@@ -6184,9 +6429,6 @@ function sampleGlobals(globalObject, newPropertyNames) {
6184
6429
 
6185
6430
 
6186
6431
  function tameRegExpConstructor(regExpTaming = 'safe') {
6187
- if (regExpTaming !== 'safe' && regExpTaming !== 'unsafe') {
6188
- throw TypeError(`unrecognized regExpTaming ${regExpTaming}`);
6189
- }
6190
6432
  const RegExpPrototype = FERAL_REG_EXP.prototype;
6191
6433
 
6192
6434
  const makeRegExpConstructor = (_ = {}) => {
@@ -6244,17 +6486,19 @@ function sampleGlobals(globalObject, newPropertyNames) {
6244
6486
  }$h͏_once.default( tameRegExpConstructor);
6245
6487
  })()
6246
6488
  ,
6247
- // === 19. ses ./src/enablements.js ===
6489
+ // === 21. ses ./src/enablements.js ===
6248
6490
  ({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
6491
 
6250
6492
  /**
6251
- * @module Exports {@code enablements}, a recursively defined
6493
+ * Exports {@code enablements}, a recursively defined
6252
6494
  * JSON record defining the optimum set of intrinsics properties
6253
6495
  * that need to be "repaired" before hardening is applied on
6254
6496
  * enviromments subject to the override mistake.
6255
6497
  *
6256
6498
  * @author JF Paradis
6257
6499
  * @author Mark S. Miller
6500
+ *
6501
+ * @module
6258
6502
  */
6259
6503
 
6260
6504
  /**
@@ -6489,7 +6733,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6489
6733
  };$h͏_once.severeEnablements(severeEnablements);
6490
6734
  })()
6491
6735
  ,
6492
- // === 20. ses ./src/enable-property-overrides.js ===
6736
+ // === 22. ses ./src/enable-property-overrides.js ===
6493
6737
  ({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
6738
 
6495
6739
 
@@ -6703,7 +6947,7 @@ function sampleGlobals(globalObject, newPropertyNames) {
6703
6947
  }$h͏_once.default( enablePropertyOverrides);
6704
6948
  })()
6705
6949
  ,
6706
- // === 21. ses ./src/tame-locale-methods.js ===
6950
+ // === 23. ses ./src/tame-locale-methods.js ===
6707
6951
  ({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
6952
 
6709
6953
 
@@ -6750,9 +6994,6 @@ const nonLocaleCompare = tamedMethods.localeCompare;
6750
6994
  const numberToString = tamedMethods.toString;
6751
6995
 
6752
6996
  function tameLocaleMethods(intrinsics, localeTaming = 'safe') {
6753
- if (localeTaming !== 'safe' && localeTaming !== 'unsafe') {
6754
- throw TypeError(`unrecognized localeTaming ${localeTaming}`);
6755
- }
6756
6997
  if (localeTaming === 'unsafe') {
6757
6998
  return;
6758
6999
  }
@@ -6787,15 +7028,16 @@ const numberToString = tamedMethods.toString;
6787
7028
  }$h͏_once.default( tameLocaleMethods);
6788
7029
  })()
6789
7030
  ,
6790
- // === 22. ses ./src/make-eval-function.js ===
7031
+ // === 24. ses ./src/make-eval-function.js ===
6791
7032
  ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);/**
6792
7033
  * makeEvalFunction()
6793
7034
  * A safe version of the native eval function which relies on
6794
- * the safety of safeEvaluate for confinement.
7035
+ * the safety of `safe-eval` for confinement, unless `no-eval`
7036
+ * is specified (then a TypeError is thrown on use).
6795
7037
  *
6796
- * @param {Function} safeEvaluate
7038
+ * @param {Function} evaluator
6797
7039
  */
6798
- const makeEvalFunction = safeEvaluate => {
7040
+ const makeEvalFunction = evaluator => {
6799
7041
  // We use the concise method syntax to create an eval without a
6800
7042
  // [[Construct]] behavior (such that the invocation "new eval()" throws
6801
7043
  // TypeError: eval is not a constructor"), but which still accepts a
@@ -6809,7 +7051,7 @@ const numberToString = tamedMethods.toString;
6809
7051
  // rule. Track.
6810
7052
  return source;
6811
7053
  }
6812
- return safeEvaluate(source);
7054
+ return evaluator(source);
6813
7055
  },
6814
7056
  }.eval;
6815
7057
 
@@ -6817,7 +7059,7 @@ const numberToString = tamedMethods.toString;
6817
7059
  };$h͏_once.makeEvalFunction(makeEvalFunction);
6818
7060
  })()
6819
7061
  ,
6820
- // === 23. ses ./src/make-function-constructor.js ===
7062
+ // === 25. ses ./src/make-function-constructor.js ===
6821
7063
  ({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
7064
 
6823
7065
 
@@ -6832,9 +7074,10 @@ const { Fail } = assert;
6832
7074
  /*
6833
7075
  * makeFunctionConstructor()
6834
7076
  * A safe version of the native Function which relies on
6835
- * the safety of safeEvaluate for confinement.
7077
+ * the safety of `safe-eval` for confinement, unless `no-eval`
7078
+ * is specified (then a TypeError is thrown on use).
6836
7079
  */
6837
- const makeFunctionConstructor = safeEvaluate => {
7080
+ const makeFunctionConstructor = evaluator => {
6838
7081
  // Define an unused parameter to ensure Function.length === 1
6839
7082
  const newFunction = function Function(_body) {
6840
7083
  // Sanitize all parameters at the entry point.
@@ -6874,7 +7117,7 @@ const { Fail } = assert;
6874
7117
  // TODO: since we create an anonymous function, the 'this' value
6875
7118
  // isn't bound to the global object as per specs, but set as undefined.
6876
7119
  const src = `(function anonymous(${parameters}\n) {\n${bodyText}\n})`;
6877
- return safeEvaluate(src);
7120
+ return evaluator(src);
6878
7121
  };
6879
7122
 
6880
7123
  defineProperties(newFunction, {
@@ -6892,13 +7135,13 @@ const { Fail } = assert;
6892
7135
  getPrototypeOf(FERAL_FUNCTION) === FERAL_FUNCTION.prototype ||
6893
7136
  Fail`Function prototype is the same accross compartments`;
6894
7137
  getPrototypeOf(newFunction) === FERAL_FUNCTION.prototype ||
6895
- Fail`Function constructor prototype is the same accross compartments`;
7138
+ Fail`Function constructor prototype is the same across compartments`;
6896
7139
 
6897
7140
  return newFunction;
6898
7141
  };$h͏_once.makeFunctionConstructor(makeFunctionConstructor);
6899
7142
  })()
6900
7143
  ,
6901
- // === 24. ses ./src/global-object.js ===
7144
+ // === 26. ses ./src/global-object.js ===
6902
7145
  ({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
7146
 
6904
7147
 
@@ -7076,7 +7319,7 @@ const { Fail } = assert;
7076
7319
  };$h͏_once.setGlobalObjectEvaluators(setGlobalObjectEvaluators);
7077
7320
  })()
7078
7321
  ,
7079
- // === 25. ses ./src/strict-scope-terminator.js ===
7322
+ // === 27. ses ./src/strict-scope-terminator.js ===
7080
7323
  ({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
7324
 
7082
7325
 
@@ -7178,7 +7421,7 @@ const scopeProxyHandlerProperties = {
7178
7421
  );$h͏_once.strictScopeTerminator(strictScopeTerminator);
7179
7422
  })()
7180
7423
  ,
7181
- // === 26. ses ./src/sloppy-globals-scope-terminator.js ===
7424
+ // === 28. ses ./src/sloppy-globals-scope-terminator.js ===
7182
7425
  ({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
7426
 
7184
7427
 
@@ -7242,7 +7485,7 @@ const objTarget = freeze({ __proto__: null });
7242
7485
  freeze(createSloppyGlobalsScopeTerminator);
7243
7486
  })()
7244
7487
  ,
7245
- // === 27. ses ./src/eval-scope.js ===
7488
+ // === 29. ses ./src/eval-scope.js ===
7246
7489
  ({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
7490
 
7248
7491
 
@@ -7334,7 +7577,7 @@ const { Fail } = assert;
7334
7577
  };$h͏_once.makeEvalScopeKit(makeEvalScopeKit);
7335
7578
  })()
7336
7579
  ,
7337
- // === 28. ses ./src/get-source-url.js ===
7580
+ // === 30. ses ./src/get-source-url.js ===
7338
7581
  ({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
7582
 
7340
7583
  // Captures a key and value of the form #key=value or @key=value
@@ -7387,7 +7630,7 @@ const sourceMetaEntriesRegExp = new FERAL_REG_EXP(
7387
7630
  };$h͏_once.getSourceURL(getSourceURL);
7388
7631
  })()
7389
7632
  ,
7390
- // === 29. ses ./src/transforms.js ===
7633
+ // === 31. ses ./src/transforms.js ===
7391
7634
  ({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
7635
 
7393
7636
 
@@ -7657,7 +7900,7 @@ $h͏_once.applyTransforms(applyTransforms);const transforms=freeze({
7657
7900
  });$h͏_once.transforms(transforms);
7658
7901
  })()
7659
7902
  ,
7660
- // === 30. ses ./src/scope-constants.js ===
7903
+ // === 32. ses ./src/scope-constants.js ===
7661
7904
  ({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
7905
 
7663
7906
 
@@ -7840,7 +8083,7 @@ function isImmutableDataProperty(obj, name) {
7840
8083
  };$h͏_once.getScopeConstants(getScopeConstants);
7841
8084
  })()
7842
8085
  ,
7843
- // === 31. ses ./src/make-evaluate.js ===
8086
+ // === 33. ses ./src/make-evaluate.js ===
7844
8087
  ({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
8088
 
7846
8089
 
@@ -7953,7 +8196,7 @@ function buildOptimizer(constants, name) {
7953
8196
  };$h͏_once.makeEvaluate(makeEvaluate);
7954
8197
  })()
7955
8198
  ,
7956
- // === 32. ses ./src/make-safe-evaluator.js ===
8199
+ // === 34. ses ./src/make-safe-evaluator.js ===
7957
8200
  ({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
8201
 
7959
8202
 
@@ -8068,7 +8311,7 @@ const { Fail } = assert;
8068
8311
  };$h͏_once.makeSafeEvaluator(makeSafeEvaluator);
8069
8312
  })()
8070
8313
  ,
8071
- // === 33. ses ./src/tame-function-tostring.js ===
8314
+ // === 35. ses ./src/tame-function-tostring.js ===
8072
8315
  ({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
8316
 
8074
8317
 
@@ -8121,7 +8364,7 @@ let markVirtualizedNativeFunction;
8121
8364
  };$h͏_once.tameFunctionToString(tameFunctionToString);
8122
8365
  })()
8123
8366
  ,
8124
- // === 34. ses ./src/tame-domains.js ===
8367
+ // === 36. ses ./src/tame-domains.js ===
8125
8368
  ({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
8369
 
8127
8370
 
@@ -8132,10 +8375,6 @@ let markVirtualizedNativeFunction;
8132
8375
 
8133
8376
 
8134
8377
  function tameDomains(domainTaming = 'safe') {
8135
- if (domainTaming !== 'safe' && domainTaming !== 'unsafe') {
8136
- throw TypeError(`unrecognized domainTaming ${domainTaming}`);
8137
- }
8138
-
8139
8378
  if (domainTaming === 'unsafe') {
8140
8379
  return;
8141
8380
  }
@@ -8169,7 +8408,7 @@ let markVirtualizedNativeFunction;
8169
8408
  }
8170
8409
  })()
8171
8410
  ,
8172
- // === 35. ses ./src/tame-module-source.js ===
8411
+ // === 37. ses ./src/tame-module-source.js ===
8173
8412
  ({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
8413
 
8175
8414
 
@@ -8223,7 +8462,7 @@ let markVirtualizedNativeFunction;
8223
8462
  };$h͏_once.tameModuleSource(tameModuleSource);
8224
8463
  })()
8225
8464
  ,
8226
- // === 36. ses ./src/error/console.js ===
8465
+ // === 38. ses ./src/error/console.js ===
8227
8466
  ({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
8467
 
8229
8468
 
@@ -8767,7 +9006,7 @@ freeze(defineCausalConsoleFromLogger);
8767
9006
  freeze(filterConsole);
8768
9007
  })()
8769
9008
  ,
8770
- // === 37. ses ./src/error/unhandled-rejection.js ===
9009
+ // === 39. ses ./src/error/unhandled-rejection.js ===
8771
9010
  ({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
9011
 
8773
9012
 
@@ -8892,7 +9131,7 @@ freeze(filterConsole);
8892
9131
  };$h͏_once.makeRejectionHandlers(makeRejectionHandlers);
8893
9132
  })()
8894
9133
  ,
8895
- // === 38. ses ./src/error/tame-console.js ===
9134
+ // === 40. ses ./src/error/tame-console.js ===
8896
9135
  ({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
9136
 
8898
9137
 
@@ -8936,10 +9175,6 @@ const wrapLogger = (logger, thisArg) =>
8936
9175
  unhandledRejectionTrapping = 'report',
8937
9176
  optGetStackString = undefined,
8938
9177
  ) => {
8939
- consoleTaming === 'safe' ||
8940
- consoleTaming === 'unsafe' ||
8941
- failFast(`unrecognized consoleTaming ${consoleTaming}`);
8942
-
8943
9178
  let loggedErrorHandler;
8944
9179
  if (optGetStackString === undefined) {
8945
9180
  loggedErrorHandler = defaultHandler;
@@ -9096,7 +9331,7 @@ const wrapLogger = (logger, thisArg) =>
9096
9331
  };$h͏_once.tameConsole(tameConsole);
9097
9332
  })()
9098
9333
  ,
9099
- // === 39. ses ./src/error/tame-v8-error-constructor.js ===
9334
+ // === 41. ses ./src/error/tame-v8-error-constructor.js ===
9100
9335
  ({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
9336
 
9102
9337
 
@@ -9170,10 +9405,9 @@ const FILENAME_NODE_DEPENDENTS_CENSOR = /\/node_modules\//;
9170
9405
  // stack traces.
9171
9406
  const FILENAME_NODE_INTERNALS_CENSOR = /^(?:node:)?internal\//;
9172
9407
 
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$/;
9408
+ // Frames within SES `assert.js` should be dropped from concise stack traces, as
9409
+ // these are just steps towards creating the error object in question.
9410
+ const FILENAME_ASSERT_CENSOR = /\/packages\/ses\/src\/error\/assert\.js$/;
9177
9411
 
9178
9412
  // Frames within the `eventual-send` shim should be dropped so that concise
9179
9413
  // deep stacks omit the internals of the eventual-sending mechanism causing
@@ -9182,6 +9416,10 @@ const FILENAME_ASSERT_CENSOR = /\/packages\/ses\/src\/error\/assert.js$/;
9182
9416
  // Endo, so this rule will be of general interest.
9183
9417
  const FILENAME_EVENTUAL_SEND_CENSOR = /\/packages\/eventual-send\/src\//;
9184
9418
 
9419
+ // Frames within the `ses-ava` package should be dropped from concise stack
9420
+ // traces, as they just support exposing error details to AVA.
9421
+ const FILENAME_SES_AVA_CENSOR = /\/packages\/ses-ava\/src\/ses-ava-test\.js$/;
9422
+
9185
9423
  // Any stack frame whose `fileName` matches any of these censor patterns
9186
9424
  // will be omitted from concise stacks.
9187
9425
  // TODO Enable users to configure FILENAME_CENSORS via `lockdown` options.
@@ -9190,6 +9428,7 @@ const FILENAME_CENSORS = [
9190
9428
  FILENAME_NODE_INTERNALS_CENSOR,
9191
9429
  FILENAME_ASSERT_CENSOR,
9192
9430
  FILENAME_EVENTUAL_SEND_CENSOR,
9431
+ FILENAME_SES_AVA_CENSOR,
9193
9432
  ];
9194
9433
 
9195
9434
  // Should a stack frame with this as its fileName be included in a concise
@@ -9213,34 +9452,64 @@ const FILENAME_CENSORS = [
9213
9452
  // likely url-path prefix, ending in a `/.../` should get dropped.
9214
9453
  // Anything to the left of the likely path text is kept.
9215
9454
  // Everything to the right of `/.../` is kept. Thus
9216
- // `'Object.bar (/vat-v1/.../eventual-send/test/test-deep-send.js:13:21)'`
9455
+ // `'Object.bar (/vat-v1/.../eventual-send/test/deep-send.test.js:13:21)'`
9456
+ // simplifies to
9457
+ // `'Object.bar (eventual-send/test/deep-send.test.js:13:21)'`.
9458
+ //
9459
+ // See thread starting at
9460
+ // https://github.com/Agoric/agoric-sdk/issues/2326#issuecomment-773020389
9461
+ $h͏_once.filterFileName(filterFileName);const CALLSITE_ELLIPSIS_PATTERN1=/^((?:.*[( ])?)[:/\w_-]*\/\.\.\.\/(.+)$/;
9462
+
9463
+ // The ad-hoc rule of the current pattern is that any likely-file-path or
9464
+ // likely url-path prefix consisting of `.../` should get dropped.
9465
+ // Anything to the left of the likely path text is kept.
9466
+ // Everything to the right of `.../` is kept. Thus
9467
+ // `'Object.bar (.../eventual-send/test/deep-send.test.js:13:21)'`
9217
9468
  // simplifies to
9218
- // `'Object.bar (eventual-send/test/test-deep-send.js:13:21)'`.
9469
+ // `'Object.bar (eventual-send/test/deep-send.test.js:13:21)'`.
9219
9470
  //
9220
9471
  // See thread starting at
9221
9472
  // https://github.com/Agoric/agoric-sdk/issues/2326#issuecomment-773020389
9222
- $h͏_once.filterFileName(filterFileName);const CALLSITE_ELLIPSES_PATTERN=/^((?:.*[( ])?)[:/\w_-]*\/\.\.\.\/(.+)$/;
9473
+ const CALLSITE_ELLIPSIS_PATTERN2 = /^((?:.*[( ])?)\.\.\.\/(.+)$/;
9223
9474
 
9224
9475
  // The ad-hoc rule of the current pattern is that any likely-file-path or
9225
9476
  // likely url-path prefix, ending in a `/` and prior to `package/` should get
9226
9477
  // dropped.
9227
9478
  // Anything to the left of the likely path prefix text is kept. `package/` and
9228
9479
  // 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)'`
9480
+ // `'Object.bar (/Users/markmiller/src/ongithub/agoric/agoric-sdk/packages/eventual-send/test/deep-send.test.js:13:21)'`
9230
9481
  // simplifies to
9231
- // `'Object.bar (packages/eventual-send/test/test-deep-send.js:13:21)'`.
9482
+ // `'Object.bar (packages/eventual-send/test/deep-send.test.js:13:21)'`.
9232
9483
  // Note that `/packages/` is a convention for monorepos encouraged by
9233
9484
  // lerna.
9234
9485
  const CALLSITE_PACKAGES_PATTERN = /^((?:.*[( ])?)[:/\w_-]*\/(packages\/.+)$/;
9235
9486
 
9487
+ // The ad-hoc rule of the current pattern is that any likely-file-path or
9488
+ // likely url-path prefix of the form `file://` but not `file:///` gets
9489
+ // dropped.
9490
+ // Anything to the left of the likely path prefix text is kept. Everything to
9491
+ // the right of `file://` is kept. Thus
9492
+ // `'Object.bar (file:///Users/markmiller/src/ongithub/endojs/endo/packages/eventual-send/test/deep-send.test.js:13:21)'` is unchanged but
9493
+ // `'Object.bar (file://test/deep-send.test.js:13:21)'`
9494
+
9495
+ // simplifies to
9496
+ // `'Object.bar (test/deep-send.test.js:13:21)'`.
9497
+ // The reason is that `file:///` usually precedes an absolute path which is
9498
+ // clickable without removing the `file:///`, whereas `file://` usually precedes
9499
+ // a relative path which, for whatever vscode reason, is not clickable until the
9500
+ // `file://` is removed.
9501
+ const CALLSITE_FILE_2SLASH_PATTERN = /^((?:.*[( ])?)file:\/\/([^/].*)$/;
9502
+
9236
9503
  // The use of these callSite patterns below assumes that any match will bind
9237
9504
  // capture groups containing the parts of the original string we want
9238
9505
  // to keep. The parts outside those capture groups will be dropped from concise
9239
9506
  // stacks.
9240
9507
  // TODO Enable users to configure CALLSITE_PATTERNS via `lockdown` options.
9241
9508
  const CALLSITE_PATTERNS = [
9242
- CALLSITE_ELLIPSES_PATTERN,
9509
+ CALLSITE_ELLIPSIS_PATTERN1,
9510
+ CALLSITE_ELLIPSIS_PATTERN2,
9243
9511
  CALLSITE_PACKAGES_PATTERN,
9512
+ CALLSITE_FILE_2SLASH_PATTERN,
9244
9513
  ];
9245
9514
 
9246
9515
  // For a stack frame that should be included in a concise stack trace, if
@@ -9248,6 +9517,9 @@ const CALLSITE_PATTERNS = [
9248
9517
  // possibly-shorter stringified stack frame that should be shown instead.
9249
9518
  // Exported only so it can be unit tested.
9250
9519
  // TODO Move so that it applies not just to v8.
9520
+ /**
9521
+ * @param {string} callSiteString
9522
+ */
9251
9523
  const shortenCallSiteString = callSiteString => {
9252
9524
  for (const filter of CALLSITE_PATTERNS) {
9253
9525
  const match = regexpExec(filter, callSiteString);
@@ -9274,18 +9546,24 @@ const CALLSITE_PATTERNS = [
9274
9546
 
9275
9547
  const originalCaptureStackTrace = OriginalError.captureStackTrace;
9276
9548
 
9549
+ const omitFrames =
9550
+ stackFiltering === 'concise' || stackFiltering === 'omit-frames';
9551
+
9552
+ const shortenPaths =
9553
+ stackFiltering === 'concise' || stackFiltering === 'shorten-paths';
9554
+
9277
9555
  // const callSiteFilter = _callSite => true;
9278
9556
  const callSiteFilter = callSite => {
9279
- if (stackFiltering === 'verbose') {
9280
- return true;
9557
+ if (omitFrames) {
9558
+ // eslint-disable-next-line @endo/no-polymorphic-call
9559
+ return filterFileName(callSite.getFileName());
9281
9560
  }
9282
- // eslint-disable-next-line @endo/no-polymorphic-call
9283
- return filterFileName(callSite.getFileName());
9561
+ return true;
9284
9562
  };
9285
9563
 
9286
9564
  const callSiteStringifier = callSite => {
9287
9565
  let callSiteString = `${callSite}`;
9288
- if (stackFiltering === 'concise') {
9566
+ if (shortenPaths) {
9289
9567
  callSiteString = shortenCallSiteString(callSiteString);
9290
9568
  }
9291
9569
  return `\n at ${callSiteString}`;
@@ -9442,9 +9720,8 @@ const CALLSITE_PATTERNS = [
9442
9720
  };$h͏_once.tameV8ErrorConstructor(tameV8ErrorConstructor);
9443
9721
  })()
9444
9722
  ,
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
-
9723
+ // === 42. ses ./src/error/tame-error-constructor.js ===
9724
+ ({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
9725
 
9449
9726
 
9450
9727
 
@@ -9481,16 +9758,6 @@ let initialGetStackString = tamedMethods.getStackString;
9481
9758
  errorTaming = 'safe',
9482
9759
  stackFiltering = 'concise',
9483
9760
  ) {
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
9761
  const ErrorPrototype = FERAL_ERROR.prototype;
9495
9762
 
9496
9763
  const { captureStackTrace: originalCaptureStackTrace } = FERAL_ERROR;
@@ -9740,7 +10007,7 @@ let initialGetStackString = tamedMethods.getStackString;
9740
10007
  }$h͏_once.default( tameErrorConstructor);
9741
10008
  })()
9742
10009
  ,
9743
- // === 41. ses ./src/module-load.js ===
10010
+ // === 43. ses ./src/module-load.js ===
9744
10011
  ({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
10012
 
9746
10013
 
@@ -10250,18 +10517,17 @@ const memoizedLoadWithErrorAnnotation = (
10250
10517
  return moduleLoading;
10251
10518
  };
10252
10519
 
10253
- const asyncJobQueue = () => {
10520
+ const asyncJobQueue = (errors = []) => {
10254
10521
  /** @type {Set<Promise<undefined>>} */
10255
10522
  const pendingJobs = new Set();
10256
- /** @type {Array<Error>} */
10257
- const errors = [];
10258
10523
 
10259
10524
  /**
10260
10525
  * Enqueues a job that starts immediately but won't be awaited until drainQueue is called.
10261
10526
  *
10262
- * @template {any[]} T
10263
- * @param {(...args: T)=>Promise<*>} func
10264
- * @param {T} args
10527
+ * @template {(...args: any[]) => Promise<void>} F
10528
+ * @param {F} func - An async function to execute
10529
+ * @param {Parameters<F>} args - Arguments to pass to the function
10530
+ * @returns {void}
10265
10531
  */
10266
10532
  const enqueueJob = (func, args) => {
10267
10533
  setAdd(
@@ -10273,8 +10539,6 @@ const asyncJobQueue = () => {
10273
10539
  };
10274
10540
  /**
10275
10541
  * Sequentially awaits pending jobs and returns an array of errors
10276
- *
10277
- * @returns {Promise<Array<Error>>}
10278
10542
  */
10279
10543
  const drainQueue =async function(){
10280
10544
  await null;
@@ -10282,9 +10546,42 @@ const asyncJobQueue = () => {
10282
10546
  // eslint-disable-next-line no-await-in-loop
10283
10547
  await job;
10284
10548
  }
10285
- return errors;
10286
10549
  };
10287
- return { enqueueJob, drainQueue };
10550
+ return { enqueueJob, drainQueue, errors };
10551
+ };
10552
+
10553
+ const syncJobQueue = (errors = []) => {
10554
+ let current = [];
10555
+ let next = [];
10556
+
10557
+ /**
10558
+ * Enqueues a job
10559
+ *
10560
+ * @template {(...args: any[]) => void} F
10561
+ * @param {F} func - An async function to execute
10562
+ * @param {Parameters<F>} args - Arguments to pass to the function
10563
+ * @returns {void}
10564
+ */
10565
+ const enqueueJob = (func, args) => {
10566
+ arrayPush(next, [func, args]);
10567
+ };
10568
+ const drainQueue = () => {
10569
+ // Attention: load bearing flow order. Calling another enqueued function in the
10570
+ // synchronous usecase must happen after the one that enqueued it has finished.
10571
+ // Jobs enqueued in one pass do not interleave with jobs resulting from them.
10572
+ // It's necessary for efficient memoization and to break cycles.
10573
+ for (const [func, args] of current) {
10574
+ try {
10575
+ func(...args);
10576
+ } catch (error) {
10577
+ arrayPush(errors, error);
10578
+ }
10579
+ }
10580
+ current = next;
10581
+ next = [];
10582
+ if (current.length > 0) drainQueue();
10583
+ };
10584
+ return { enqueueJob, drainQueue, errors };
10288
10585
  };
10289
10586
 
10290
10587
  /**
@@ -10296,7 +10593,8 @@ const throwAggregateError = ({ errors, errorPrefix }) => {
10296
10593
  // Throw an aggregate error if there were any errors.
10297
10594
  if (errors.length > 0) {
10298
10595
  const verbose =
10299
- getenv('COMPARTMENT_LOAD_ERRORS', '', ['verbose']) === 'verbose';
10596
+ /** @type {'' | 'verbose'} */
10597
+ (getenv('COMPARTMENT_LOAD_ERRORS', '', ['verbose'])) === 'verbose';
10300
10598
  throw TypeError(
10301
10599
  `${errorPrefix} (${errors.length} underlying failures: ${arrayJoin(
10302
10600
  arrayMap(errors, error => error.message + (verbose ? error.stack : '')),
@@ -10330,7 +10628,7 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10330
10628
  /** @type {Map<object, Map<string, Promise<Record<any, any>>>>} */
10331
10629
  const moduleLoads = new Map();
10332
10630
 
10333
- const { enqueueJob, drainQueue } = asyncJobQueue();
10631
+ const { enqueueJob, drainQueue, errors } = asyncJobQueue();
10334
10632
 
10335
10633
  enqueueJob(memoizedLoadWithErrorAnnotation, [
10336
10634
  compartmentPrivateFields,
@@ -10342,8 +10640,7 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10342
10640
  moduleLoads,
10343
10641
  ]);
10344
10642
 
10345
- // Drain pending jobs queue and throw an aggregate error
10346
- const errors = await drainQueue();
10643
+ await drainQueue();
10347
10644
 
10348
10645
  throwAggregateError({
10349
10646
  errors,
@@ -10374,16 +10671,7 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10374
10671
  /** @type {Map<object, Map<string, Promise<Record<any, any>>>>} */
10375
10672
  const moduleLoads = new Map();
10376
10673
 
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
- };
10674
+ const { enqueueJob, drainQueue, errors } = syncJobQueue();
10387
10675
 
10388
10676
  enqueueJob(memoizedLoadWithErrorAnnotation, [
10389
10677
  compartmentPrivateFields,
@@ -10395,6 +10683,8 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10395
10683
  moduleLoads,
10396
10684
  ]);
10397
10685
 
10686
+ drainQueue();
10687
+
10398
10688
  throwAggregateError({
10399
10689
  errors,
10400
10690
  errorPrefix: `Failed to load module ${q(moduleSpecifier)} in package ${q(
@@ -10404,7 +10694,7 @@ const preferAsync = (asyncImpl, _syncImpl) => asyncImpl;
10404
10694
  };$h͏_once.loadNow(loadNow);
10405
10695
  })()
10406
10696
  ,
10407
- // === 42. ses ./src/module-proxy.js ===
10697
+ // === 44. ses ./src/module-proxy.js ===
10408
10698
  ({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
10699
 
10410
10700
 
@@ -10607,7 +10897,7 @@ const { quote: q } = assert;
10607
10897
  };$h͏_once.getDeferredExports(getDeferredExports);
10608
10898
  })()
10609
10899
  ,
10610
- // === 43. ses ./src/compartment-evaluate.js ===
10900
+ // === 45. ses ./src/compartment-evaluate.js ===
10611
10901
  ({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
10902
 
10613
10903
 
@@ -10703,7 +10993,7 @@ const { quote: q } = assert;
10703
10993
  };$h͏_once.compartmentEvaluate(compartmentEvaluate);
10704
10994
  })()
10705
10995
  ,
10706
- // === 44. ses ./src/module-instance.js ===
10996
+ // === 46. ses ./src/module-instance.js ===
10707
10997
  ({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
10998
 
10709
10999
 
@@ -11203,7 +11493,7 @@ $h͏_once.makeVirtualModuleInstance(makeVirtualModuleInstance);const makeModuleI
11203
11493
  };$h͏_once.makeModuleInstance(makeModuleInstance);
11204
11494
  })()
11205
11495
  ,
11206
- // === 45. ses ./src/module-link.js ===
11496
+ // === 47. ses ./src/module-link.js ===
11207
11497
  ({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
11498
 
11209
11499
 
@@ -11365,7 +11655,7 @@ function validateModuleSource(moduleSource, moduleSpecifier) {
11365
11655
  };$h͏_once.instantiate(instantiate);
11366
11656
  })()
11367
11657
  ,
11368
- // === 46. ses ./src/compartment.js ===
11658
+ // === 48. ses ./src/compartment.js ===
11369
11659
  ({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
11660
 
11371
11661
 
@@ -11434,17 +11724,50 @@ function validateModuleSource(moduleSource, moduleSpecifier) {
11434
11724
 
11435
11725
 
11436
11726
 
11437
- /** @import {ModuleDescriptor, ModuleExportsNamespace} from '../types.js' */
11438
11727
 
11439
- // moduleAliases associates every public module exports namespace with its
11440
- // corresponding compartment and specifier so they can be used to link modules
11441
- // across compartments.
11442
- // The mechanism to thread an alias is to use the compartment.module function
11443
- // to obtain the exports namespace of a foreign module and pass it into another
11444
- // compartment's moduleMap constructor option.
11728
+ /**
11729
+ * @import {ImportHook, ImportMetaHook, ImportNowHook, ModuleDescriptor, ModuleExportsNamespace, ModuleMap, ModuleMapHook, ResolveHook, ModuleSource, CompartmentOptions} from '../types.js'
11730
+ * @import {Transform} from './lockdown.js'
11731
+ * @import {DeferredExports} from './module-proxy.js'
11732
+ */
11733
+
11734
+ /**
11735
+ * Associates every public module exports namespace with its corresponding
11736
+ * compartment and specifier so they can be used to link modules across
11737
+ * compartments. The mechanism to thread an alias is to use the
11738
+ * {@link Compartment.module} function to obtain the exports namespace of a foreign
11739
+ * module and pass it into another compartment's `moduleMap` constructor option
11740
+ * @type {WeakMap<ModuleExportsNamespace, Compartment>}
11741
+ *
11742
+ */
11445
11743
  const moduleAliases = new WeakMap();
11446
11744
 
11447
- // privateFields captures the private state for each compartment.
11745
+ /**
11746
+ * Private fields for `Compartment` instances
11747
+ * @typedef {object} CompartmentFields
11748
+ * @property {string} name
11749
+ * @property {object} globalObject
11750
+ * @property {Array<Transform>} globalTransforms
11751
+ * @property {(source: string, options?: {localTransforms?: Array<Transform>}) => void} safeEvaluate
11752
+ * @property {ResolveHook} resolveHook
11753
+ * @property {ImportHook} importHook
11754
+ * @property {ImportNowHook} importNowHook
11755
+ * @property {ModuleMap} moduleMap
11756
+ * @property {ModuleMapHook} moduleMapHook
11757
+ * @property {ImportMetaHook} importMetaHook
11758
+ * @property {Map<string, ModuleSource>} moduleRecords
11759
+ * @property {Array<Transform>} __shimTransforms__
11760
+ * @property {DeferredExports} deferredExports
11761
+ * @property {Map<string, ModuleDescriptor>} instances
11762
+ * @property {Compartment} [parentCompartment]
11763
+ * @property {boolean} noNamespaceBox
11764
+ * @property {(fullSpecifier: string) => Promise<ModuleExportsNamespace>} compartmentImport
11765
+ */
11766
+
11767
+ /**
11768
+ * Captures the private state for each {@link Compartment}
11769
+ * @type {WeakMap<Compartment, CompartmentFields>}
11770
+ */
11448
11771
  const privateFields = new WeakMap();
11449
11772
 
11450
11773
  const InertCompartment = function Compartment(
@@ -11460,6 +11783,7 @@ const privateFields = new WeakMap();
11460
11783
  /**
11461
11784
  * @param {Compartment} compartment
11462
11785
  * @param {string} specifier
11786
+ * @returns {{namespace: ModuleExportsNamespace}}
11463
11787
  */$h͏_once.InertCompartment(InertCompartment);
11464
11788
  const compartmentImportNow = (compartment, specifier) => {
11465
11789
  const { execute, exportsProxy } = link(
@@ -11472,27 +11796,20 @@ const compartmentImportNow = (compartment, specifier) => {
11472
11796
  return exportsProxy;
11473
11797
  };
11474
11798
 
11799
+ /** @type {Compartment & {constructor: typeof InertCompartment}} */
11475
11800
  const CompartmentPrototype = {
11476
11801
  constructor: InertCompartment,
11477
11802
 
11478
11803
  get globalThis() {
11479
- return weakmapGet(privateFields, this).globalObject;
11804
+ return /** @type {CompartmentFields} */ (weakmapGet(privateFields, this))
11805
+ .globalObject;
11480
11806
  },
11481
11807
 
11482
11808
  get name() {
11483
- return weakmapGet(privateFields, this).name;
11809
+ return /** @type {CompartmentFields} */ (weakmapGet(privateFields, this))
11810
+ .name;
11484
11811
  },
11485
11812
 
11486
- /**
11487
- * @param {string} source is a JavaScript program grammar construction.
11488
- * @param {object} [options]
11489
- * @param {Array<import('./lockdown-shim').Transform>} [options.transforms]
11490
- * @param {boolean} [options.sloppyGlobalsMode]
11491
- * @param {object} [options.__moduleShimLexicals__]
11492
- * @param {boolean} [options.__evadeHtmlCommentTest__]
11493
- * @param {boolean} [options.__evadeImportExpressionTest__]
11494
- * @param {boolean} [options.__rejectSomeDirectEvalExpressions__]
11495
- */
11496
11813
  evaluate(source, options = {}) {
11497
11814
  const compartmentFields = weakmapGet(privateFields, this);
11498
11815
  return compartmentEvaluate(compartmentFields, source, options);
@@ -11514,7 +11831,9 @@ const compartmentImportNow = (compartment, specifier) => {
11514
11831
  },
11515
11832
 
11516
11833
  async import(specifier) {
11517
- const { noNamespaceBox } = weakmapGet(privateFields, this);
11834
+ const { noNamespaceBox } = /** @type {CompartmentFields} */ (
11835
+ weakmapGet(privateFields, this)
11836
+ );
11518
11837
 
11519
11838
  if (typeof specifier !== 'string') {
11520
11839
  throw TypeError('first argument of import() must be a string');
@@ -11553,7 +11872,7 @@ const compartmentImportNow = (compartment, specifier) => {
11553
11872
  }
11554
11873
 
11555
11874
  loadNow(privateFields, moduleAliases, this, specifier);
11556
- return compartmentImportNow(/** @type {Compartment} */ (this), specifier);
11875
+ return compartmentImportNow(this, specifier);
11557
11876
  },
11558
11877
  };
11559
11878
 
@@ -11584,15 +11903,35 @@ defineProperties(InertCompartment, {
11584
11903
  * @returns {Compartment['constructor']}
11585
11904
  */
11586
11905
 
11587
- // In order to facilitate migration from the deprecated signature
11588
- // of the compartment constructor,
11589
- // new Compartent(globals?, modules?, options?)
11590
- // to the new signature:
11591
- // new Compartment(options?)
11592
- // where globals and modules are expressed in the options bag instead of
11593
- // positional arguments, this function detects the temporary sigil __options__
11594
- // on the first argument and coerces compartments arguments into a single
11595
- // compartments object.
11906
+ /**
11907
+ * "Options bag"-style `Compartment` constructor arguments.
11908
+ * @typedef {[options?: CompartmentOptions & { __options__: true }]} CompartmentOptionsArgs
11909
+ */
11910
+
11911
+ /**
11912
+ * Legacy `Compartment` constructor arguments.
11913
+ *
11914
+ * @deprecated
11915
+ * @typedef {[globals?: Map<string, any>, modules?: Map<string, ModuleDescriptor>, options?: CompartmentOptions]} LegacyCompartmentOptionsArgs
11916
+ */
11917
+
11918
+ /**
11919
+ * In order to facilitate migration from the deprecated signature of the
11920
+ * compartment constructor,
11921
+ *
11922
+ * `new Compartent(globals?, modules?, options?)`
11923
+ *
11924
+ * to the new signature:
11925
+ *
11926
+ * `new Compartment(options?)`
11927
+ *
11928
+ * ...where globals and modules are expressed in the options bag instead of
11929
+ * positional arguments, this function detects the temporary sigil __options__
11930
+ * on the first argument and coerces compartments arguments into a single
11931
+ * compartments object.
11932
+ * @param {CompartmentOptionsArgs|LegacyCompartmentOptionsArgs} args
11933
+ * @returns {CompartmentOptions}
11934
+ */
11596
11935
  const compartmentOptions = (...args) => {
11597
11936
  if (args.length === 0) {
11598
11937
  return {};
@@ -11614,7 +11953,7 @@ defineProperties(InertCompartment, {
11614
11953
  globals = /** @type {Map<string, any>} */ ({}),
11615
11954
  modules = /** @type {Map<string, ModuleDescriptor>} */ ({}),
11616
11955
  options = {},
11617
- ] = args;
11956
+ ] = /** @type {LegacyCompartmentOptionsArgs} */ (args);
11618
11957
  assertEqual(
11619
11958
  options.modules,
11620
11959
  undefined,
@@ -11640,6 +11979,10 @@ defineProperties(InertCompartment, {
11640
11979
  markVirtualizedNativeFunction,
11641
11980
  { parentCompartment = undefined, enforceNew = false } = {},
11642
11981
  ) => {
11982
+ /**
11983
+ *
11984
+ * @param {CompartmentOptionsArgs|LegacyCompartmentOptionsArgs} args
11985
+ */
11643
11986
  function Compartment(...args) {
11644
11987
  if (enforceNew && new.target === undefined) {
11645
11988
  throw TypeError(
@@ -11775,8 +12118,9 @@ defineProperties(InertCompartment, {
11775
12118
  };$h͏_once.makeCompartmentConstructor(makeCompartmentConstructor);
11776
12119
  })()
11777
12120
  ,
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)]]]]]);
12121
+ // === 49. ses ./src/get-anonymous-intrinsics.js ===
12122
+ ({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)]]]]]);
12123
+
11780
12124
 
11781
12125
 
11782
12126
 
@@ -11944,22 +12288,28 @@ function makeArguments() {
11944
12288
  );
11945
12289
  }
11946
12290
 
12291
+ const ab = new ArrayBuffer(0);
12292
+ // @ts-expect-error TODO How do I add sliceToImmutable to ArrayBuffer type?
12293
+ // eslint-disable-next-line @endo/no-polymorphic-call
12294
+ const iab = ab.sliceToImmutable();
12295
+ const iabProto = getPrototypeOf(iab);
12296
+ if (iabProto !== ArrayBuffer.prototype) {
12297
+ // In a native implementation, these will be the same prototype
12298
+ intrinsics['%ImmutableArrayBufferPrototype%'] = iabProto;
12299
+ }
12300
+
11947
12301
  return intrinsics;
11948
12302
  };$h͏_once.getAnonymousIntrinsics(getAnonymousIntrinsics);
11949
12303
  })()
11950
12304
  ,
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)]]]]]);
12305
+ // === 50. ses ./src/tame-harden.js ===
12306
+ ({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
12307
 
11954
12308
 
11955
12309
  /** @import {Harden} from '../types.js'; */
11956
12310
 
11957
12311
  /** @type {(safeHarden: Harden, hardenTaming: 'safe' | 'unsafe') => Harden} */
11958
12312
  const tameHarden = (safeHarden, hardenTaming) => {
11959
- if (hardenTaming !== 'safe' && hardenTaming !== 'unsafe') {
11960
- throw TypeError(`unrecognized fakeHardenOption ${hardenTaming}`);
11961
- }
11962
-
11963
12313
  if (hardenTaming === 'safe') {
11964
12314
  return safeHarden;
11965
12315
  }
@@ -11984,7 +12334,7 @@ function makeArguments() {
11984
12334
  freeze(tameHarden);
11985
12335
  })()
11986
12336
  ,
11987
- // === 49. ses ./src/tame-symbol-constructor.js ===
12337
+ // === 51. ses ./src/tame-symbol-constructor.js ===
11988
12338
  ({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
12339
 
11990
12340
 
@@ -12051,7 +12401,7 @@ freeze(tameHarden);
12051
12401
  };$h͏_once.tameSymbolConstructor(tameSymbolConstructor);
12052
12402
  })()
12053
12403
  ,
12054
- // === 50. ses ./src/tame-faux-data-properties.js ===
12404
+ // === 52. ses ./src/tame-faux-data-properties.js ===
12055
12405
  ({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
12406
 
12057
12407
 
@@ -12264,7 +12614,7 @@ const throws = thunk => {
12264
12614
  };$h͏_once.tameFauxDataProperties(tameFauxDataProperties);
12265
12615
  })()
12266
12616
  ,
12267
- // === 51. ses ./src/tame-regenerator-runtime.js ===
12617
+ // === 53. ses ./src/tame-regenerator-runtime.js ===
12268
12618
  ({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
12619
 
12270
12620
 
@@ -12296,7 +12646,7 @@ const throws = thunk => {
12296
12646
  };$h͏_once.tameRegeneratorRuntime(tameRegeneratorRuntime);
12297
12647
  })()
12298
12648
  ,
12299
- // === 52. ses ./src/shim-arraybuffer-transfer.js ===
12649
+ // === 54. ses ./src/shim-arraybuffer-transfer.js ===
12300
12650
  ({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
12651
 
12302
12652
 
@@ -12310,7 +12660,6 @@ const throws = thunk => {
12310
12660
 
12311
12661
 
12312
12662
  const shimArrayBufferTransfer = () => {
12313
- // @ts-expect-error TODO extend ArrayBuffer type to include transfer, etc.
12314
12663
  if (typeof arrayBufferPrototype.transfer === 'function') {
12315
12664
  // Assume already exists so does not need to be shimmed.
12316
12665
  // Such conditional shimming is ok in this case since ArrayBuffer.p.transfer
@@ -12385,8 +12734,8 @@ const throws = thunk => {
12385
12734
  };$h͏_once.shimArrayBufferTransfer(shimArrayBufferTransfer);
12386
12735
  })()
12387
12736
  ,
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)]]]]]);
12737
+ // === 55. ses ./src/reporting.js ===
12738
+ ({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
12739
 
12391
12740
 
12392
12741
  /**
@@ -12439,9 +12788,6 @@ const mute = () => {};
12439
12788
  if (reporting === 'none') {
12440
12789
  return makeReportPrinter(mute);
12441
12790
  }
12442
- if (reporting !== 'platform' && reporting !== 'console') {
12443
- throw new TypeError(`Invalid lockdown reporting option: ${reporting}`);
12444
- }
12445
12791
  if (
12446
12792
  reporting === 'console' ||
12447
12793
  globalThis.window === globalThis ||
@@ -12496,8 +12842,9 @@ const mute = () => {};
12496
12842
  };$h͏_once.reportInGroup(reportInGroup);
12497
12843
  })()
12498
12844
  ,
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)]]]]]);
12845
+ // === 56. ses ./src/lockdown.js ===
12846
+ ({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-hermes.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)]]]]]);
12847
+
12501
12848
 
12502
12849
 
12503
12850
 
@@ -12599,10 +12946,32 @@ const safeHarden = makeHardener();
12599
12946
  // only ever need to be called once and that simplifying lockdown will improve
12600
12947
  // the quality of audits.
12601
12948
 
12602
- const assertDirectEvalAvailable = () => {
12603
- let allowed = false;
12949
+ const probeHostEvaluators = () => {
12950
+ let functionAllowed;
12951
+ try {
12952
+ functionAllowed = FERAL_FUNCTION('return true')();
12953
+ } catch (_error) {
12954
+ // We reach here if the Function() constructor is outright forbidden by a
12955
+ // strict Content Security Policy (containing either a `default-src` or a
12956
+ // `script-src` directive), not been implemented in the host, or the host
12957
+ // is configured to throw an exception instead of `new Function`.
12958
+ functionAllowed = false;
12959
+ }
12960
+
12961
+ let evalAllowed;
12604
12962
  try {
12605
- allowed = FERAL_FUNCTION(
12963
+ evalAllowed = FERAL_EVAL('true');
12964
+ } catch (_error) {
12965
+ // We reach here if `eval` is outright forbidden by a strict Content Security Policy,
12966
+ // not implemented in the host, or the host is configured to throw an exception.
12967
+ // We allow this for SES usage that delegates the responsibility to isolate
12968
+ // guest code to production code generation.
12969
+ evalAllowed = false;
12970
+ }
12971
+
12972
+ let directEvalAllowed;
12973
+ if (functionAllowed && evalAllowed) {
12974
+ directEvalAllowed = FERAL_FUNCTION(
12606
12975
  'eval',
12607
12976
  'SES_changed',
12608
12977
  `\
@@ -12614,21 +12983,12 @@ const assertDirectEvalAvailable = () => {
12614
12983
  // and indirect, which generally creates a new global.
12615
12984
  // We are going to throw an exception for failing to initialize SES, but
12616
12985
  // good neighbors clean up.
12617
- if (!allowed) {
12986
+ if (!directEvalAllowed) {
12618
12987
  delete globalThis.SES_changed;
12619
12988
  }
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
12989
  }
12990
+
12991
+ return { functionAllowed, evalAllowed, directEvalAllowed };
12632
12992
  };
12633
12993
 
12634
12994
  /**
@@ -12651,65 +13011,85 @@ const assertDirectEvalAvailable = () => {
12651
13011
  // The `stackFiltering` is not a safety issue. Rather it is a tradeoff
12652
13012
  // between relevance and completeness of the stack frames shown on the
12653
13013
  // console. Setting`stackFiltering` to `'verbose'` applies no filters, providing
12654
- // the raw stack frames that can be quite versbose. Setting
13014
+ // the raw stack frames that can be quite verbose. Setting
12655
13015
  // `stackFrameFiltering` to`'concise'` limits the display to the stack frame
12656
13016
  // information most likely to be relevant, eliminating distracting frames
12657
13017
  // 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
13018
+ // track down might be in the infrastructure, in which case the `'verbose'` setting
12659
13019
  // is useful. See
12660
13020
  // [`stackFiltering` options](https://github.com/Agoric/SES-shim/blob/master/packages/ses/docs/lockdown.md#stackfiltering-options)
12661
13021
  // for an explanation.
12662
13022
 
12663
13023
  const {
12664
- errorTaming = getenv('LOCKDOWN_ERROR_TAMING', 'safe'),
12665
- errorTrapping = /** @type {"platform" | "none" | "report" | "abort" | "exit"} */ (
12666
- getenv('LOCKDOWN_ERROR_TRAPPING', 'platform')
13024
+ errorTaming = /** @type {'safe' | 'unsafe' | 'unsafe-debug'} */ (
13025
+ getenv('LOCKDOWN_ERROR_TAMING', 'safe', ['unsafe', 'unsafe-debug'])
12667
13026
  ),
12668
- reporting = /** @type {"platform" | "console" | "none"} */ (
12669
- getenv('LOCKDOWN_REPORTING', 'platform')
13027
+ errorTrapping = /** @type {'platform' | 'none' | 'report' | 'abort' | 'exit'} */ (
13028
+ getenv('LOCKDOWN_ERROR_TRAPPING', 'platform', [
13029
+ 'none',
13030
+ 'report',
13031
+ 'abort',
13032
+ 'exit',
13033
+ ])
12670
13034
  ),
12671
- unhandledRejectionTrapping = /** @type {"none" | "report"} */ (
12672
- getenv('LOCKDOWN_UNHANDLED_REJECTION_TRAPPING', 'report')
13035
+ reporting = /** @type {'platform' | 'console' | 'none'} */ (
13036
+ getenv('LOCKDOWN_REPORTING', 'platform', ['console', 'none'])
13037
+ ),
13038
+ unhandledRejectionTrapping = /** @type {'none' | 'report'} */ (
13039
+ getenv('LOCKDOWN_UNHANDLED_REJECTION_TRAPPING', 'report', ['none'])
13040
+ ),
13041
+ regExpTaming = /** @type {'safe' | 'unsafe'} */ (
13042
+ getenv('LOCKDOWN_REGEXP_TAMING', 'safe', ['unsafe'])
13043
+ ),
13044
+ localeTaming = /** @type {'safe' | 'unsafe'} */ (
13045
+ getenv('LOCKDOWN_LOCALE_TAMING', 'safe', ['unsafe'])
12673
13046
  ),
12674
- regExpTaming = getenv('LOCKDOWN_REGEXP_TAMING', 'safe'),
12675
- localeTaming = getenv('LOCKDOWN_LOCALE_TAMING', 'safe'),
12676
-
12677
13047
  consoleTaming = /** @type {'unsafe' | 'safe'} */ (
12678
- getenv('LOCKDOWN_CONSOLE_TAMING', 'safe')
13048
+ getenv('LOCKDOWN_CONSOLE_TAMING', 'safe', ['unsafe'])
12679
13049
  ),
12680
13050
  overrideTaming = /** @type {'moderate' | 'min' | 'severe'} */ (
12681
- getenv('LOCKDOWN_OVERRIDE_TAMING', 'moderate')
13051
+ getenv('LOCKDOWN_OVERRIDE_TAMING', 'moderate', ['min', 'severe'])
12682
13052
  ),
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 !== '',
13053
+ stackFiltering = /** @type {'concise' | 'omit-frames' | 'shorten-paths' | 'verbose'} */ (
13054
+ getenv('LOCKDOWN_STACK_FILTERING', 'concise', [
13055
+ 'omit-frames',
13056
+ 'shorten-paths',
13057
+ 'verbose',
13058
+ ])
12690
13059
  ),
12691
- legacyRegeneratorRuntimeTaming = getenv(
12692
- 'LOCKDOWN_LEGACY_REGENERATOR_RUNTIME_TAMING',
12693
- 'safe',
13060
+ domainTaming = /** @type {'safe' | 'unsafe'} */ (
13061
+ getenv('LOCKDOWN_DOMAIN_TAMING', 'safe', ['unsafe'])
13062
+ ),
13063
+ evalTaming = /** @type {'safe-eval' | 'unsafe-eval' | 'no-eval'} */ (
13064
+ getenv('LOCKDOWN_EVAL_TAMING', 'safe-eval', [
13065
+ 'unsafe-eval',
13066
+ 'no-eval',
13067
+ // deprecated
13068
+ 'safeEval',
13069
+ 'unsafeEval',
13070
+ 'noEval',
13071
+ ])
13072
+ ),
13073
+ overrideDebug = /** @type {string[]} */ (
13074
+ arrayFilter(
13075
+ stringSplit(getenv('LOCKDOWN_OVERRIDE_DEBUG', ''), ','),
13076
+ /** @param {string} debugName */
13077
+ debugName => debugName !== '',
13078
+ )
13079
+ ),
13080
+ legacyRegeneratorRuntimeTaming = /** @type {'safe' | 'unsafe-ignore'} */ (
13081
+ getenv('LOCKDOWN_LEGACY_REGENERATOR_RUNTIME_TAMING', 'safe', [
13082
+ 'unsafe-ignore',
13083
+ ])
13084
+ ),
13085
+ __hardenTaming__ = /** @type {'safe' | 'unsafe'} */ (
13086
+ getenv('LOCKDOWN_HARDEN_TAMING', 'safe', ['unsafe'])
12694
13087
  ),
12695
- __hardenTaming__ = getenv('LOCKDOWN_HARDEN_TAMING', 'safe'),
12696
13088
  dateTaming, // deprecated
12697
13089
  mathTaming, // deprecated
12698
13090
  ...extraOptions
12699
13091
  } = options;
12700
13092
 
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
13093
  // Assert that only supported options were passed.
12714
13094
  // Use Reflect.ownKeys to reject symbol-named properties as well.
12715
13095
  const extraOptionsNames = ownKeys(extraOptions);
@@ -12720,13 +13100,11 @@ const assertDirectEvalAvailable = () => {
12720
13100
  const { warn } = reporter;
12721
13101
 
12722
13102
  if (dateTaming !== undefined) {
12723
- // eslint-disable-next-line no-console
12724
13103
  warn(
12725
13104
  `SES The 'dateTaming' option is deprecated and does nothing. In the future specifying it will be an error.`,
12726
13105
  );
12727
13106
  }
12728
13107
  if (mathTaming !== undefined) {
12729
- // eslint-disable-next-line no-console
12730
13108
  warn(
12731
13109
  `SES The 'mathTaming' option is deprecated and does nothing. In the future specifying it will be an error.`,
12732
13110
  );
@@ -12744,7 +13122,19 @@ const assertDirectEvalAvailable = () => {
12744
13122
  // trace retained:
12745
13123
  priorRepairIntrinsics.stack;
12746
13124
 
12747
- assertDirectEvalAvailable();
13125
+ const { functionAllowed, evalAllowed, directEvalAllowed } =
13126
+ probeHostEvaluators();
13127
+
13128
+ if (
13129
+ directEvalAllowed === false &&
13130
+ evalTaming === 'safe-eval' &&
13131
+ (functionAllowed || evalAllowed)
13132
+ ) {
13133
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_DIRECT_EVAL.md
13134
+ throw TypeError(
13135
+ "SES cannot initialize unless 'eval' is the original intrinsic 'eval', suitable for direct eval (dynamically scoped eval) (SES_DIRECT_EVAL)",
13136
+ );
13137
+ }
12748
13138
 
12749
13139
  /**
12750
13140
  * Because of packagers and bundlers, etc, multiple invocations of lockdown
@@ -12799,7 +13189,6 @@ const assertDirectEvalAvailable = () => {
12799
13189
  const { addIntrinsics, completePrototypes, finalIntrinsics } =
12800
13190
  makeIntrinsicsCollector(reporter);
12801
13191
 
12802
- // @ts-expect-error __hardenTaming__ could be any string
12803
13192
  const tamedHarden = tameHarden(safeHarden, __hardenTaming__);
12804
13193
  addIntrinsics({ harden: tamedHarden });
12805
13194
 
@@ -13014,7 +13403,7 @@ const assertDirectEvalAvailable = () => {
13014
13403
  };$h͏_once.repairIntrinsics(repairIntrinsics);
13015
13404
  })()
13016
13405
  ,
13017
- // === 55. ses ./src/lockdown-shim.js ===
13406
+ // === 57. ses ./src/lockdown-shim.js ===
13018
13407
  ({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
13408
 
13020
13409
 
@@ -13054,7 +13443,7 @@ globalThis.repairIntrinsics = options => {
13054
13443
  };
13055
13444
  })()
13056
13445
  ,
13057
- // === 56. ses ./src/compartment-shim.js ===
13446
+ // === 58. ses ./src/compartment-shim.js ===
13058
13447
  ({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
13448
 
13060
13449
 
@@ -13079,14 +13468,14 @@ globalThis.Compartment = makeCompartmentConstructor(
13079
13468
  );
13080
13469
  })()
13081
13470
  ,
13082
- // === 57. ses ./src/assert-shim.js ===
13471
+ // === 59. ses ./src/assert-shim.js ===
13083
13472
  ({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
13473
 
13085
13474
 
13086
13475
  globalThis.assert = assert;
13087
13476
  })()
13088
13477
  ,
13089
- // === 58. ses ./src/console-shim.js ===
13478
+ // === 60. ses ./src/console-shim.js ===
13090
13479
  ({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
13480
 
13092
13481
 
@@ -13139,7 +13528,7 @@ globalThis[MAKE_CAUSAL_CONSOLE_FROM_LOGGER_KEY_FOR_SES_AVA] =
13139
13528
  makeCausalConsoleFromLoggerForSesAva;
13140
13529
  })()
13141
13530
  ,
13142
- // === 59. ses ./index.js ===
13531
+ // === 61. ses ./index.js ===
13143
13532
  ({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
13533
  })()
13145
13534
  ,