ses 1.9.1 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- // ses@1.9.1
1
+ // ses@1.11.0
2
2
  'use strict';
3
3
  (functors => {
4
4
 
@@ -162,9 +162,9 @@
162
162
  finalizationRegistryRegister: cell("finalizationRegistryRegister"),
163
163
  finalizationRegistryUnregister: cell("finalizationRegistryUnregister"),
164
164
  getConstructorOf: cell("getConstructorOf"),
165
- immutableObject: cell("immutableObject"),
166
165
  isObject: cell("isObject"),
167
166
  isError: cell("isError"),
167
+ identity: cell("identity"),
168
168
  FERAL_EVAL: cell("FERAL_EVAL"),
169
169
  FERAL_FUNCTION: cell("FERAL_FUNCTION"),
170
170
  noEvalEvaluate: cell("noEvalEvaluate"),
@@ -213,6 +213,9 @@
213
213
  isTypedArray: cell("isTypedArray"),
214
214
  makeHardener: cell("makeHardener"),
215
215
  },
216
+ {
217
+ cauterizeProperty: cell("cauterizeProperty"),
218
+ },
216
219
  {
217
220
  NativeErrors: cell("NativeErrors"),
218
221
  constantProperties: cell("constantProperties"),
@@ -357,6 +360,7 @@
357
360
  {
358
361
  InertCompartment: cell("InertCompartment"),
359
362
  CompartmentPrototype: cell("CompartmentPrototype"),
363
+ compartmentOptions: cell("compartmentOptions"),
360
364
  makeCompartmentConstructor: cell("makeCompartmentConstructor"),
361
365
  },
362
366
  {
@@ -378,6 +382,10 @@
378
382
  {
379
383
  shimArrayBufferTransfer: cell("shimArrayBufferTransfer"),
380
384
  },
385
+ {
386
+ chooseReporter: cell("chooseReporter"),
387
+ reportInGroup: cell("reportInGroup"),
388
+ },
381
389
  {
382
390
  repairIntrinsics: cell("repairIntrinsics"),
383
391
  },
@@ -568,9 +576,9 @@ function observeImports(map, importName, importIndex) {
568
576
  finalizationRegistryRegister: cells[0].finalizationRegistryRegister.set,
569
577
  finalizationRegistryUnregister: cells[0].finalizationRegistryUnregister.set,
570
578
  getConstructorOf: cells[0].getConstructorOf.set,
571
- immutableObject: cells[0].immutableObject.set,
572
579
  isObject: cells[0].isObject.set,
573
580
  isError: cells[0].isError.set,
581
+ identity: cells[0].identity.set,
574
582
  FERAL_EVAL: cells[0].FERAL_EVAL.set,
575
583
  FERAL_FUNCTION: cells[0].FERAL_FUNCTION.set,
576
584
  noEvalEvaluate: cells[0].noEvalEvaluate.set,
@@ -720,16 +728,7 @@ function observeImports(map, importName, importIndex) {
720
728
  liveVar: {
721
729
  },
722
730
  onceVar: {
723
- NativeErrors: cells[11].NativeErrors.set,
724
- constantProperties: cells[11].constantProperties.set,
725
- universalPropertyNames: cells[11].universalPropertyNames.set,
726
- initialGlobalPropertyNames: cells[11].initialGlobalPropertyNames.set,
727
- sharedGlobalPropertyNames: cells[11].sharedGlobalPropertyNames.set,
728
- uniqueGlobalPropertyNames: cells[11].uniqueGlobalPropertyNames.set,
729
- FunctionInstance: cells[11].FunctionInstance.set,
730
- AsyncFunctionInstance: cells[11].AsyncFunctionInstance.set,
731
- isAccessorPermit: cells[11].isAccessorPermit.set,
732
- permitted: cells[11].permitted.set,
731
+ cauterizeProperty: cells[11].cauterizeProperty.set,
733
732
  },
734
733
  importMeta: {},
735
734
  });
@@ -737,33 +736,44 @@ function observeImports(map, importName, importIndex) {
737
736
  imports(entries) {
738
737
  const map = new Map(entries);
739
738
  observeImports(map, "./commons.js", 0);
740
- observeImports(map, "./permits.js", 11);
741
739
  },
742
740
  liveVar: {
743
741
  },
744
742
  onceVar: {
745
- makeIntrinsicsCollector: cells[12].makeIntrinsicsCollector.set,
746
- getGlobalIntrinsics: cells[12].getGlobalIntrinsics.set,
743
+ NativeErrors: cells[12].NativeErrors.set,
744
+ constantProperties: cells[12].constantProperties.set,
745
+ universalPropertyNames: cells[12].universalPropertyNames.set,
746
+ initialGlobalPropertyNames: cells[12].initialGlobalPropertyNames.set,
747
+ sharedGlobalPropertyNames: cells[12].sharedGlobalPropertyNames.set,
748
+ uniqueGlobalPropertyNames: cells[12].uniqueGlobalPropertyNames.set,
749
+ FunctionInstance: cells[12].FunctionInstance.set,
750
+ AsyncFunctionInstance: cells[12].AsyncFunctionInstance.set,
751
+ isAccessorPermit: cells[12].isAccessorPermit.set,
752
+ permitted: cells[12].permitted.set,
747
753
  },
748
754
  importMeta: {},
749
755
  });
750
756
  functors[13]({
751
757
  imports(entries) {
752
758
  const map = new Map(entries);
753
- observeImports(map, "./permits.js", 11);
759
+ observeImports(map, "./cauterize-property.js", 11);
754
760
  observeImports(map, "./commons.js", 0);
761
+ observeImports(map, "./permits.js", 12);
755
762
  },
756
763
  liveVar: {
757
764
  },
758
765
  onceVar: {
759
- default: cells[13].default.set,
766
+ makeIntrinsicsCollector: cells[13].makeIntrinsicsCollector.set,
767
+ getGlobalIntrinsics: cells[13].getGlobalIntrinsics.set,
760
768
  },
761
769
  importMeta: {},
762
770
  });
763
771
  functors[14]({
764
772
  imports(entries) {
765
773
  const map = new Map(entries);
774
+ observeImports(map, "./permits.js", 12);
766
775
  observeImports(map, "./commons.js", 0);
776
+ observeImports(map, "./cauterize-property.js", 11);
767
777
  },
768
778
  liveVar: {
769
779
  },
@@ -816,9 +826,7 @@ function observeImports(map, importName, importIndex) {
816
826
  liveVar: {
817
827
  },
818
828
  onceVar: {
819
- minEnablements: cells[18].minEnablements.set,
820
- moderateEnablements: cells[18].moderateEnablements.set,
821
- severeEnablements: cells[18].severeEnablements.set,
829
+ default: cells[18].default.set,
822
830
  },
823
831
  importMeta: {},
824
832
  });
@@ -826,12 +834,13 @@ function observeImports(map, importName, importIndex) {
826
834
  imports(entries) {
827
835
  const map = new Map(entries);
828
836
  observeImports(map, "./commons.js", 0);
829
- observeImports(map, "./enablements.js", 18);
830
837
  },
831
838
  liveVar: {
832
839
  },
833
840
  onceVar: {
834
- default: cells[19].default.set,
841
+ minEnablements: cells[19].minEnablements.set,
842
+ moderateEnablements: cells[19].moderateEnablements.set,
843
+ severeEnablements: cells[19].severeEnablements.set,
835
844
  },
836
845
  importMeta: {},
837
846
  });
@@ -839,7 +848,7 @@ function observeImports(map, importName, importIndex) {
839
848
  imports(entries) {
840
849
  const map = new Map(entries);
841
850
  observeImports(map, "./commons.js", 0);
842
- observeImports(map, "./error/assert.js", 9);
851
+ observeImports(map, "./enablements.js", 19);
843
852
  },
844
853
  liveVar: {
845
854
  },
@@ -851,24 +860,24 @@ function observeImports(map, importName, importIndex) {
851
860
  functors[21]({
852
861
  imports(entries) {
853
862
  const map = new Map(entries);
863
+ observeImports(map, "./commons.js", 0);
864
+ observeImports(map, "./error/assert.js", 9);
854
865
  },
855
866
  liveVar: {
856
867
  },
857
868
  onceVar: {
858
- makeEvalFunction: cells[21].makeEvalFunction.set,
869
+ default: cells[21].default.set,
859
870
  },
860
871
  importMeta: {},
861
872
  });
862
873
  functors[22]({
863
874
  imports(entries) {
864
875
  const map = new Map(entries);
865
- observeImports(map, "./commons.js", 0);
866
- observeImports(map, "./error/assert.js", 9);
867
876
  },
868
877
  liveVar: {
869
878
  },
870
879
  onceVar: {
871
- makeFunctionConstructor: cells[22].makeFunctionConstructor.set,
880
+ makeEvalFunction: cells[22].makeEvalFunction.set,
872
881
  },
873
882
  importMeta: {},
874
883
  });
@@ -876,17 +885,12 @@ function observeImports(map, importName, importIndex) {
876
885
  imports(entries) {
877
886
  const map = new Map(entries);
878
887
  observeImports(map, "./commons.js", 0);
879
- observeImports(map, "./make-eval-function.js", 21);
880
- observeImports(map, "./make-function-constructor.js", 22);
881
- observeImports(map, "./permits.js", 11);
888
+ observeImports(map, "./error/assert.js", 9);
882
889
  },
883
890
  liveVar: {
884
891
  },
885
892
  onceVar: {
886
- setGlobalObjectSymbolUnscopables: cells[23].setGlobalObjectSymbolUnscopables.set,
887
- setGlobalObjectConstantProperties: cells[23].setGlobalObjectConstantProperties.set,
888
- setGlobalObjectMutableProperties: cells[23].setGlobalObjectMutableProperties.set,
889
- setGlobalObjectEvaluators: cells[23].setGlobalObjectEvaluators.set,
893
+ makeFunctionConstructor: cells[23].makeFunctionConstructor.set,
890
894
  },
891
895
  importMeta: {},
892
896
  });
@@ -894,14 +898,17 @@ function observeImports(map, importName, importIndex) {
894
898
  imports(entries) {
895
899
  const map = new Map(entries);
896
900
  observeImports(map, "./commons.js", 0);
897
- observeImports(map, "./error/assert.js", 9);
901
+ observeImports(map, "./make-eval-function.js", 22);
902
+ observeImports(map, "./make-function-constructor.js", 23);
903
+ observeImports(map, "./permits.js", 12);
898
904
  },
899
905
  liveVar: {
900
906
  },
901
907
  onceVar: {
902
- alwaysThrowHandler: cells[24].alwaysThrowHandler.set,
903
- strictScopeTerminatorHandler: cells[24].strictScopeTerminatorHandler.set,
904
- strictScopeTerminator: cells[24].strictScopeTerminator.set,
908
+ setGlobalObjectSymbolUnscopables: cells[24].setGlobalObjectSymbolUnscopables.set,
909
+ setGlobalObjectConstantProperties: cells[24].setGlobalObjectConstantProperties.set,
910
+ setGlobalObjectMutableProperties: cells[24].setGlobalObjectMutableProperties.set,
911
+ setGlobalObjectEvaluators: cells[24].setGlobalObjectEvaluators.set,
905
912
  },
906
913
  importMeta: {},
907
914
  });
@@ -909,12 +916,14 @@ function observeImports(map, importName, importIndex) {
909
916
  imports(entries) {
910
917
  const map = new Map(entries);
911
918
  observeImports(map, "./commons.js", 0);
912
- observeImports(map, "./strict-scope-terminator.js", 24);
919
+ observeImports(map, "./error/assert.js", 9);
913
920
  },
914
921
  liveVar: {
915
922
  },
916
923
  onceVar: {
917
- createSloppyGlobalsScopeTerminator: cells[25].createSloppyGlobalsScopeTerminator.set,
924
+ alwaysThrowHandler: cells[25].alwaysThrowHandler.set,
925
+ strictScopeTerminatorHandler: cells[25].strictScopeTerminatorHandler.set,
926
+ strictScopeTerminator: cells[25].strictScopeTerminator.set,
918
927
  },
919
928
  importMeta: {},
920
929
  });
@@ -922,12 +931,12 @@ function observeImports(map, importName, importIndex) {
922
931
  imports(entries) {
923
932
  const map = new Map(entries);
924
933
  observeImports(map, "./commons.js", 0);
925
- observeImports(map, "./error/assert.js", 9);
934
+ observeImports(map, "./strict-scope-terminator.js", 25);
926
935
  },
927
936
  liveVar: {
928
937
  },
929
938
  onceVar: {
930
- makeEvalScopeKit: cells[26].makeEvalScopeKit.set,
939
+ createSloppyGlobalsScopeTerminator: cells[26].createSloppyGlobalsScopeTerminator.set,
931
940
  },
932
941
  importMeta: {},
933
942
  });
@@ -935,11 +944,12 @@ function observeImports(map, importName, importIndex) {
935
944
  imports(entries) {
936
945
  const map = new Map(entries);
937
946
  observeImports(map, "./commons.js", 0);
947
+ observeImports(map, "./error/assert.js", 9);
938
948
  },
939
949
  liveVar: {
940
950
  },
941
951
  onceVar: {
942
- getSourceURL: cells[27].getSourceURL.set,
952
+ makeEvalScopeKit: cells[27].makeEvalScopeKit.set,
943
953
  },
944
954
  importMeta: {},
945
955
  });
@@ -947,19 +957,11 @@ function observeImports(map, importName, importIndex) {
947
957
  imports(entries) {
948
958
  const map = new Map(entries);
949
959
  observeImports(map, "./commons.js", 0);
950
- observeImports(map, "./get-source-url.js", 27);
951
960
  },
952
961
  liveVar: {
953
962
  },
954
963
  onceVar: {
955
- rejectHtmlComments: cells[28].rejectHtmlComments.set,
956
- evadeHtmlCommentTest: cells[28].evadeHtmlCommentTest.set,
957
- rejectImportExpressions: cells[28].rejectImportExpressions.set,
958
- evadeImportExpressionTest: cells[28].evadeImportExpressionTest.set,
959
- rejectSomeDirectEvalExpressions: cells[28].rejectSomeDirectEvalExpressions.set,
960
- mandatoryTransforms: cells[28].mandatoryTransforms.set,
961
- applyTransforms: cells[28].applyTransforms.set,
962
- transforms: cells[28].transforms.set,
964
+ getSourceURL: cells[28].getSourceURL.set,
963
965
  },
964
966
  importMeta: {},
965
967
  });
@@ -967,12 +969,19 @@ function observeImports(map, importName, importIndex) {
967
969
  imports(entries) {
968
970
  const map = new Map(entries);
969
971
  observeImports(map, "./commons.js", 0);
972
+ observeImports(map, "./get-source-url.js", 28);
970
973
  },
971
974
  liveVar: {
972
975
  },
973
976
  onceVar: {
974
- isValidIdentifierName: cells[29].isValidIdentifierName.set,
975
- getScopeConstants: cells[29].getScopeConstants.set,
977
+ rejectHtmlComments: cells[29].rejectHtmlComments.set,
978
+ evadeHtmlCommentTest: cells[29].evadeHtmlCommentTest.set,
979
+ rejectImportExpressions: cells[29].rejectImportExpressions.set,
980
+ evadeImportExpressionTest: cells[29].evadeImportExpressionTest.set,
981
+ rejectSomeDirectEvalExpressions: cells[29].rejectSomeDirectEvalExpressions.set,
982
+ mandatoryTransforms: cells[29].mandatoryTransforms.set,
983
+ applyTransforms: cells[29].applyTransforms.set,
984
+ transforms: cells[29].transforms.set,
976
985
  },
977
986
  importMeta: {},
978
987
  });
@@ -980,12 +989,12 @@ function observeImports(map, importName, importIndex) {
980
989
  imports(entries) {
981
990
  const map = new Map(entries);
982
991
  observeImports(map, "./commons.js", 0);
983
- observeImports(map, "./scope-constants.js", 29);
984
992
  },
985
993
  liveVar: {
986
994
  },
987
995
  onceVar: {
988
- makeEvaluate: cells[30].makeEvaluate.set,
996
+ isValidIdentifierName: cells[30].isValidIdentifierName.set,
997
+ getScopeConstants: cells[30].getScopeConstants.set,
989
998
  },
990
999
  importMeta: {},
991
1000
  });
@@ -993,17 +1002,12 @@ function observeImports(map, importName, importIndex) {
993
1002
  imports(entries) {
994
1003
  const map = new Map(entries);
995
1004
  observeImports(map, "./commons.js", 0);
996
- observeImports(map, "./strict-scope-terminator.js", 24);
997
- observeImports(map, "./sloppy-globals-scope-terminator.js", 25);
998
- observeImports(map, "./eval-scope.js", 26);
999
- observeImports(map, "./transforms.js", 28);
1000
- observeImports(map, "./make-evaluate.js", 30);
1001
- observeImports(map, "./error/assert.js", 9);
1005
+ observeImports(map, "./scope-constants.js", 30);
1002
1006
  },
1003
1007
  liveVar: {
1004
1008
  },
1005
1009
  onceVar: {
1006
- makeSafeEvaluator: cells[31].makeSafeEvaluator.set,
1010
+ makeEvaluate: cells[31].makeEvaluate.set,
1007
1011
  },
1008
1012
  importMeta: {},
1009
1013
  });
@@ -1011,11 +1015,17 @@ function observeImports(map, importName, importIndex) {
1011
1015
  imports(entries) {
1012
1016
  const map = new Map(entries);
1013
1017
  observeImports(map, "./commons.js", 0);
1018
+ observeImports(map, "./strict-scope-terminator.js", 25);
1019
+ observeImports(map, "./sloppy-globals-scope-terminator.js", 26);
1020
+ observeImports(map, "./eval-scope.js", 27);
1021
+ observeImports(map, "./transforms.js", 29);
1022
+ observeImports(map, "./make-evaluate.js", 31);
1023
+ observeImports(map, "./error/assert.js", 9);
1014
1024
  },
1015
1025
  liveVar: {
1016
1026
  },
1017
1027
  onceVar: {
1018
- tameFunctionToString: cells[32].tameFunctionToString.set,
1028
+ makeSafeEvaluator: cells[32].makeSafeEvaluator.set,
1019
1029
  },
1020
1030
  importMeta: {},
1021
1031
  });
@@ -1027,7 +1037,7 @@ function observeImports(map, importName, importIndex) {
1027
1037
  liveVar: {
1028
1038
  },
1029
1039
  onceVar: {
1030
- tameDomains: cells[33].tameDomains.set,
1040
+ tameFunctionToString: cells[33].tameFunctionToString.set,
1031
1041
  },
1032
1042
  importMeta: {},
1033
1043
  });
@@ -1039,25 +1049,19 @@ function observeImports(map, importName, importIndex) {
1039
1049
  liveVar: {
1040
1050
  },
1041
1051
  onceVar: {
1042
- tameModuleSource: cells[34].tameModuleSource.set,
1052
+ tameDomains: cells[34].tameDomains.set,
1043
1053
  },
1044
1054
  importMeta: {},
1045
1055
  });
1046
1056
  functors[35]({
1047
1057
  imports(entries) {
1048
1058
  const map = new Map(entries);
1049
- observeImports(map, "../commons.js", 0);
1059
+ observeImports(map, "./commons.js", 0);
1050
1060
  },
1051
1061
  liveVar: {
1052
1062
  },
1053
1063
  onceVar: {
1054
- consoleLevelMethods: cells[35].consoleLevelMethods.set,
1055
- consoleOtherMethods: cells[35].consoleOtherMethods.set,
1056
- makeLoggingConsoleKit: cells[35].makeLoggingConsoleKit.set,
1057
- pumpLogToConsole: cells[35].pumpLogToConsole.set,
1058
- makeCausalConsole: cells[35].makeCausalConsole.set,
1059
- defineCausalConsoleFromLogger: cells[35].defineCausalConsoleFromLogger.set,
1060
- filterConsole: cells[35].filterConsole.set,
1064
+ tameModuleSource: cells[35].tameModuleSource.set,
1061
1065
  },
1062
1066
  importMeta: {},
1063
1067
  });
@@ -1069,7 +1073,13 @@ function observeImports(map, importName, importIndex) {
1069
1073
  liveVar: {
1070
1074
  },
1071
1075
  onceVar: {
1072
- makeRejectionHandlers: cells[36].makeRejectionHandlers.set,
1076
+ consoleLevelMethods: cells[36].consoleLevelMethods.set,
1077
+ consoleOtherMethods: cells[36].consoleOtherMethods.set,
1078
+ makeLoggingConsoleKit: cells[36].makeLoggingConsoleKit.set,
1079
+ pumpLogToConsole: cells[36].pumpLogToConsole.set,
1080
+ makeCausalConsole: cells[36].makeCausalConsole.set,
1081
+ defineCausalConsoleFromLogger: cells[36].defineCausalConsoleFromLogger.set,
1082
+ filterConsole: cells[36].filterConsole.set,
1073
1083
  },
1074
1084
  importMeta: {},
1075
1085
  });
@@ -1077,14 +1087,11 @@ function observeImports(map, importName, importIndex) {
1077
1087
  imports(entries) {
1078
1088
  const map = new Map(entries);
1079
1089
  observeImports(map, "../commons.js", 0);
1080
- observeImports(map, "./assert.js", 9);
1081
- observeImports(map, "./console.js", 35);
1082
- observeImports(map, "./unhandled-rejection.js", 36);
1083
1090
  },
1084
1091
  liveVar: {
1085
1092
  },
1086
1093
  onceVar: {
1087
- tameConsole: cells[37].tameConsole.set,
1094
+ makeRejectionHandlers: cells[37].makeRejectionHandlers.set,
1088
1095
  },
1089
1096
  importMeta: {},
1090
1097
  });
@@ -1092,13 +1099,14 @@ function observeImports(map, importName, importIndex) {
1092
1099
  imports(entries) {
1093
1100
  const map = new Map(entries);
1094
1101
  observeImports(map, "../commons.js", 0);
1102
+ observeImports(map, "./assert.js", 9);
1103
+ observeImports(map, "./console.js", 36);
1104
+ observeImports(map, "./unhandled-rejection.js", 37);
1095
1105
  },
1096
1106
  liveVar: {
1097
1107
  },
1098
1108
  onceVar: {
1099
- filterFileName: cells[38].filterFileName.set,
1100
- shortenCallSiteString: cells[38].shortenCallSiteString.set,
1101
- tameV8ErrorConstructor: cells[38].tameV8ErrorConstructor.set,
1109
+ tameConsole: cells[38].tameConsole.set,
1102
1110
  },
1103
1111
  importMeta: {},
1104
1112
  });
@@ -1106,75 +1114,73 @@ function observeImports(map, importName, importIndex) {
1106
1114
  imports(entries) {
1107
1115
  const map = new Map(entries);
1108
1116
  observeImports(map, "../commons.js", 0);
1109
- observeImports(map, "../permits.js", 11);
1110
- observeImports(map, "./tame-v8-error-constructor.js", 38);
1111
1117
  },
1112
1118
  liveVar: {
1113
1119
  },
1114
1120
  onceVar: {
1115
- default: cells[39].default.set,
1121
+ filterFileName: cells[39].filterFileName.set,
1122
+ shortenCallSiteString: cells[39].shortenCallSiteString.set,
1123
+ tameV8ErrorConstructor: cells[39].tameV8ErrorConstructor.set,
1116
1124
  },
1117
1125
  importMeta: {},
1118
1126
  });
1119
1127
  functors[40]({
1120
1128
  imports(entries) {
1121
1129
  const map = new Map(entries);
1122
- observeImports(map, "@endo/env-options", 3);
1123
- observeImports(map, "./commons.js", 0);
1124
- observeImports(map, "./error/assert.js", 9);
1130
+ observeImports(map, "../commons.js", 0);
1131
+ observeImports(map, "../permits.js", 12);
1132
+ observeImports(map, "./tame-v8-error-constructor.js", 39);
1125
1133
  },
1126
1134
  liveVar: {
1127
1135
  },
1128
1136
  onceVar: {
1129
- makeAlias: cells[40].makeAlias.set,
1130
- load: cells[40].load.set,
1131
- loadNow: cells[40].loadNow.set,
1137
+ default: cells[40].default.set,
1132
1138
  },
1133
1139
  importMeta: {},
1134
1140
  });
1135
1141
  functors[41]({
1136
1142
  imports(entries) {
1137
1143
  const map = new Map(entries);
1138
- observeImports(map, "./module-load.js", 40);
1144
+ observeImports(map, "@endo/env-options", 3);
1139
1145
  observeImports(map, "./commons.js", 0);
1140
1146
  observeImports(map, "./error/assert.js", 9);
1141
1147
  },
1142
1148
  liveVar: {
1143
1149
  },
1144
1150
  onceVar: {
1145
- deferExports: cells[41].deferExports.set,
1146
- getDeferredExports: cells[41].getDeferredExports.set,
1151
+ makeAlias: cells[41].makeAlias.set,
1152
+ load: cells[41].load.set,
1153
+ loadNow: cells[41].loadNow.set,
1147
1154
  },
1148
1155
  importMeta: {},
1149
1156
  });
1150
1157
  functors[42]({
1151
1158
  imports(entries) {
1152
1159
  const map = new Map(entries);
1160
+ observeImports(map, "./module-load.js", 41);
1153
1161
  observeImports(map, "./commons.js", 0);
1154
- observeImports(map, "./transforms.js", 28);
1155
- observeImports(map, "./make-safe-evaluator.js", 31);
1162
+ observeImports(map, "./error/assert.js", 9);
1156
1163
  },
1157
1164
  liveVar: {
1158
1165
  },
1159
1166
  onceVar: {
1160
- provideCompartmentEvaluator: cells[42].provideCompartmentEvaluator.set,
1161
- compartmentEvaluate: cells[42].compartmentEvaluate.set,
1167
+ deferExports: cells[42].deferExports.set,
1168
+ getDeferredExports: cells[42].getDeferredExports.set,
1162
1169
  },
1163
1170
  importMeta: {},
1164
1171
  });
1165
1172
  functors[43]({
1166
1173
  imports(entries) {
1167
1174
  const map = new Map(entries);
1168
- observeImports(map, "./error/assert.js", 9);
1169
- observeImports(map, "./module-proxy.js", 41);
1170
1175
  observeImports(map, "./commons.js", 0);
1171
- observeImports(map, "./compartment-evaluate.js", 42);
1176
+ observeImports(map, "./transforms.js", 29);
1177
+ observeImports(map, "./make-safe-evaluator.js", 32);
1172
1178
  },
1173
1179
  liveVar: {
1174
1180
  },
1175
1181
  onceVar: {
1176
- makeVirtualModuleInstance: cells[43].makeVirtualModuleInstance.set,
1177
- makeModuleInstance: cells[43].makeModuleInstance.set,
1182
+ provideCompartmentEvaluator: cells[43].provideCompartmentEvaluator.set,
1183
+ compartmentEvaluate: cells[43].compartmentEvaluate.set,
1178
1184
  },
1179
1185
  importMeta: {},
1180
1186
  });
@@ -1182,36 +1188,30 @@ function observeImports(map, importName, importIndex) {
1182
1188
  imports(entries) {
1183
1189
  const map = new Map(entries);
1184
1190
  observeImports(map, "./error/assert.js", 9);
1185
- observeImports(map, "./module-instance.js", 43);
1191
+ observeImports(map, "./module-proxy.js", 42);
1186
1192
  observeImports(map, "./commons.js", 0);
1193
+ observeImports(map, "./compartment-evaluate.js", 43);
1187
1194
  },
1188
1195
  liveVar: {
1189
1196
  },
1190
1197
  onceVar: {
1191
- link: cells[44].link.set,
1192
- instantiate: cells[44].instantiate.set,
1198
+ makeVirtualModuleInstance: cells[44].makeVirtualModuleInstance.set,
1199
+ makeModuleInstance: cells[44].makeModuleInstance.set,
1193
1200
  },
1194
1201
  importMeta: {},
1195
1202
  });
1196
1203
  functors[45]({
1197
1204
  imports(entries) {
1198
1205
  const map = new Map(entries);
1199
- observeImports(map, "./commons.js", 0);
1200
- observeImports(map, "./global-object.js", 23);
1201
1206
  observeImports(map, "./error/assert.js", 9);
1202
- observeImports(map, "./permits.js", 11);
1203
- observeImports(map, "./module-load.js", 40);
1204
- observeImports(map, "./module-link.js", 44);
1205
- observeImports(map, "./module-proxy.js", 41);
1206
- observeImports(map, "./compartment-evaluate.js", 42);
1207
- observeImports(map, "./make-safe-evaluator.js", 31);
1207
+ observeImports(map, "./module-instance.js", 44);
1208
+ observeImports(map, "./commons.js", 0);
1208
1209
  },
1209
1210
  liveVar: {
1210
1211
  },
1211
1212
  onceVar: {
1212
- InertCompartment: cells[45].InertCompartment.set,
1213
- CompartmentPrototype: cells[45].CompartmentPrototype.set,
1214
- makeCompartmentConstructor: cells[45].makeCompartmentConstructor.set,
1213
+ link: cells[45].link.set,
1214
+ instantiate: cells[45].instantiate.set,
1215
1215
  },
1216
1216
  importMeta: {},
1217
1217
  });
@@ -1219,12 +1219,22 @@ function observeImports(map, importName, importIndex) {
1219
1219
  imports(entries) {
1220
1220
  const map = new Map(entries);
1221
1221
  observeImports(map, "./commons.js", 0);
1222
- observeImports(map, "./compartment.js", 45);
1222
+ observeImports(map, "./global-object.js", 24);
1223
+ observeImports(map, "./error/assert.js", 9);
1224
+ observeImports(map, "./permits.js", 12);
1225
+ observeImports(map, "./module-load.js", 41);
1226
+ observeImports(map, "./module-link.js", 45);
1227
+ observeImports(map, "./module-proxy.js", 42);
1228
+ observeImports(map, "./compartment-evaluate.js", 43);
1229
+ observeImports(map, "./make-safe-evaluator.js", 32);
1223
1230
  },
1224
1231
  liveVar: {
1225
1232
  },
1226
1233
  onceVar: {
1227
- getAnonymousIntrinsics: cells[46].getAnonymousIntrinsics.set,
1234
+ InertCompartment: cells[46].InertCompartment.set,
1235
+ CompartmentPrototype: cells[46].CompartmentPrototype.set,
1236
+ compartmentOptions: cells[46].compartmentOptions.set,
1237
+ makeCompartmentConstructor: cells[46].makeCompartmentConstructor.set,
1228
1238
  },
1229
1239
  importMeta: {},
1230
1240
  });
@@ -1232,11 +1242,12 @@ function observeImports(map, importName, importIndex) {
1232
1242
  imports(entries) {
1233
1243
  const map = new Map(entries);
1234
1244
  observeImports(map, "./commons.js", 0);
1245
+ observeImports(map, "./compartment.js", 46);
1235
1246
  },
1236
1247
  liveVar: {
1237
1248
  },
1238
1249
  onceVar: {
1239
- tameHarden: cells[47].tameHarden.set,
1250
+ getAnonymousIntrinsics: cells[47].getAnonymousIntrinsics.set,
1240
1251
  },
1241
1252
  importMeta: {},
1242
1253
  });
@@ -1248,7 +1259,7 @@ function observeImports(map, importName, importIndex) {
1248
1259
  liveVar: {
1249
1260
  },
1250
1261
  onceVar: {
1251
- tameSymbolConstructor: cells[48].tameSymbolConstructor.set,
1262
+ tameHarden: cells[48].tameHarden.set,
1252
1263
  },
1253
1264
  importMeta: {},
1254
1265
  });
@@ -1260,8 +1271,7 @@ function observeImports(map, importName, importIndex) {
1260
1271
  liveVar: {
1261
1272
  },
1262
1273
  onceVar: {
1263
- tameFauxDataProperty: cells[49].tameFauxDataProperty.set,
1264
- tameFauxDataProperties: cells[49].tameFauxDataProperties.set,
1274
+ tameSymbolConstructor: cells[49].tameSymbolConstructor.set,
1265
1275
  },
1266
1276
  importMeta: {},
1267
1277
  });
@@ -1273,7 +1283,8 @@ function observeImports(map, importName, importIndex) {
1273
1283
  liveVar: {
1274
1284
  },
1275
1285
  onceVar: {
1276
- tameRegeneratorRuntime: cells[50].tameRegeneratorRuntime.set,
1286
+ tameFauxDataProperty: cells[50].tameFauxDataProperty.set,
1287
+ tameFauxDataProperties: cells[50].tameFauxDataProperties.set,
1277
1288
  },
1278
1289
  importMeta: {},
1279
1290
  });
@@ -1285,54 +1296,81 @@ function observeImports(map, importName, importIndex) {
1285
1296
  liveVar: {
1286
1297
  },
1287
1298
  onceVar: {
1288
- shimArrayBufferTransfer: cells[51].shimArrayBufferTransfer.set,
1299
+ tameRegeneratorRuntime: cells[51].tameRegeneratorRuntime.set,
1289
1300
  },
1290
1301
  importMeta: {},
1291
1302
  });
1292
1303
  functors[52]({
1304
+ imports(entries) {
1305
+ const map = new Map(entries);
1306
+ observeImports(map, "./commons.js", 0);
1307
+ },
1308
+ liveVar: {
1309
+ },
1310
+ onceVar: {
1311
+ shimArrayBufferTransfer: cells[52].shimArrayBufferTransfer.set,
1312
+ },
1313
+ importMeta: {},
1314
+ });
1315
+ functors[53]({
1316
+ imports(entries) {
1317
+ const map = new Map(entries);
1318
+ observeImports(map, "./commons.js", 0);
1319
+ observeImports(map, "./error/assert.js", 9);
1320
+ },
1321
+ liveVar: {
1322
+ },
1323
+ onceVar: {
1324
+ chooseReporter: cells[53].chooseReporter.set,
1325
+ reportInGroup: cells[53].reportInGroup.set,
1326
+ },
1327
+ importMeta: {},
1328
+ });
1329
+ functors[54]({
1293
1330
  imports(entries) {
1294
1331
  const map = new Map(entries);
1295
1332
  observeImports(map, "@endo/env-options", 3);
1296
1333
  observeImports(map, "./commons.js", 0);
1297
1334
  observeImports(map, "./make-hardener.js", 10);
1298
- observeImports(map, "./intrinsics.js", 12);
1299
- observeImports(map, "./permits-intrinsics.js", 13);
1300
- observeImports(map, "./tame-function-constructors.js", 14);
1301
- observeImports(map, "./tame-date-constructor.js", 15);
1302
- observeImports(map, "./tame-math-object.js", 16);
1303
- observeImports(map, "./tame-regexp-constructor.js", 17);
1304
- observeImports(map, "./enable-property-overrides.js", 19);
1305
- observeImports(map, "./tame-locale-methods.js", 20);
1306
- observeImports(map, "./global-object.js", 23);
1307
- observeImports(map, "./make-safe-evaluator.js", 31);
1308
- observeImports(map, "./permits.js", 11);
1309
- observeImports(map, "./tame-function-tostring.js", 32);
1310
- observeImports(map, "./tame-domains.js", 33);
1311
- observeImports(map, "./tame-module-source.js", 34);
1312
- observeImports(map, "./error/tame-console.js", 37);
1313
- observeImports(map, "./error/tame-error-constructor.js", 39);
1335
+ observeImports(map, "./intrinsics.js", 13);
1336
+ observeImports(map, "./permits-intrinsics.js", 14);
1337
+ observeImports(map, "./tame-function-constructors.js", 15);
1338
+ observeImports(map, "./tame-date-constructor.js", 16);
1339
+ observeImports(map, "./tame-math-object.js", 17);
1340
+ observeImports(map, "./tame-regexp-constructor.js", 18);
1341
+ observeImports(map, "./enable-property-overrides.js", 20);
1342
+ observeImports(map, "./tame-locale-methods.js", 21);
1343
+ observeImports(map, "./global-object.js", 24);
1344
+ observeImports(map, "./make-safe-evaluator.js", 32);
1345
+ observeImports(map, "./permits.js", 12);
1346
+ observeImports(map, "./tame-function-tostring.js", 33);
1347
+ observeImports(map, "./tame-domains.js", 34);
1348
+ observeImports(map, "./tame-module-source.js", 35);
1349
+ observeImports(map, "./error/tame-console.js", 38);
1350
+ observeImports(map, "./error/tame-error-constructor.js", 40);
1314
1351
  observeImports(map, "./error/assert.js", 9);
1315
- observeImports(map, "./get-anonymous-intrinsics.js", 46);
1316
- observeImports(map, "./compartment.js", 45);
1317
- observeImports(map, "./tame-harden.js", 47);
1318
- observeImports(map, "./tame-symbol-constructor.js", 48);
1319
- observeImports(map, "./tame-faux-data-properties.js", 49);
1320
- observeImports(map, "./tame-regenerator-runtime.js", 50);
1321
- observeImports(map, "./shim-arraybuffer-transfer.js", 51);
1352
+ observeImports(map, "./get-anonymous-intrinsics.js", 47);
1353
+ observeImports(map, "./compartment.js", 46);
1354
+ observeImports(map, "./tame-harden.js", 48);
1355
+ observeImports(map, "./tame-symbol-constructor.js", 49);
1356
+ observeImports(map, "./tame-faux-data-properties.js", 50);
1357
+ observeImports(map, "./tame-regenerator-runtime.js", 51);
1358
+ observeImports(map, "./shim-arraybuffer-transfer.js", 52);
1359
+ observeImports(map, "./reporting.js", 53);
1322
1360
  },
1323
1361
  liveVar: {
1324
1362
  },
1325
1363
  onceVar: {
1326
- repairIntrinsics: cells[52].repairIntrinsics.set,
1364
+ repairIntrinsics: cells[54].repairIntrinsics.set,
1327
1365
  },
1328
1366
  importMeta: {},
1329
1367
  });
1330
- functors[53]({
1368
+ functors[55]({
1331
1369
  imports(entries) {
1332
1370
  const map = new Map(entries);
1333
1371
  observeImports(map, "./assert-sloppy-mode.js", 1);
1334
1372
  observeImports(map, "./commons.js", 0);
1335
- observeImports(map, "./lockdown.js", 52);
1373
+ observeImports(map, "./lockdown.js", 54);
1336
1374
  },
1337
1375
  liveVar: {
1338
1376
  },
@@ -1340,13 +1378,14 @@ function observeImports(map, importName, importIndex) {
1340
1378
  },
1341
1379
  importMeta: {},
1342
1380
  });
1343
- functors[54]({
1381
+ functors[56]({
1344
1382
  imports(entries) {
1345
1383
  const map = new Map(entries);
1346
1384
  observeImports(map, "./commons.js", 0);
1347
- observeImports(map, "./compartment.js", 45);
1348
- observeImports(map, "./tame-function-tostring.js", 32);
1349
- observeImports(map, "./intrinsics.js", 12);
1385
+ observeImports(map, "./compartment.js", 46);
1386
+ observeImports(map, "./tame-function-tostring.js", 33);
1387
+ observeImports(map, "./intrinsics.js", 13);
1388
+ observeImports(map, "./reporting.js", 53);
1350
1389
  },
1351
1390
  liveVar: {
1352
1391
  },
@@ -1354,7 +1393,7 @@ function observeImports(map, importName, importIndex) {
1354
1393
  },
1355
1394
  importMeta: {},
1356
1395
  });
1357
- functors[55]({
1396
+ functors[57]({
1358
1397
  imports(entries) {
1359
1398
  const map = new Map(entries);
1360
1399
  observeImports(map, "./commons.js", 0);
@@ -1366,11 +1405,11 @@ function observeImports(map, importName, importIndex) {
1366
1405
  },
1367
1406
  importMeta: {},
1368
1407
  });
1369
- functors[56]({
1408
+ functors[58]({
1370
1409
  imports(entries) {
1371
1410
  const map = new Map(entries);
1372
1411
  observeImports(map, "./commons.js", 0);
1373
- observeImports(map, "./error/console.js", 35);
1412
+ observeImports(map, "./error/console.js", 36);
1374
1413
  observeImports(map, "./error/assert.js", 9);
1375
1414
  },
1376
1415
  liveVar: {
@@ -1379,13 +1418,13 @@ function observeImports(map, importName, importIndex) {
1379
1418
  },
1380
1419
  importMeta: {},
1381
1420
  });
1382
- functors[57]({
1421
+ functors[59]({
1383
1422
  imports(entries) {
1384
1423
  const map = new Map(entries);
1385
- observeImports(map, "./src/lockdown-shim.js", 53);
1386
- observeImports(map, "./src/compartment-shim.js", 54);
1387
- observeImports(map, "./src/assert-shim.js", 55);
1388
- observeImports(map, "./src/console-shim.js", 56);
1424
+ observeImports(map, "./src/lockdown-shim.js", 55);
1425
+ observeImports(map, "./src/compartment-shim.js", 56);
1426
+ observeImports(map, "./src/assert-shim.js", 57);
1427
+ observeImports(map, "./src/console-shim.js", 58);
1389
1428
  },
1390
1429
  liveVar: {
1391
1430
  },
@@ -1396,20 +1435,22 @@ function observeImports(map, importName, importIndex) {
1396
1435
 
1397
1436
  return cells[cells.length - 1]['*'].get();
1398
1437
  })([// === functors[0] ===
1399
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([]); /* global globalThis */
1400
- /* eslint-disable no-restricted-globals */
1401
-
1402
- /**
1403
- * commons.js
1404
- * Declare shorthand functions. Sharing these declarations across modules
1405
- * improves on consistency and minification. Unused declarations are
1406
- * dropped by the tree shaking process.
1407
- *
1408
- * We capture these, not just for brevity, but for security. If any code
1409
- * modifies Object to change what 'assign' points to, the Compartment shim
1410
- * would be corrupted.
1438
+ ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, import: $h͏_import, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([]); /**
1439
+ * @module Captures native intrinsics during initialization, so vetted shims
1440
+ * (running between initialization of SES and calling lockdown) are free to
1441
+ * modify the environment without compromising the integrity of SES. For
1442
+ * example, a vetted shim can modify Object.assign because we capture and
1443
+ * export Object and assign here, then never again consult Object to get its
1444
+ * assign property.
1445
+ *
1446
+ * This pattern of use is enforced by eslint rules no-restricted-globals and
1447
+ * no-polymorphic-call.
1448
+ * We maintain the list of restricted globals in ../package.json.
1411
1449
  */
1412
1450
 
1451
+ /* global globalThis */
1452
+ /* eslint-disable no-restricted-globals */
1453
+
1413
1454
  // We cannot use globalThis as the local name since it would capture the
1414
1455
  // lexical name.
1415
1456
  const universalThis= globalThis;$h͏_once.universalThis(universalThis);
@@ -1665,12 +1706,6 @@ const finalizationRegistryUnregister=
1665
1706
  const getConstructorOf= (fn)=>
1666
1707
  reflectGet(getPrototypeOf(fn), 'constructor');
1667
1708
 
1668
- /**
1669
- * immutableObject
1670
- * An immutable (frozen) empty object that is safe to share.
1671
- */$h͏_once.getConstructorOf(getConstructorOf);
1672
- const immutableObject= freeze(create(null));
1673
-
1674
1709
  /**
1675
1710
  * isObject tests whether a value is an object.
1676
1711
  * Today, this is equivalent to:
@@ -1687,7 +1722,7 @@ const immutableObject= freeze(create(null));
1687
1722
  * attempting to box a primitive.
1688
1723
  *
1689
1724
  * @param {any} value
1690
- */$h͏_once.immutableObject(immutableObject);
1725
+ */$h͏_once.getConstructorOf(getConstructorOf);
1691
1726
  const isObject= (value)=>Object(value)=== value;
1692
1727
 
1693
1728
  /**
@@ -1703,11 +1738,17 @@ const isObject= (value)=>Object(value)=== value;
1703
1738
  */$h͏_once.isObject(isObject);
1704
1739
  const isError= (value)=>value instanceof FERAL_ERROR;
1705
1740
 
1741
+ /**
1742
+ * @template T
1743
+ * @param {T} x
1744
+ */$h͏_once.isError(isError);
1745
+ const identity= (x)=>x;
1746
+
1706
1747
  // The original unsafe untamed eval function, which must not escape.
1707
1748
  // Sample at module initialization time, which is before lockdown can
1708
1749
  // repair it. Use it only to build powerless abstractions.
1709
1750
  // eslint-disable-next-line no-eval
1710
- $h͏_once.isError(isError);const FERAL_EVAL=eval;
1751
+ $h͏_once.identity(identity);const FERAL_EVAL=eval;
1711
1752
 
1712
1753
  // The original unsafe untamed Function constructor, which must not escape.
1713
1754
  // Sample at module initialization time, which is before lockdown can
@@ -1779,7 +1820,7 @@ const FERAL_STACK_SETTER= feralStackSetter;$h͏_once.FERAL_STACK_SETTER(
1779
1820
  })()
1780
1821
  ,
1781
1822
  // === functors[1] ===
1782
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let TypeError;$h͏_imports([["./commons.js", [["TypeError", [$h͏_a => (TypeError = $h͏_a)]]]]]);
1823
+ ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, import: $h͏_import, importMeta: $h͏____meta, }) => (function () { 'use strict'; let TypeError;$h͏_imports([["./commons.js", [["TypeError", [$h͏_a => (TypeError = $h͏_a)]]]]]);
1783
1824
 
1784
1825
  /** getThis returns globalThis in sloppy mode or undefined in strict mode. */
1785
1826
  function getThis() {
@@ -1793,7 +1834,7 @@ if( getThis()) {
1793
1834
  })()
1794
1835
  ,
1795
1836
  // === functors[2] ===
1796
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([]); /* global globalThis */
1837
+ ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, import: $h͏_import, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([]); /* global globalThis */
1797
1838
  // @ts-check
1798
1839
 
1799
1840
  // `@endo/env-options` needs to be imported quite early, and so should
@@ -1933,11 +1974,11 @@ const {
1933
1974
  })()
1934
1975
  ,
1935
1976
  // === functors[3] ===
1936
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([["./src/env-options.js", []]]);
1977
+ ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, import: $h͏_import, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([["./src/env-options.js", []]]);
1937
1978
  })()
1938
1979
  ,
1939
1980
  // === functors[4] ===
1940
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
1981
+ ({ 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)]]]]]);
1941
1982
 
1942
1983
 
1943
1984
 
@@ -2134,7 +2175,7 @@ freeze(bestEffortStringify);
2134
2175
  })()
2135
2176
  ,
2136
2177
  // === functors[5] ===
2137
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([]); // @ts-check
2178
+ ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, import: $h͏_import, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([]); // @ts-check
2138
2179
 
2139
2180
  /** @import {GenericErrorConstructor, AssertMakeErrorOptions, DetailsToken, StringablePayload} from '../../types.js' */
2140
2181
 
@@ -2196,7 +2237,7 @@ freeze(bestEffortStringify);
2196
2237
  })()
2197
2238
  ,
2198
2239
  // === functors[6] ===
2199
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([]); // @ts-check
2240
+ ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, import: $h͏_import, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([]); // @ts-check
2200
2241
 
2201
2242
  /**
2202
2243
  * @import {VirtualConsole} from './types.js'
@@ -2260,7 +2301,7 @@ freeze(bestEffortStringify);
2260
2301
  /**
2261
2302
  * @callback MakeLoggingConsoleKit
2262
2303
  *
2263
- * A logging console just accumulates the contents of all whitelisted calls,
2304
+ * A logging console just accumulates the contents of all permitted calls,
2264
2305
  * making them available to callers of `takeLog()`. Calling `takeLog()`
2265
2306
  * consumes these, so later calls to `takeLog()` will only provide a log of
2266
2307
  * calls that have happened since then.
@@ -2297,7 +2338,7 @@ freeze(bestEffortStringify);
2297
2338
  })()
2298
2339
  ,
2299
2340
  // === functors[7] ===
2300
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([]); // @ts-check
2341
+ ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, import: $h͏_import, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([]); // @ts-check
2301
2342
  /* eslint-disable @endo/no-polymorphic-call */
2302
2343
 
2303
2344
  // eslint-disable-next-line no-restricted-globals
@@ -2521,7 +2562,7 @@ freeze(makeLRUCacheMap);
2521
2562
  })()
2522
2563
  ,
2523
2564
  // === functors[8] ===
2524
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let makeLRUCacheMap;$h͏_imports([["../make-lru-cachemap.js", [["makeLRUCacheMap", [$h͏_a => (makeLRUCacheMap = $h͏_a)]]]]]);
2565
+ ({ 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)]]]]]);
2525
2566
 
2526
2567
 
2527
2568
 
@@ -2600,7 +2641,7 @@ freeze(makeNoteLogArgsArrayKit);
2600
2641
  })()
2601
2642
  ,
2602
2643
  // === functors[9] ===
2603
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
2644
+ ({ 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)]]]]]);
2604
2645
 
2605
2646
 
2606
2647
 
@@ -3178,7 +3219,7 @@ const assertEqual= assert.equal;$h͏_once.assertEqual(assertEqual);
3178
3219
  })()
3179
3220
  ,
3180
3221
  // === functors[10] ===
3181
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
3222
+ ({ 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)]]]]]);
3182
3223
 
3183
3224
 
3184
3225
 
@@ -3456,7 +3497,79 @@ const makeHardener= ()=> {
3456
3497
  })()
3457
3498
  ,
3458
3499
  // === functors[11] ===
3459
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let arrayPush;$h͏_imports([["./commons.js", [["arrayPush", [$h͏_a => (arrayPush = $h͏_a)]]]]]);
3500
+ ({ 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)]]]]]);
3501
+
3502
+ /**
3503
+ * @import {Reporter} from './reporting-types.js'
3504
+ */
3505
+
3506
+ /**
3507
+ * Delete `obj[prop]` or at least make it harmless.
3508
+ *
3509
+ * If the property was not expected, then emit a reporter-dependent warning
3510
+ * to bring attention to this case, so someone can determine what to do with it.
3511
+ *
3512
+ * If the property to be deleted is a function's `.prototype` property, this
3513
+ * will normally be because the function was supposed to be a
3514
+ * - builtin method or non-constructor function
3515
+ * - arrow function
3516
+ * - concise method
3517
+ *
3518
+ * all of whom are not supposed to have a `.prototype` property. Nevertheless,
3519
+ * on some platforms (like older versions of Hermes), or as a result of
3520
+ * some shim-based mods to the primordials (like core-js?), some of these
3521
+ * functions may accidentally be more like `function` functions with
3522
+ * an undeletable `.prototype` property. In these cases, if we can
3523
+ * set the value of that bogus `.prototype` property to `undefined`,
3524
+ * we do so, issuing a warning, rather than failing to initialize ses.
3525
+ *
3526
+ * @param {object} obj
3527
+ * @param {PropertyKey} prop
3528
+ * @param {boolean} known If deletion is expected, don't warn
3529
+ * @param {string} subPath Used for warning messages
3530
+ * @param {Reporter} reporter Where to issue warning or error.
3531
+ * @returns {void}
3532
+ */
3533
+ const cauterizeProperty= (
3534
+ obj,
3535
+ prop,
3536
+ known,
3537
+ subPath,
3538
+ { warn, error})=>
3539
+ {
3540
+ // Either the object lacks a permit or the object doesn't match the
3541
+ // permit.
3542
+ // If the permit is specifically false, not merely undefined,
3543
+ // this is a property we expect to see because we know it exists in
3544
+ // some environments and we have expressly decided to exclude it.
3545
+ // Any other disallowed property is one we have not audited and we log
3546
+ // that we are removing it so we know to look into it, as happens when
3547
+ // the language evolves new features to existing intrinsics.
3548
+ if( !known) {
3549
+ warn( `Removing ${subPath}`);
3550
+ }
3551
+ try {
3552
+ delete obj[prop];
3553
+ }catch( err) {
3554
+ if( objectHasOwnProperty(obj, prop)) {
3555
+ if( typeof obj=== 'function'&& prop=== 'prototype') {
3556
+ obj.prototype= undefined;
3557
+ if( obj.prototype=== undefined) {
3558
+ warn( `Tolerating undeletable ${subPath} === undefined`);
3559
+ return;
3560
+ }
3561
+ }
3562
+ error( `failed to delete ${subPath}`,err);
3563
+ }else {
3564
+ error( `deleting ${subPath} threw`,err);
3565
+ }
3566
+ throw err;
3567
+ }
3568
+ };$h͏_once.cauterizeProperty(cauterizeProperty);
3569
+ })()
3570
+ ,
3571
+ // === functors[12] ===
3572
+ ({ 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)]]]]]);
3460
3573
 
3461
3574
 
3462
3575
 
@@ -3464,7 +3577,7 @@ const makeHardener= ()=> {
3464
3577
  /** @import {GenericErrorConstructor} from '../types.js' */
3465
3578
 
3466
3579
  /**
3467
- * @file Exports {@code whitelist}, a recursively defined
3580
+ * @module Exports {@code permits}, a recursively defined
3468
3581
  * JSON record enumerating all intrinsics and their properties
3469
3582
  * according to ECMA specs.
3470
3583
  *
@@ -3490,7 +3603,7 @@ const constantProperties= {
3490
3603
  * universalPropertyNames
3491
3604
  * Properties of all global objects.
3492
3605
  * Must be powerless.
3493
- * Maps from property name to the intrinsic name in the whitelist.
3606
+ * Maps from property name to the intrinsic name in the permits.
3494
3607
  */$h͏_once.constantProperties(constantProperties);
3495
3608
  const universalPropertyNames= {
3496
3609
  // *** Function Properties of the Global Object
@@ -3547,6 +3660,15 @@ const universalPropertyNames= {
3547
3660
  // https://github.com/endojs/endo/issues/550
3548
3661
  AggregateError: 'AggregateError',
3549
3662
 
3663
+ // https://github.com/tc39/proposal-explicit-resource-management
3664
+ // TODO DisposableStack, AsyncDisposableStack
3665
+ // DisposableStack: 'DisposableStack',
3666
+ // AsyncDisposableStack: 'AsyncDisposableStack',
3667
+
3668
+ // https://tc39.es/proposal-shadowrealm/
3669
+ // TODO ShadowRealm
3670
+ // ShadowRealm: 'ShadowRealm',
3671
+
3550
3672
  // *** Other Properties of the Global Object
3551
3673
 
3552
3674
  JSON: 'JSON',
@@ -3573,7 +3695,7 @@ const universalPropertyNames= {
3573
3695
  * Those found only on the initial global, i.e., the global of the
3574
3696
  * start compartment, as well as any compartments created before lockdown.
3575
3697
  * These may provide much of the power provided by the original.
3576
- * Maps from property name to the intrinsic name in the whitelist.
3698
+ * Maps from property name to the intrinsic name in the permits.
3577
3699
  */$h͏_once.universalPropertyNames(universalPropertyNames);
3578
3700
  const initialGlobalPropertyNames= {
3579
3701
  // *** Constructor Properties of the Global Object
@@ -3583,7 +3705,7 @@ const initialGlobalPropertyNames= {
3583
3705
  RegExp: '%InitialRegExp%',
3584
3706
 
3585
3707
  // Omit `Symbol`, because we want the original to appear on the
3586
- // start compartment without passing through the whitelist mechanism, since
3708
+ // start compartment without passing through the permits mechanism, since
3587
3709
  // we want to preserve all its properties, even if we never heard of them.
3588
3710
  // Symbol: '%InitialSymbol%',
3589
3711
 
@@ -3601,13 +3723,17 @@ const initialGlobalPropertyNames= {
3601
3723
  // TODO https://github.com/Agoric/SES-shim/issues/551
3602
3724
  // Need initial WeakRef and FinalizationGroup in
3603
3725
  // start compartment only.
3726
+
3727
+ // TODO Temporal
3728
+ // https://github.com/tc39/proposal-temporal
3729
+ // Temporal: '%InitialTemporal%' // with Temporal.Now
3604
3730
  };
3605
3731
 
3606
3732
  /**
3607
3733
  * sharedGlobalPropertyNames
3608
3734
  * Those found only on the globals of new compartments created after lockdown,
3609
3735
  * which must therefore be powerless.
3610
- * Maps from property name to the intrinsic name in the whitelist.
3736
+ * Maps from property name to the intrinsic name in the permits.
3611
3737
  */$h͏_once.initialGlobalPropertyNames(initialGlobalPropertyNames);
3612
3738
  const sharedGlobalPropertyNames= {
3613
3739
  // *** Constructor Properties of the Global Object
@@ -3619,14 +3745,18 @@ const sharedGlobalPropertyNames= {
3619
3745
 
3620
3746
  // *** Other Properties of the Global Object
3621
3747
 
3622
- Math: '%SharedMath%'};
3748
+ Math: '%SharedMath%'
3623
3749
 
3750
+ // TODO Temporal
3751
+ // https://github.com/tc39/proposal-temporal
3752
+ // Temporal: '%SharedTemporal%' // without Temporal.Now
3753
+ };
3624
3754
 
3625
3755
  /**
3626
3756
  * uniqueGlobalPropertyNames
3627
3757
  * Those made separately for each global, including the initial global
3628
3758
  * of the start compartment.
3629
- * Maps from property name to the intrinsic name in the whitelist
3759
+ * Maps from property name to the intrinsic name in the permits
3630
3760
  * (which is currently always the same).
3631
3761
  */$h͏_once.sharedGlobalPropertyNames(sharedGlobalPropertyNames);
3632
3762
  const uniqueGlobalPropertyNames= {
@@ -3686,18 +3816,18 @@ if( typeof AggregateError!== 'undefined') {
3686
3816
  * blacklisted and simply removed. Properties not mentioned
3687
3817
  * are also considered blacklisted and are removed.
3688
3818
  * <li>A string value equal to a primitive ("number", "string", etc),
3689
- * in which case the property is whitelisted if its value property
3819
+ * in which case the property is permitted if its value property
3690
3820
  * is typeof the given type. For example, {@code "Infinity"} leads to
3691
3821
  * "number" and property values that fail {@code typeof "number"}.
3692
3822
  * are removed.
3693
3823
  * <li>A string value equal to an intinsic name ("ObjectPrototype",
3694
- * "Array", etc), in which case the property whitelisted if its
3824
+ * "Array", etc), in which case the property permitted if its
3695
3825
  * value property is equal to the value of the corresponfing
3696
3826
  * intrinsics. For example, {@code Map.prototype} leads to
3697
3827
  * "MapPrototype" and the property is removed if its value is
3698
3828
  * not equal to %MapPrototype%
3699
3829
  * <li>Another record, in which case this property is simply
3700
- * whitelisted and that next record represents the disposition of
3830
+ * permitted and that next record represents the disposition of
3701
3831
  * the object which is its value. For example, {@code "Object"}
3702
3832
  * leads to another record explaining what properties {@code
3703
3833
  * "Object"} may have and how each such property should be treated.
@@ -3757,6 +3887,24 @@ const accessor= {
3757
3887
  set: fn};
3758
3888
 
3759
3889
 
3890
+ // eslint-disable-next-line func-names
3891
+ const strict= function() {
3892
+ 'use strict';
3893
+ };
3894
+
3895
+ // TODO Remove this once we no longer support the Hermes that needed this.
3896
+ arrayForEach(['caller', 'arguments'], (prop)=>{
3897
+ try {
3898
+ strict[prop];
3899
+ }catch( e) {
3900
+ // https://github.com/facebook/hermes/blob/main/test/hermes/function-non-strict.js
3901
+ if( e.message=== 'Restricted in strict mode') {
3902
+ // Fixed in Static Hermes: https://github.com/facebook/hermes/issues/1582
3903
+ FunctionInstance[prop]= accessor;
3904
+ }
3905
+ }
3906
+ });
3907
+
3760
3908
  const isAccessorPermit= (permit)=>{
3761
3909
  return permit=== getter|| permit=== accessor;
3762
3910
  };
@@ -3851,6 +3999,11 @@ const CommonMath= {
3851
3999
  tan: fn,
3852
4000
  tanh: fn,
3853
4001
  trunc: fn,
4002
+ // https://github.com/tc39/proposal-float16array
4003
+ f16round: fn,
4004
+ // https://github.com/tc39/proposal-math-sum
4005
+ sumPrecise: fn,
4006
+
3854
4007
  // See https://github.com/Moddable-OpenSource/moddable/issues/523
3855
4008
  idiv: false,
3856
4009
  // See https://github.com/Moddable-OpenSource/moddable/issues/523
@@ -3913,7 +4066,6 @@ const permitted= {
3913
4066
  getOwnPropertyNames: fn,
3914
4067
  getOwnPropertySymbols: fn,
3915
4068
  getPrototypeOf: fn,
3916
- hasOwn: fn,
3917
4069
  is: fn,
3918
4070
  isExtensible: fn,
3919
4071
  isFrozen: fn,
@@ -3924,6 +4076,8 @@ const permitted= {
3924
4076
  seal: fn,
3925
4077
  setPrototypeOf: fn,
3926
4078
  values: fn,
4079
+ // https://github.com/tc39/proposal-accessible-object-hasownproperty
4080
+ hasOwn: fn,
3927
4081
  // https://github.com/tc39/proposal-array-grouping
3928
4082
  groupBy: fn,
3929
4083
  // Seen on QuickJS
@@ -3995,9 +4149,7 @@ const permitted= {
3995
4149
  '%SharedSymbol%': {
3996
4150
  // Properties of the Symbol Constructor
3997
4151
  '[[Proto]]': '%FunctionPrototype%',
3998
- asyncDispose: 'symbol',
3999
4152
  asyncIterator: 'symbol',
4000
- dispose: 'symbol',
4001
4153
  for: fn,
4002
4154
  hasInstance: 'symbol',
4003
4155
  isConcatSpreadable: 'symbol',
@@ -4013,6 +4165,10 @@ const permitted= {
4013
4165
  toPrimitive: 'symbol',
4014
4166
  toStringTag: 'symbol',
4015
4167
  unscopables: 'symbol',
4168
+ // https://github.com/tc39/proposal-explicit-resource-management
4169
+ asyncDispose: 'symbol',
4170
+ // https://github.com/tc39/proposal-explicit-resource-management
4171
+ dispose: 'symbol',
4016
4172
  // Seen at core-js https://github.com/zloirock/core-js#ecmascript-symbol
4017
4173
  useSimple: false,
4018
4174
  // Seen at core-js https://github.com/zloirock/core-js#ecmascript-symbol
@@ -4040,7 +4196,9 @@ const permitted= {
4040
4196
  // Non standard, v8 only, used by tap, tamed to accessor
4041
4197
  stackTraceLimit: accessor,
4042
4198
  // Non standard, v8 only, used by several, tamed to accessor
4043
- prepareStackTrace: accessor},
4199
+ prepareStackTrace: accessor,
4200
+ // https://github.com/tc39/proposal-is-error
4201
+ isError: fn},
4044
4202
 
4045
4203
 
4046
4204
  '%SharedError%': {
@@ -4052,7 +4210,9 @@ const permitted= {
4052
4210
  // Non standard, v8 only, used by tap, tamed to accessor
4053
4211
  stackTraceLimit: accessor,
4054
4212
  // Non standard, v8 only, used by several, tamed to accessor
4055
- prepareStackTrace: accessor},
4213
+ prepareStackTrace: accessor,
4214
+ // https://github.com/tc39/proposal-is-error
4215
+ isError: fn},
4056
4216
 
4057
4217
 
4058
4218
  '%ErrorPrototype%': {
@@ -4081,6 +4241,10 @@ const permitted= {
4081
4241
  // https://github.com/endojs/endo/issues/550
4082
4242
  AggregateError: NativeError('%AggregateErrorPrototype%'),
4083
4243
 
4244
+ // TODO SuppressedError
4245
+ // https://github.com/tc39/proposal-explicit-resource-management
4246
+ // SuppressedError: NativeError('%SuppressedErrorPrototype%'),
4247
+
4084
4248
  '%EvalErrorPrototype%': NativeErrorPrototype('EvalError'),
4085
4249
  '%RangeErrorPrototype%': NativeErrorPrototype('RangeError'),
4086
4250
  '%ReferenceErrorPrototype%': NativeErrorPrototype('ReferenceError'),
@@ -4089,6 +4253,13 @@ const permitted= {
4089
4253
  '%URIErrorPrototype%': NativeErrorPrototype('URIError'),
4090
4254
  // https://github.com/endojs/endo/issues/550
4091
4255
  '%AggregateErrorPrototype%': NativeErrorPrototype('AggregateError'),
4256
+ // TODO AggregateError .errors
4257
+
4258
+ // TODO SuppressedError
4259
+ // https://github.com/tc39/proposal-explicit-resource-management
4260
+ // '%SuppressedErrorPrototype%': NativeErrorPrototype('SuppressedError'),
4261
+ // TODO SuppressedError .error
4262
+ // TODO SuppressedError .suppressed
4092
4263
 
4093
4264
  // *** Numbers and Dates
4094
4265
 
@@ -4267,7 +4438,6 @@ const permitted= {
4267
4438
  '%StringPrototype%': {
4268
4439
  // Properties of the String Prototype Object
4269
4440
  length: 'number',
4270
- at: fn,
4271
4441
  charAt: fn,
4272
4442
  charCodeAt: fn,
4273
4443
  codePointAt: fn,
@@ -4301,6 +4471,13 @@ const permitted= {
4301
4471
  trimStart: fn,
4302
4472
  valueOf: fn,
4303
4473
  '@@iterator': fn,
4474
+ // Failed tc39 proposal
4475
+ // https://github.com/tc39/proposal-relative-indexing-method
4476
+ at: fn,
4477
+ // https://github.com/tc39/proposal-is-usv-string
4478
+ isWellFormed: fn,
4479
+ toWellFormed: fn,
4480
+ unicodeSets: fn,
4304
4481
 
4305
4482
  // Annex B: Additional Properties of the String.prototype Object
4306
4483
  substr: fn,
@@ -4321,10 +4498,6 @@ const permitted= {
4321
4498
  trimRight: fn,
4322
4499
  // See https://github.com/Moddable-OpenSource/moddable/issues/523
4323
4500
  compare: false,
4324
- // https://github.com/tc39/proposal-is-usv-string
4325
- isWellFormed: fn,
4326
- toWellFormed: fn,
4327
- unicodeSets: fn,
4328
4501
  // Seen on QuickJS
4329
4502
  __quote: false},
4330
4503
 
@@ -4340,6 +4513,8 @@ const permitted= {
4340
4513
  '[[Proto]]': '%FunctionPrototype%',
4341
4514
  prototype: '%RegExpPrototype%',
4342
4515
  '@@species': getter,
4516
+ // https://github.com/tc39/proposal-regex-escaping
4517
+ escape: fn,
4343
4518
 
4344
4519
  // The https://github.com/tc39/proposal-regexp-legacy-features
4345
4520
  // are all optional, unsafe, and omitted
@@ -4368,7 +4543,9 @@ const permitted= {
4368
4543
  // Properties of the RegExp Constructor
4369
4544
  '[[Proto]]': '%FunctionPrototype%',
4370
4545
  prototype: '%RegExpPrototype%',
4371
- '@@species': getter},
4546
+ '@@species': getter,
4547
+ // https://github.com/tc39/proposal-regex-escaping
4548
+ escape: fn},
4372
4549
 
4373
4550
 
4374
4551
  '%RegExpPrototype%': {
@@ -4415,7 +4592,7 @@ const permitted= {
4415
4592
  prototype: '%ArrayPrototype%',
4416
4593
  '@@species': getter,
4417
4594
 
4418
- // Stage 3:
4595
+ // Failed tc39 proposal
4419
4596
  // https://tc39.es/proposal-relative-indexing-method/
4420
4597
  at: fn,
4421
4598
  // https://tc39.es/proposal-array-from-async/
@@ -4424,7 +4601,6 @@ const permitted= {
4424
4601
 
4425
4602
  '%ArrayPrototype%': {
4426
4603
  // Properties of the Array Prototype Object
4427
- at: fn,
4428
4604
  length: 'number',
4429
4605
  concat: fn,
4430
4606
  constructor: 'Array',
@@ -4472,6 +4648,7 @@ const permitted= {
4472
4648
  keys: 'boolean',
4473
4649
  values: 'boolean',
4474
4650
  // Failed tc39 proposal
4651
+ // https://tc39.es/proposal-relative-indexing-method/
4475
4652
  // Seen on FF Nightly 88.0a1
4476
4653
  at: 'boolean',
4477
4654
  // See https://github.com/tc39/proposal-array-find-from-last
@@ -4498,7 +4675,10 @@ const permitted= {
4498
4675
  // https://github.com/tc39/proposal-array-grouping
4499
4676
  group: fn, // Not in proposal? Where?
4500
4677
  groupToMap: fn, // Not in proposal? Where?
4501
- groupBy: fn},
4678
+ groupBy: fn,
4679
+ // Failed tc39 proposal
4680
+ // https://tc39.es/proposal-relative-indexing-method/
4681
+ at: fn},
4502
4682
 
4503
4683
 
4504
4684
  '%ArrayIteratorPrototype%': {
@@ -4520,7 +4700,6 @@ const permitted= {
4520
4700
 
4521
4701
 
4522
4702
  '%TypedArrayPrototype%': {
4523
- at: fn,
4524
4703
  buffer: getter,
4525
4704
  byteLength: getter,
4526
4705
  byteOffset: getter,
@@ -4553,6 +4732,9 @@ const permitted= {
4553
4732
  values: fn,
4554
4733
  '@@iterator': fn,
4555
4734
  '@@toStringTag': getter,
4735
+ // Failed tc39 proposal
4736
+ // https://tc39.es/proposal-relative-indexing-method/
4737
+ at: fn,
4556
4738
  // See https://github.com/tc39/proposal-array-find-from-last
4557
4739
  findLast: fn,
4558
4740
  findLastIndex: fn,
@@ -4809,7 +4991,12 @@ const permitted= {
4809
4991
  // Properties of the Iterator Constructor
4810
4992
  '[[Proto]]': '%FunctionPrototype%',
4811
4993
  prototype: '%IteratorPrototype%',
4812
- from: fn},
4994
+ from: fn,
4995
+ // https://github.com/tc39/proposal-joint-iteration
4996
+ zip: fn,
4997
+ zipKeyed: fn,
4998
+ // https://github.com/tc39/proposal-iterator-sequencing
4999
+ concat: fn},
4813
5000
 
4814
5001
 
4815
5002
  '%IteratorPrototype%': {
@@ -4831,6 +5018,7 @@ const permitted= {
4831
5018
  '@@toStringTag': 'string',
4832
5019
  // https://github.com/tc39/proposal-async-iterator-helpers
4833
5020
  toAsync: fn,
5021
+ // https://github.com/tc39/proposal-explicit-resource-management
4834
5022
  // See https://github.com/Moddable-OpenSource/moddable/issues/523#issuecomment-1942904505
4835
5023
  '@@dispose': false},
4836
5024
 
@@ -4875,6 +5063,7 @@ const permitted= {
4875
5063
  every: fn,
4876
5064
  find: fn,
4877
5065
  '@@toStringTag': 'string',
5066
+ // https://github.com/tc39/proposal-explicit-resource-management
4878
5067
  // See https://github.com/Moddable-OpenSource/moddable/issues/523#issuecomment-1942904505
4879
5068
  '@@asyncDispose': false},
4880
5069
 
@@ -4954,7 +5143,7 @@ const permitted= {
4954
5143
  //
4955
5144
  // We will likely change this to add a property to Promise called
4956
5145
  // Promise.delegate and put static methods on it, which will necessitate
4957
- // another whitelist change to update to the current proposed standard.
5146
+ // another permits change to update to the current proposed standard.
4958
5147
  HandledPromise: {
4959
5148
  '[[Proto]]': 'Promise',
4960
5149
  applyFunction: fn,
@@ -4981,7 +5170,11 @@ const permitted= {
4981
5170
  // https://github.com/tc39/proposal-compartments
4982
5171
  bindings: getter,
4983
5172
  needsImport: getter,
4984
- needsImportMeta: getter},
5173
+ needsImportMeta: getter,
5174
+ // @endo/module-source provides a legacy interface
5175
+ imports: getter,
5176
+ exports: getter,
5177
+ reexports: getter},
4985
5178
 
4986
5179
 
4987
5180
  '%AbstractModuleSource%': {
@@ -5006,7 +5199,9 @@ const permitted= {
5006
5199
  resolve: fn,
5007
5200
  // https://github.com/tc39/proposal-promise-with-resolvers
5008
5201
  withResolvers: fn,
5009
- '@@species': getter},
5202
+ '@@species': getter,
5203
+ // https://github.com/tc39/proposal-promise-try
5204
+ try: fn},
5010
5205
 
5011
5206
 
5012
5207
  '%PromisePrototype%': {
@@ -5105,8 +5300,9 @@ const permitted= {
5105
5300
  '%InitialGetStackString%': fn};$h͏_once.permitted(permitted);
5106
5301
  })()
5107
5302
  ,
5108
- // === functors[12] ===
5109
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let TypeError,WeakSet,arrayFilter,create,defineProperty,entries,freeze,getOwnPropertyDescriptor,getOwnPropertyDescriptors,globalThis,is,isObject,objectHasOwnProperty,values,weaksetHas,constantProperties,sharedGlobalPropertyNames,universalPropertyNames,permitted;$h͏_imports([["./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)]]]]]);
5303
+ // === functors[13] ===
5304
+ ({ 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)]]]]]);
5305
+
5110
5306
 
5111
5307
 
5112
5308
 
@@ -5130,13 +5326,17 @@ const permitted= {
5130
5326
 
5131
5327
 
5132
5328
 
5329
+
5330
+ /**
5331
+ * @import {Reporter} from './reporting-types.js'
5332
+ */
5133
5333
 
5134
5334
  const isFunction= (obj)=>typeof obj=== 'function';
5135
5335
 
5136
5336
  // Like defineProperty, but throws if it would modify an existing property.
5137
5337
  // We use this to ensure that two conflicting attempts to define the same
5138
5338
  // property throws, causing SES initialization to fail. Otherwise, a
5139
- // conflict between, for example, two of SES's internal whitelists might
5339
+ // conflict between, for example, two of SES's internal permits might
5140
5340
  // get masked as one overwrites the other. Accordingly, the thrown error
5141
5341
  // complains of a "Conflicting definition".
5142
5342
  function initProperty(obj, name, desc) {
@@ -5179,7 +5379,10 @@ function sampleGlobals(globalObject, newPropertyNames) {
5179
5379
  return newIntrinsics;
5180
5380
  }
5181
5381
 
5182
- const makeIntrinsicsCollector= ()=> {
5382
+ /**
5383
+ * @param {Reporter} reporter
5384
+ */
5385
+ const makeIntrinsicsCollector= (reporter)=>{
5183
5386
  /** @type {Record<any, any>} */
5184
5387
  const intrinsics= create(null);
5185
5388
  let pseudoNatives;
@@ -5190,7 +5393,7 @@ const makeIntrinsicsCollector= ()=> {
5190
5393
  freeze(addIntrinsics);
5191
5394
 
5192
5395
  // For each intrinsic, if it has a `.prototype` property, use the
5193
- // whitelist to find out the intrinsic name for that prototype and add it
5396
+ // permits to find out the intrinsic name for that prototype and add it
5194
5397
  // to the intrinsics.
5195
5398
  const completePrototypes= ()=> {
5196
5399
  for( const [name, intrinsic]of entries(intrinsics)) {
@@ -5204,17 +5407,25 @@ const makeIntrinsicsCollector= ()=> {
5204
5407
  }
5205
5408
  const permit= permitted[name];
5206
5409
  if( typeof permit!== 'object') {
5207
- throw TypeError( `Expected permit object at whitelist.${name}`);
5410
+ throw TypeError( `Expected permit object at permits.${name}`);
5208
5411
  }
5209
5412
  const namePrototype= permit.prototype;
5210
5413
  if( !namePrototype) {
5211
- throw TypeError( `${name}.prototype property not whitelisted`);
5414
+ cauterizeProperty(
5415
+ intrinsic,
5416
+ 'prototype',
5417
+ false,
5418
+ `${name}.prototype`,
5419
+ reporter);
5420
+
5421
+ // eslint-disable-next-line no-continue
5422
+ continue;
5212
5423
  }
5213
5424
  if(
5214
5425
  typeof namePrototype!== 'string'||
5215
5426
  !objectHasOwnProperty(permitted, namePrototype))
5216
5427
  {
5217
- throw TypeError( `Unrecognized ${name}.prototype whitelist entry`);
5428
+ throw TypeError( `Unrecognized ${name}.prototype permits entry`);
5218
5429
  }
5219
5430
  const intrinsicPrototype= intrinsic.prototype;
5220
5431
  if( objectHasOwnProperty(intrinsics, namePrototype)) {
@@ -5263,7 +5474,7 @@ const makeIntrinsicsCollector= ()=> {
5263
5474
  /**
5264
5475
  * getGlobalIntrinsics()
5265
5476
  * Doesn't tame, delete, or modify anything. Samples globalObject to create an
5266
- * intrinsics record containing only the whitelisted global variables, listed
5477
+ * intrinsics record containing only the permitted global variables, listed
5267
5478
  * by the intrinsic names appropriate for new globals, i.e., the globals of
5268
5479
  * newly constructed compartments.
5269
5480
  *
@@ -5272,9 +5483,11 @@ const makeIntrinsicsCollector= ()=> {
5272
5483
  * *original* unsafe (feral, untamed) bindings of these global variables.
5273
5484
  *
5274
5485
  * @param {object} globalObject
5486
+ * @param {Reporter} reporter
5275
5487
  */$h͏_once.makeIntrinsicsCollector(makeIntrinsicsCollector);
5276
- const getGlobalIntrinsics= (globalObject)=>{
5277
- const { addIntrinsics, finalIntrinsics}= makeIntrinsicsCollector();
5488
+ const getGlobalIntrinsics= (globalObject, reporter)=> {
5489
+ // TODO pass a proper reporter to `makeIntrinsicsCollector`
5490
+ const { addIntrinsics, finalIntrinsics}= makeIntrinsicsCollector(reporter);
5278
5491
 
5279
5492
  addIntrinsics(sampleGlobals(globalObject, sharedGlobalPropertyNames));
5280
5493
 
@@ -5282,8 +5495,9 @@ const getGlobalIntrinsics= (globalObject)=>{
5282
5495
  };$h͏_once.getGlobalIntrinsics(getGlobalIntrinsics);
5283
5496
  })()
5284
5497
  ,
5285
- // === functors[13] ===
5286
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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;$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)]]]]]);
5498
+ // === functors[14] ===
5499
+ ({ 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)]]]]]);
5500
+
5287
5501
 
5288
5502
 
5289
5503
 
@@ -5348,28 +5562,22 @@ const getGlobalIntrinsics= (globalObject)=>{
5348
5562
 
5349
5563
 
5350
5564
  /**
5351
- * whitelistIntrinsics()
5565
+ * @import {Reporter} from './reporting-types.js'
5566
+ */
5567
+
5568
+ /**
5352
5569
  * Removes all non-allowed properties found by recursively and
5353
5570
  * reflectively walking own property chains.
5354
5571
  *
5355
5572
  * @param {object} intrinsics
5356
- * @param {(object) => void} markVirtualizedNativeFunction
5573
+ * @param {(virtualizedNativeFunction: object) => void} markVirtualizedNativeFunction
5574
+ * @param {Reporter} reporter
5357
5575
  */
5358
- function whitelistIntrinsics(
5576
+ function removeUnpermittedIntrinsics(
5359
5577
  intrinsics,
5360
- markVirtualizedNativeFunction)
5578
+ markVirtualizedNativeFunction,
5579
+ reporter)
5361
5580
  {
5362
- let groupStarted= false;
5363
- const inConsoleGroup= (level, ...args)=> {
5364
- if( !groupStarted) {
5365
- // eslint-disable-next-line @endo/no-polymorphic-call
5366
- console.groupCollapsed('Removing unpermitted intrinsics');
5367
- groupStarted= true;
5368
- }
5369
- // eslint-disable-next-line @endo/no-polymorphic-call
5370
- return console[level](...args);
5371
- };
5372
-
5373
5581
  // These primitives are allowed for permits.
5374
5582
  const primitives= ['undefined', 'boolean', 'number', 'string', 'symbol'];
5375
5583
 
@@ -5433,7 +5641,7 @@ function whitelistIntrinsics(
5433
5641
 
5434
5642
  // Assert: protoName, if provided, is a string.
5435
5643
  if( protoName!== undefined&& typeof protoName!== 'string') {
5436
- throw TypeError( `Malformed whitelist permit ${path}.__proto__`);
5644
+ throw TypeError( `Malformed permit ${path}.__proto__`);
5437
5645
  }
5438
5646
 
5439
5647
  // If permit not specified, default to Object.prototype.
@@ -5449,7 +5657,7 @@ function whitelistIntrinsics(
5449
5657
 
5450
5658
  /*
5451
5659
  * isAllowedPropertyValue()
5452
- * Whitelist a single property value against a permit.
5660
+ * enforce permit for a single property value.
5453
5661
  */
5454
5662
  function isAllowedPropertyValue(path, value, prop, permit) {
5455
5663
  if( typeof permit=== 'object') {
@@ -5477,7 +5685,7 @@ function whitelistIntrinsics(
5477
5685
 
5478
5686
  if( objectHasOwnProperty(intrinsics, permit)) {
5479
5687
  if( value!== intrinsics[permit]) {
5480
- throw TypeError( `Does not match whitelist ${path}`);
5688
+ throw TypeError( `Does not match permit for ${path}`);
5481
5689
  }
5482
5690
  return true;
5483
5691
  }
@@ -5570,57 +5778,19 @@ function whitelistIntrinsics(
5570
5778
  const subPermit= getSubPermit(obj, permit, propString);
5571
5779
 
5572
5780
  if( !subPermit|| !isAllowedProperty(subPath, obj, prop, subPermit)) {
5573
- // Either the object lacks a permit or the object doesn't match the
5574
- // permit.
5575
- // If the permit is specifically false, not merely undefined,
5576
- // this is a property we expect to see because we know it exists in
5577
- // some environments and we have expressly decided to exclude it.
5578
- // Any other disallowed property is one we have not audited and we log
5579
- // that we are removing it so we know to look into it, as happens when
5580
- // the language evolves new features to existing intrinsics.
5581
- if( subPermit!== false) {
5582
- inConsoleGroup('warn', `Removing ${subPath}`);
5583
- }
5584
- try {
5585
- delete obj[prop];
5586
- }catch( err) {
5587
- if( prop in obj) {
5588
- if( typeof obj=== 'function'&& prop=== 'prototype') {
5589
- obj.prototype= undefined;
5590
- if( obj.prototype=== undefined) {
5591
- inConsoleGroup(
5592
- 'warn',
5593
- `Tolerating undeletable ${subPath} === undefined`);
5594
-
5595
- // eslint-disable-next-line no-continue
5596
- continue;
5597
- }
5598
- }
5599
- inConsoleGroup('error', `failed to delete ${subPath}`,err);
5600
- }else {
5601
- inConsoleGroup('error', `deleting ${subPath} threw`,err);
5602
- }
5603
- throw err;
5604
- }
5781
+ cauterizeProperty(obj, prop, subPermit=== false, subPath, reporter);
5605
5782
  }
5606
5783
  }
5607
5784
  }
5608
5785
 
5609
- try {
5610
- // Start path with 'intrinsics' to clarify that properties are not
5611
- // removed from the global object by the whitelisting operation.
5612
- visitProperties('intrinsics', intrinsics, permitted);
5613
- }finally {
5614
- if( groupStarted) {
5615
- // eslint-disable-next-line @endo/no-polymorphic-call
5616
- console.groupEnd();
5617
- }
5618
- }
5619
- }$h͏_once.default( whitelistIntrinsics);
5786
+ // Start path with 'intrinsics' to clarify that properties are not
5787
+ // removed from the global object by the permitting operation.
5788
+ visitProperties('intrinsics', intrinsics, permitted);
5789
+ }$h͏_once.default( removeUnpermittedIntrinsics);
5620
5790
  })()
5621
5791
  ,
5622
- // === functors[14] ===
5623
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let FERAL_FUNCTION,SyntaxError,TypeError,defineProperties,getPrototypeOf,setPrototypeOf,freeze;$h͏_imports([["./commons.js", [["FERAL_FUNCTION", [$h͏_a => (FERAL_FUNCTION = $h͏_a)]],["SyntaxError", [$h͏_a => (SyntaxError = $h͏_a)]],["TypeError", [$h͏_a => (TypeError = $h͏_a)]],["defineProperties", [$h͏_a => (defineProperties = $h͏_a)]],["getPrototypeOf", [$h͏_a => (getPrototypeOf = $h͏_a)]],["setPrototypeOf", [$h͏_a => (setPrototypeOf = $h͏_a)]],["freeze", [$h͏_a => (freeze = $h͏_a)]]]]]);
5792
+ // === functors[15] ===
5793
+ ({ 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;$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)]]]]]);
5624
5794
 
5625
5795
 
5626
5796
 
@@ -5758,8 +5928,8 @@ function tameFunctionConstructors() {
5758
5928
  }$h͏_once.default( tameFunctionConstructors);
5759
5929
  })()
5760
5930
  ,
5761
- // === functors[15] ===
5762
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
5931
+ // === functors[16] ===
5932
+ ({ 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)]]]]]);
5763
5933
 
5764
5934
 
5765
5935
 
@@ -5769,10 +5939,7 @@ function tameFunctionConstructors() {
5769
5939
 
5770
5940
 
5771
5941
 
5772
- function tameDateConstructor(dateTaming= 'safe') {
5773
- if( dateTaming!== 'safe'&& dateTaming!== 'unsafe') {
5774
- throw TypeError( `unrecognized dateTaming ${dateTaming}`);
5775
- }
5942
+ function tameDateConstructor() {
5776
5943
  const OriginalDate= Date;
5777
5944
  const DatePrototype= OriginalDate.prototype;
5778
5945
 
@@ -5891,8 +6058,8 @@ function tameDateConstructor(dateTaming= 'safe') {
5891
6058
  }$h͏_once.default( tameDateConstructor);
5892
6059
  })()
5893
6060
  ,
5894
- // === functors[16] ===
5895
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
6061
+ // === functors[17] ===
6062
+ ({ 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)]]]]]);
5896
6063
 
5897
6064
 
5898
6065
 
@@ -5900,10 +6067,7 @@ function tameDateConstructor(dateTaming= 'safe') {
5900
6067
 
5901
6068
 
5902
6069
 
5903
- function tameMathObject(mathTaming= 'safe') {
5904
- if( mathTaming!== 'safe'&& mathTaming!== 'unsafe') {
5905
- throw TypeError( `unrecognized mathTaming ${mathTaming}`);
5906
- }
6070
+ function tameMathObject() {
5907
6071
  const originalMath= Math;
5908
6072
  const initialMath= originalMath; // to follow the naming pattern
5909
6073
 
@@ -5938,8 +6102,8 @@ function tameMathObject(mathTaming= 'safe') {
5938
6102
  }$h͏_once.default( tameMathObject);
5939
6103
  })()
5940
6104
  ,
5941
- // === functors[17] ===
5942
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
6105
+ // === functors[18] ===
6106
+ ({ 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)]]]]]);
5943
6107
 
5944
6108
 
5945
6109
 
@@ -6009,11 +6173,11 @@ function tameRegExpConstructor(regExpTaming= 'safe') {
6009
6173
  }$h͏_once.default( tameRegExpConstructor);
6010
6174
  })()
6011
6175
  ,
6012
- // === functors[18] ===
6013
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
6176
+ // === functors[19] ===
6177
+ ({ 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)]]]]]);
6014
6178
 
6015
6179
  /**
6016
- * @file Exports {@code enablements}, a recursively defined
6180
+ * @module Exports {@code enablements}, a recursively defined
6017
6181
  * JSON record defining the optimum set of intrinsics properties
6018
6182
  * that need to be "repaired" before hardening is applied on
6019
6183
  * enviromments subject to the override mistake.
@@ -6253,8 +6417,9 @@ const severeEnablements= {
6253
6417
  '%SetPrototype%': '*'};$h͏_once.severeEnablements(severeEnablements);
6254
6418
  })()
6255
6419
  ,
6256
- // === functors[19] ===
6257
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
6420
+ // === functors[20] ===
6421
+ ({ 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)]]]]]);
6422
+
6258
6423
 
6259
6424
 
6260
6425
 
@@ -6278,9 +6443,10 @@ const severeEnablements= {
6278
6443
 
6279
6444
 
6280
6445
 
6446
+ /** @import {Reporter} from './reporting-types.js' */
6281
6447
 
6282
6448
  /**
6283
- * For a special set of properties defined in the `enablement` whitelist,
6449
+ * For a special set of properties defined in the `enablement` list,
6284
6450
  * `enablePropertyOverrides` ensures that the effect of freezing does not
6285
6451
  * suppress the ability to override these properties on derived objects by
6286
6452
  * simple assignment.
@@ -6331,11 +6497,13 @@ const severeEnablements= {
6331
6497
  *
6332
6498
  * @param {Record<string, any>} intrinsics
6333
6499
  * @param {'min' | 'moderate' | 'severe'} overrideTaming
6500
+ * @param {Reporter} reporter
6334
6501
  * @param {Iterable<string | symbol>} [overrideDebug]
6335
6502
  */
6336
6503
  function enablePropertyOverrides(
6337
6504
  intrinsics,
6338
6505
  overrideTaming,
6506
+ { warn},
6339
6507
  overrideDebug= [])
6340
6508
  {
6341
6509
  const debugProperties= new Set(overrideDebug);
@@ -6365,8 +6533,7 @@ function enablePropertyOverrides(
6365
6533
  this[prop]= newValue;
6366
6534
  }else {
6367
6535
  if( isDebug) {
6368
- // eslint-disable-next-line @endo/no-polymorphic-call
6369
- console.error(TypeError( `Override property ${prop}`));
6536
+ warn(TypeError( `Override property ${prop}`));
6370
6537
  }
6371
6538
  defineProperty(this, prop, {
6372
6539
  value: newValue,
@@ -6464,8 +6631,8 @@ function enablePropertyOverrides(
6464
6631
  }$h͏_once.default( enablePropertyOverrides);
6465
6632
  })()
6466
6633
  ,
6467
- // === functors[20] ===
6468
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
6634
+ // === functors[21] ===
6635
+ ({ 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)]]]]]);
6469
6636
 
6470
6637
 
6471
6638
 
@@ -6548,8 +6715,8 @@ function tameLocaleMethods(intrinsics, localeTaming= 'safe') {
6548
6715
  }$h͏_once.default( tameLocaleMethods);
6549
6716
  })()
6550
6717
  ,
6551
- // === functors[21] ===
6552
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([]); /**
6718
+ // === functors[22] ===
6719
+ ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, import: $h͏_import, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([]); /**
6553
6720
  * makeEvalFunction()
6554
6721
  * A safe version of the native eval function which relies on
6555
6722
  * the safety of safeEvaluate for confinement.
@@ -6578,8 +6745,8 @@ const makeEvalFunction= (safeEvaluate)=>{
6578
6745
  };$h͏_once.makeEvalFunction(makeEvalFunction);
6579
6746
  })()
6580
6747
  ,
6581
- // === functors[22] ===
6582
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
6748
+ // === functors[23] ===
6749
+ ({ 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)]]]]]);
6583
6750
 
6584
6751
 
6585
6752
 
@@ -6659,8 +6826,8 @@ const makeFunctionConstructor= (safeEvaluate)=>{
6659
6826
  };$h͏_once.makeFunctionConstructor(makeFunctionConstructor);
6660
6827
  })()
6661
6828
  ,
6662
- // === functors[23] ===
6663
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
6829
+ // === functors[24] ===
6830
+ ({ 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)]]]]]);
6664
6831
 
6665
6832
 
6666
6833
 
@@ -6779,11 +6946,14 @@ const setGlobalObjectMutableProperties= (
6779
6946
  makeCompartmentConstructor,
6780
6947
  intrinsics,
6781
6948
  markVirtualizedNativeFunction,
6782
- parentCompartment));
6949
+ {
6950
+ parentCompartment,
6951
+ enforceNew: true}));
6783
6952
 
6784
6953
 
6785
6954
 
6786
- // TODO These should still be tamed according to the whitelist before
6955
+
6956
+ // TODO These should still be tamed according to the permits before
6787
6957
  // being made available.
6788
6958
  for( const [name, value]of entries(perCompartmentGlobals)) {
6789
6959
  defineProperty(globalObject, name, {
@@ -6834,9 +7004,8 @@ const setGlobalObjectEvaluators= (
6834
7004
  };$h͏_once.setGlobalObjectEvaluators(setGlobalObjectEvaluators);
6835
7005
  })()
6836
7006
  ,
6837
- // === functors[24] ===
6838
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let Proxy,String,TypeError,ReferenceError,create,freeze,getOwnPropertyDescriptors,globalThis,immutableObject,assert;$h͏_imports([["./commons.js", [["Proxy", [$h͏_a => (Proxy = $h͏_a)]],["String", [$h͏_a => (String = $h͏_a)]],["TypeError", [$h͏_a => (TypeError = $h͏_a)]],["ReferenceError", [$h͏_a => (ReferenceError = $h͏_a)]],["create", [$h͏_a => (create = $h͏_a)]],["freeze", [$h͏_a => (freeze = $h͏_a)]],["getOwnPropertyDescriptors", [$h͏_a => (getOwnPropertyDescriptors = $h͏_a)]],["globalThis", [$h͏_a => (globalThis = $h͏_a)]],["immutableObject", [$h͏_a => (immutableObject = $h͏_a)]]]],["./error/assert.js", [["assert", [$h͏_a => (assert = $h͏_a)]]]]]);
6839
-
7007
+ // === functors[25] ===
7008
+ ({ 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,globalThis,assert;$h͏_imports([["./commons.js", [["Proxy", [$h͏_a => (Proxy = $h͏_a)]],["String", [$h͏_a => (String = $h͏_a)]],["TypeError", [$h͏_a => (TypeError = $h͏_a)]],["ReferenceError", [$h͏_a => (ReferenceError = $h͏_a)]],["create", [$h͏_a => (create = $h͏_a)]],["freeze", [$h͏_a => (freeze = $h͏_a)]],["getOwnPropertyDescriptors", [$h͏_a => (getOwnPropertyDescriptors = $h͏_a)]],["globalThis", [$h͏_a => (globalThis = $h͏_a)]]]],["./error/assert.js", [["assert", [$h͏_a => (assert = $h͏_a)]]]]]);
6840
7009
 
6841
7010
 
6842
7011
 
@@ -6850,6 +7019,14 @@ const setGlobalObjectEvaluators= (
6850
7019
 
6851
7020
  const { Fail, quote: q}= assert;
6852
7021
 
7022
+ /**
7023
+ * `freeze` but not `harden` the proxy target so it remains trapping.
7024
+ * Thus, it should not be shared outside this module.
7025
+ *
7026
+ * @see https://github.com/endojs/endo/blob/master/packages/ses/docs/preparing-for-stabilize.md
7027
+ */
7028
+ const objTarget= freeze({ __proto__: null});
7029
+
6853
7030
  /**
6854
7031
  * alwaysThrowHandler
6855
7032
  * This is an object that throws if any property is called. It's used as
@@ -6858,7 +7035,7 @@ const { Fail, quote: q}= assert;
6858
7035
  * create one and share it between all Proxy handlers.
6859
7036
  */
6860
7037
  const alwaysThrowHandler= new Proxy(
6861
- immutableObject,
7038
+ objTarget,
6862
7039
  freeze({
6863
7040
  get(_shadow, prop) {
6864
7041
  Fail `Please report unexpected scope handler trap: ${q(String(prop))}`;
@@ -6925,12 +7102,12 @@ const strictScopeTerminatorHandler= freeze(
6925
7102
 
6926
7103
 
6927
7104
  const strictScopeTerminator= new Proxy(
6928
- immutableObject,
7105
+ objTarget,
6929
7106
  strictScopeTerminatorHandler);$h͏_once.strictScopeTerminator(strictScopeTerminator);
6930
7107
  })()
6931
7108
  ,
6932
- // === functors[25] ===
6933
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let Proxy,create,freeze,getOwnPropertyDescriptors,immutableObject,reflectSet,strictScopeTerminatorHandler,alwaysThrowHandler;$h͏_imports([["./commons.js", [["Proxy", [$h͏_a => (Proxy = $h͏_a)]],["create", [$h͏_a => (create = $h͏_a)]],["freeze", [$h͏_a => (freeze = $h͏_a)]],["getOwnPropertyDescriptors", [$h͏_a => (getOwnPropertyDescriptors = $h͏_a)]],["immutableObject", [$h͏_a => (immutableObject = $h͏_a)]],["reflectSet", [$h͏_a => (reflectSet = $h͏_a)]]]],["./strict-scope-terminator.js", [["strictScopeTerminatorHandler", [$h͏_a => (strictScopeTerminatorHandler = $h͏_a)]],["alwaysThrowHandler", [$h͏_a => (alwaysThrowHandler = $h͏_a)]]]]]);
7109
+ // === functors[26] ===
7110
+ ({ 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)]]]]]);
6934
7111
 
6935
7112
 
6936
7113
 
@@ -6942,6 +7119,13 @@ const strictScopeTerminator= new Proxy(
6942
7119
 
6943
7120
 
6944
7121
 
7122
+ /**
7123
+ * `freeze` but not `harden` the proxy target so it remains trapping.
7124
+ * Thus, it should not be shared outside this module.
7125
+ *
7126
+ * @see https://github.com/endojs/endo/blob/master/packages/ses/docs/preparing-for-stabilize.md
7127
+ */
7128
+ const objTarget= freeze({ __proto__: null});
6945
7129
 
6946
7130
  /*
6947
7131
  * createSloppyGlobalsScopeTerminator()
@@ -6977,7 +7161,7 @@ const createSloppyGlobalsScopeTerminator= (globalObject)=>{
6977
7161
 
6978
7162
 
6979
7163
  const sloppyGlobalsScopeTerminator= new Proxy(
6980
- immutableObject,
7164
+ objTarget,
6981
7165
  sloppyGlobalsScopeTerminatorHandler);
6982
7166
 
6983
7167
 
@@ -6986,8 +7170,8 @@ const createSloppyGlobalsScopeTerminator= (globalObject)=>{
6986
7170
  freeze(createSloppyGlobalsScopeTerminator);
6987
7171
  })()
6988
7172
  ,
6989
- // === functors[26] ===
6990
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
7173
+ // === functors[27] ===
7174
+ ({ 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)]]]]]);
6991
7175
 
6992
7176
 
6993
7177
 
@@ -7078,8 +7262,8 @@ const makeEvalScopeKit= ()=> {
7078
7262
  };$h͏_once.makeEvalScopeKit(makeEvalScopeKit);
7079
7263
  })()
7080
7264
  ,
7081
- // === functors[27] ===
7082
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
7265
+ // === functors[28] ===
7266
+ ({ 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)]]]]]);
7083
7267
 
7084
7268
  // Captures a key and value of the form #key=value or @key=value
7085
7269
  const sourceMetaEntryRegExp=
@@ -7131,8 +7315,8 @@ const getSourceURL= (src)=>{
7131
7315
  };$h͏_once.getSourceURL(getSourceURL);
7132
7316
  })()
7133
7317
  ,
7134
- // === functors[28] ===
7135
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
7318
+ // === functors[29] ===
7319
+ ({ 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)]]]]]);
7136
7320
 
7137
7321
 
7138
7322
 
@@ -7382,7 +7566,8 @@ const mandatoryTransforms= (source)=>{
7382
7566
  * @returns {string}
7383
7567
  */$h͏_once.mandatoryTransforms(mandatoryTransforms);
7384
7568
  const applyTransforms= (source, transforms)=> {
7385
- for( const transform of transforms) {
7569
+ for( let i= 0, l= transforms.length; i< l; i+= 1) {
7570
+ const transform= transforms[i];
7386
7571
  source= transform(source);
7387
7572
  }
7388
7573
  return source;
@@ -7399,8 +7584,8 @@ $h͏_once.applyTransforms(applyTransforms);const transforms=freeze({
7399
7584
  applyTransforms: freeze(applyTransforms)});$h͏_once.transforms(transforms);
7400
7585
  })()
7401
7586
  ,
7402
- // === functors[29] ===
7403
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
7587
+ // === functors[30] ===
7588
+ ({ 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)]]]]]);
7404
7589
 
7405
7590
 
7406
7591
 
@@ -7582,8 +7767,8 @@ const getScopeConstants= (globalObject, moduleLexicals= {})=> {
7582
7767
  };$h͏_once.getScopeConstants(getScopeConstants);
7583
7768
  })()
7584
7769
  ,
7585
- // === functors[30] ===
7586
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
7770
+ // === functors[31] ===
7771
+ ({ 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)]]]]]);
7587
7772
 
7588
7773
 
7589
7774
 
@@ -7695,8 +7880,8 @@ const makeEvaluate= (context)=>{
7695
7880
  };$h͏_once.makeEvaluate(makeEvaluate);
7696
7881
  })()
7697
7882
  ,
7698
- // === functors[31] ===
7699
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let apply,freeze,strictScopeTerminator,createSloppyGlobalsScopeTerminator,makeEvalScopeKit,applyTransforms,mandatoryTransforms,makeEvaluate,assert;$h͏_imports([["./commons.js", [["apply", [$h͏_a => (apply = $h͏_a)]],["freeze", [$h͏_a => (freeze = $h͏_a)]]]],["./strict-scope-terminator.js", [["strictScopeTerminator", [$h͏_a => (strictScopeTerminator = $h͏_a)]]]],["./sloppy-globals-scope-terminator.js", [["createSloppyGlobalsScopeTerminator", [$h͏_a => (createSloppyGlobalsScopeTerminator = $h͏_a)]]]],["./eval-scope.js", [["makeEvalScopeKit", [$h͏_a => (makeEvalScopeKit = $h͏_a)]]]],["./transforms.js", [["applyTransforms", [$h͏_a => (applyTransforms = $h͏_a)]],["mandatoryTransforms", [$h͏_a => (mandatoryTransforms = $h͏_a)]]]],["./make-evaluate.js", [["makeEvaluate", [$h͏_a => (makeEvaluate = $h͏_a)]]]],["./error/assert.js", [["assert", [$h͏_a => (assert = $h͏_a)]]]]]);
7883
+ // === functors[32] ===
7884
+ ({ 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)]]]]]);
7700
7885
 
7701
7886
 
7702
7887
 
@@ -7760,10 +7945,12 @@ const makeSafeEvaluator= ({
7760
7945
 
7761
7946
  // Execute the mandatory transforms last to ensure that any rewritten code
7762
7947
  // meets those mandatory requirements.
7763
- source= applyTransforms(source, [
7764
- ...localTransforms,
7765
- ...globalTransforms,
7766
- mandatoryTransforms]);
7948
+ source= applyTransforms(
7949
+ source,
7950
+ arrayFlatMap(
7951
+ [localTransforms, globalTransforms, [mandatoryTransforms]],
7952
+ identity));
7953
+
7767
7954
 
7768
7955
 
7769
7956
  let err;
@@ -7808,8 +7995,8 @@ const makeSafeEvaluator= ({
7808
7995
  };$h͏_once.makeSafeEvaluator(makeSafeEvaluator);
7809
7996
  })()
7810
7997
  ,
7811
- // === functors[32] ===
7812
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
7998
+ // === functors[33] ===
7999
+ ({ 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)]]]]]);
7813
8000
 
7814
8001
 
7815
8002
 
@@ -7861,8 +8048,8 @@ const tameFunctionToString= ()=> {
7861
8048
  };$h͏_once.tameFunctionToString(tameFunctionToString);
7862
8049
  })()
7863
8050
  ,
7864
- // === functors[33] ===
7865
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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);
8051
+ // === functors[34] ===
8052
+ ({ 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);
7866
8053
 
7867
8054
 
7868
8055
 
@@ -7909,8 +8096,8 @@ function tameDomains(domainTaming= 'safe') {
7909
8096
  }
7910
8097
  })()
7911
8098
  ,
7912
- // === functors[34] ===
7913
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
8099
+ // === functors[35] ===
8100
+ ({ 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)]]]]]);
7914
8101
 
7915
8102
 
7916
8103
 
@@ -7963,8 +8150,8 @@ const tameModuleSource= ()=> {
7963
8150
  };$h͏_once.tameModuleSource(tameModuleSource);
7964
8151
  })()
7965
8152
  ,
7966
- // === functors[35] ===
7967
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
8153
+ // === functors[36] ===
8154
+ ({ 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)]]]]]);
7968
8155
 
7969
8156
 
7970
8157
 
@@ -7994,10 +8181,24 @@ const tameModuleSource= ()=> {
7994
8181
  * @import {ErrorInfo, ErrorInfoKind, LogRecord, NoteCallback, LoggedErrorHandler, MakeCausalConsole, MakeLoggingConsoleKit} from "./internal-types.js";
7995
8182
  */
7996
8183
 
8184
+ /**
8185
+ * Explicitly set a function's name, supporting use of arrow functions for which
8186
+ * source text doesn't include a name and no initial name is set by
8187
+ * NamedEvaluation
8188
+ * https://tc39.es/ecma262/multipage/syntax-directed-operations.html#sec-runtime-semantics-namedevaluation
8189
+ * Instead, we hope that tooling uses only the explicit `name` property.
8190
+ *
8191
+ * @template {Function} F
8192
+ * @param {string} name
8193
+ * @param {F} fn
8194
+ * @returns {F}
8195
+ */
8196
+ const defineName= (name, fn)=> defineProperty(fn, 'name', { value: name});
8197
+
7997
8198
  // For our internal debugging purposes, uncomment
7998
8199
  // const internalDebugConsole = console;
7999
8200
 
8000
- // The whitelists of console methods, from:
8201
+ // The permitted console methods, from:
8001
8202
  // Whatwg "living standard" https://console.spec.whatwg.org/
8002
8203
  // Node https://nodejs.org/dist/latest-v14.x/docs/api/console.html
8003
8204
  // MDN https://developer.mozilla.org/en-US/docs/Web/API/Console_API
@@ -8076,7 +8277,7 @@ const consoleOtherMethods= freeze([
8076
8277
  ]);
8077
8278
 
8078
8279
  /** @type {readonly [ConsoleProps, LogSeverity | undefined][]} */$h͏_once.consoleOtherMethods(consoleOtherMethods);
8079
- const consoleWhitelist= freeze([
8280
+ const consoleMethodPermits= freeze([
8080
8281
  ...consoleLevelMethods,
8081
8282
  ...consoleOtherMethods]);
8082
8283
 
@@ -8084,8 +8285,8 @@ const consoleWhitelist= freeze([
8084
8285
  /**
8085
8286
  * consoleOmittedProperties is currently unused. I record and maintain it here
8086
8287
  * with the intention that it be treated like the `false` entries in the main
8087
- * SES whitelist: that seeing these on the original console is expected, but
8088
- * seeing anything else that's outside the whitelist is surprising and should
8288
+ * SES permits: that seeing these on the original console is expected, but
8289
+ * seeing anything else that's outside the permits is surprising and should
8089
8290
  * provide a diagnostic.
8090
8291
  *
8091
8292
  * const consoleOmittedProperties = freeze([
@@ -8124,17 +8325,13 @@ const makeLoggingConsoleKit= (
8124
8325
  let logArray= [];
8125
8326
 
8126
8327
  const loggingConsole= fromEntries(
8127
- arrayMap(consoleWhitelist, ([name, _])=> {
8128
- // Use an arrow function so that it doesn't come with its own name in
8129
- // its printed form. Instead, we're hoping that tooling uses only
8130
- // the `.name` property set below.
8328
+ arrayMap(consoleMethodPermits, ([name, _])=> {
8131
8329
  /**
8132
8330
  * @param {...any} args
8133
8331
  */
8134
- const method= (...args)=> {
8332
+ const method= defineName(name, (...args)=> {
8135
8333
  arrayPush(logArray, [name, ...args]);
8136
- };
8137
- defineProperty(method, 'name', { value: name});
8334
+ });
8138
8335
  return [name, freeze(method)];
8139
8336
  }));
8140
8337
 
@@ -8254,8 +8451,10 @@ const makeCausalConsole= (baseConsole, loggedErrorHandler)=> {
8254
8451
  logError(severity, subError);
8255
8452
  }
8256
8453
  }finally {
8257
- // eslint-disable-next-line @endo/no-polymorphic-call
8258
- baseConsole.groupEnd();
8454
+ if( baseConsole.groupEnd) {
8455
+ // eslint-disable-next-line @endo/no-polymorphic-call
8456
+ baseConsole.groupEnd();
8457
+ }
8259
8458
  }
8260
8459
  };
8261
8460
 
@@ -8334,7 +8533,7 @@ const makeCausalConsole= (baseConsole, loggedErrorHandler)=> {
8334
8533
  /**
8335
8534
  * @param {...any} logArgs
8336
8535
  */
8337
- const levelMethod= (...logArgs)=> {
8536
+ const levelMethod= defineName(level, (...logArgs)=> {
8338
8537
  const subErrors= [];
8339
8538
  const argTags= extractErrorArgs(logArgs, subErrors);
8340
8539
  if( baseConsole[level]) {
@@ -8343,8 +8542,7 @@ const makeCausalConsole= (baseConsole, loggedErrorHandler)=> {
8343
8542
  }
8344
8543
  // @ts-expect-error ConsoleProp vs LogSeverity mismatch
8345
8544
  logSubErrors(level, subErrors);
8346
- };
8347
- defineProperty(levelMethod, 'name', { value: level});
8545
+ });
8348
8546
  return [level, freeze(levelMethod)];
8349
8547
  });
8350
8548
  const otherMethodNames= arrayFilter(
@@ -8355,13 +8553,12 @@ const makeCausalConsole= (baseConsole, loggedErrorHandler)=> {
8355
8553
  /**
8356
8554
  * @param {...any} args
8357
8555
  */
8358
- const otherMethod= (...args)=> {
8556
+ const otherMethod= defineName(name, (...args)=> {
8359
8557
  // @ts-ignore
8360
8558
  // eslint-disable-next-line @endo/no-polymorphic-call
8361
8559
  baseConsole[name](...args);
8362
8560
  return undefined;
8363
- };
8364
- defineProperty(otherMethod, 'name', { value: name});
8561
+ });
8365
8562
  return [name, freeze(otherMethod)];
8366
8563
  });
8367
8564
 
@@ -8422,23 +8619,21 @@ const defineCausalConsoleFromLogger= (loggedErrorHandler)=>{
8422
8619
  }
8423
8620
  return tlogger(...args);
8424
8621
  };
8425
- const makeNamed= (name, fn)=>
8426
- ({ [name]: (...args)=> fn(...args)})[ name];
8427
8622
 
8428
8623
  const baseConsole= fromEntries([
8429
8624
  ...arrayMap(consoleLevelMethods, ([name])=> [
8430
8625
  name,
8431
- makeNamed(name, logWithIndent)]),
8626
+ defineName(name, (...args)=> logWithIndent(...args))]),
8432
8627
 
8433
8628
  ...arrayMap(consoleOtherMethods, ([name])=> [
8434
8629
  name,
8435
- makeNamed(name, (...args)=> logWithIndent(name, ...args))])]);
8630
+ defineName(name, (...args)=> logWithIndent(name, ...args))])]);
8436
8631
 
8437
8632
 
8438
8633
  // https://console.spec.whatwg.org/#grouping
8439
8634
  for( const name of ['group', 'groupCollapsed']) {
8440
8635
  if( baseConsole[name]) {
8441
- baseConsole[name]= makeNamed(name, (...args)=> {
8636
+ baseConsole[name]= defineName(name, (...args)=> {
8442
8637
  if( args.length>= 1) {
8443
8638
  // Prefix the logged data with "group" or "groupCollapsed".
8444
8639
  logWithIndent(...args);
@@ -8448,16 +8643,17 @@ const defineCausalConsoleFromLogger= (loggedErrorHandler)=>{
8448
8643
  arrayPush(indents, ' ');
8449
8644
  });
8450
8645
  }else {
8451
- baseConsole[name]= ()=> { };
8646
+ baseConsole[name]= defineName(name, ()=> { });
8452
8647
  }
8453
8648
  }
8454
- if( baseConsole.groupEnd) {
8455
- baseConsole.groupEnd= makeNamed('groupEnd', (...args)=> {
8456
- arrayPop(indents);
8457
- });
8458
- }else {
8459
- baseConsole.groupEnd= ()=> { };
8460
- }
8649
+ baseConsole.groupEnd= defineName(
8650
+ 'groupEnd',
8651
+ baseConsole.groupEnd?
8652
+ (...args)=> {
8653
+ arrayPop(indents);
8654
+ }:
8655
+ ()=> { });
8656
+
8461
8657
  harden(baseConsole);
8462
8658
  const causalConsole= makeCausalConsole(
8463
8659
  /** @type {VirtualConsole} */ baseConsole,
@@ -8474,22 +8670,22 @@ freeze(defineCausalConsoleFromLogger);
8474
8670
  /** @type {FilterConsole} */
8475
8671
  const filterConsole= (baseConsole, filter, _topic= undefined)=> {
8476
8672
  // TODO do something with optional topic string
8477
- const whitelist= arrayFilter(
8478
- consoleWhitelist,
8673
+ const methodPermits= arrayFilter(
8674
+ consoleMethodPermits,
8479
8675
  ([name, _])=> name in baseConsole);
8480
8676
 
8481
- const methods= arrayMap(whitelist, ([name, severity])=> {
8677
+ const methods= arrayMap(methodPermits, ([name, severity])=> {
8482
8678
  /**
8483
8679
  * @param {...any} args
8484
8680
  */
8485
- const method= (...args)=> {
8681
+ const method= defineName(name, (...args)=> {
8486
8682
  // eslint-disable-next-line @endo/no-polymorphic-call
8487
8683
  if( severity=== undefined|| filter.canLog(severity)) {
8488
8684
  // @ts-ignore
8489
8685
  // eslint-disable-next-line @endo/no-polymorphic-call
8490
8686
  baseConsole[name](...args);
8491
8687
  }
8492
- };
8688
+ });
8493
8689
  return [name, freeze(method)];
8494
8690
  });
8495
8691
  const filteringConsole= fromEntries(methods);
@@ -8498,8 +8694,8 @@ const filterConsole= (baseConsole, filter, _topic= undefined)=> {
8498
8694
  freeze(filterConsole);
8499
8695
  })()
8500
8696
  ,
8501
- // === functors[36] ===
8502
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
8697
+ // === functors[37] ===
8698
+ ({ 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)]]]]]);
8503
8699
 
8504
8700
 
8505
8701
 
@@ -8623,8 +8819,8 @@ const makeRejectionHandlers= (reportReason)=>{
8623
8819
  };$h͏_once.makeRejectionHandlers(makeRejectionHandlers);
8624
8820
  })()
8625
8821
  ,
8626
- // === functors[37] ===
8627
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
8822
+ // === functors[38] ===
8823
+ ({ 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)]]]]]);
8628
8824
 
8629
8825
 
8630
8826
 
@@ -8827,8 +9023,8 @@ const tameConsole= (
8827
9023
  };$h͏_once.tameConsole(tameConsole);
8828
9024
  })()
8829
9025
  ,
8830
- // === functors[38] ===
8831
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
9026
+ // === functors[39] ===
9027
+ ({ 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)]]]]]);
8832
9028
 
8833
9029
 
8834
9030
 
@@ -8849,8 +9045,8 @@ const tameConsole= (
8849
9045
 
8850
9046
 
8851
9047
 
8852
- // Whitelist names from https://v8.dev/docs/stack-trace-api
8853
- // Whitelisting only the names used by error-stack-shim/src/v8StackFrames
9048
+ // Permit names from https://v8.dev/docs/stack-trace-api
9049
+ // Permiting only the names used by error-stack-shim/src/v8StackFrames
8854
9050
  // callSiteToFrame to shim the error stack proposal.
8855
9051
  const safeV8CallSiteMethodNames= [
8856
9052
  // suppress 'getThis' definitely
@@ -8875,7 +9071,7 @@ const safeV8CallSiteMethodNames= [
8875
9071
  'getPosition',
8876
9072
  'getScriptNameOrSourceURL',
8877
9073
 
8878
- 'toString' // TODO replace to use only whitelisted info
9074
+ 'toString' // TODO replace to use only permitted info
8879
9075
  ];
8880
9076
 
8881
9077
  // TODO this is a ridiculously expensive way to attenuate callsites.
@@ -9173,8 +9369,8 @@ const tameV8ErrorConstructor= (
9173
9369
  };$h͏_once.tameV8ErrorConstructor(tameV8ErrorConstructor);
9174
9370
  })()
9175
9371
  ,
9176
- // === functors[39] ===
9177
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
9372
+ // === functors[40] ===
9373
+ ({ 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)]]]]]);
9178
9374
 
9179
9375
 
9180
9376
 
@@ -9471,8 +9667,10 @@ function tameErrorConstructor(
9471
9667
  }$h͏_once.default( tameErrorConstructor);
9472
9668
  })()
9473
9669
  ,
9474
- // === functors[40] ===
9475
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let getenv,Map,Set,TypeError,arrayJoin,arrayMap,arrayPush,create,freeze,generatorNext,generatorThrow,getOwnPropertyNames,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)]],["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)]],["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)]]]]]);
9670
+ // === functors[41] ===
9671
+ ({ 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)]]]]]);
9672
+
9673
+
9476
9674
 
9477
9675
 
9478
9676
 
@@ -9559,14 +9757,23 @@ const loadModuleSource= (
9559
9757
  moduleLoads,
9560
9758
  importMeta)=>
9561
9759
  {
9562
- const { resolveHook}= weakmapGet(compartmentPrivateFields, compartment);
9760
+ const { resolveHook, name: compartmentName}= weakmapGet(
9761
+ compartmentPrivateFields,
9762
+ compartment);
9563
9763
 
9564
- // resolve all imports relative to this referrer module.
9565
- const resolvedImports= resolveAll(
9566
- moduleSource.imports,
9567
- resolveHook,
9568
- moduleSpecifier);
9569
9764
 
9765
+ const { imports}= moduleSource;
9766
+ if(
9767
+ !isArray(imports)||
9768
+ arraySome(imports, (specifier)=>typeof specifier!== 'string'))
9769
+ {
9770
+ throw makeError(
9771
+ X `Invalid module source: 'imports' must be an array of strings, got ${imports} for module ${q(moduleSpecifier)} of compartment ${q(compartmentName)}`);
9772
+
9773
+ }
9774
+
9775
+ // resolve all imports relative to this referrer module.
9776
+ const resolvedImports= resolveAll(imports, resolveHook, moduleSpecifier);
9570
9777
  const moduleRecord= freeze({
9571
9778
  compartment,
9572
9779
  moduleSource,
@@ -10124,8 +10331,8 @@ const loadNow= (
10124
10331
  };$h͏_once.loadNow(loadNow);
10125
10332
  })()
10126
10333
  ,
10127
- // === functors[41] ===
10128
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
10334
+ // === functors[42] ===
10335
+ ({ 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)]]]]]);
10129
10336
 
10130
10337
 
10131
10338
 
@@ -10327,8 +10534,8 @@ const getDeferredExports= (
10327
10534
  };$h͏_once.getDeferredExports(getDeferredExports);
10328
10535
  })()
10329
10536
  ,
10330
- // === functors[42] ===
10331
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
10537
+ // === functors[43] ===
10538
+ ({ 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)]]]]]);
10332
10539
 
10333
10540
 
10334
10541
 
@@ -10423,8 +10630,10 @@ const compartmentEvaluate= (compartmentFields, source, options)=> {
10423
10630
  };$h͏_once.compartmentEvaluate(compartmentEvaluate);
10424
10631
  })()
10425
10632
  ,
10426
- // === functors[43] ===
10427
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
10633
+ // === functors[44] ===
10634
+ ({ 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)]]]]]);
10635
+
10636
+
10428
10637
 
10429
10638
 
10430
10639
 
@@ -10557,13 +10766,15 @@ $h͏_once.makeVirtualModuleInstance(makeVirtualModuleInstance);const makeModuleI
10557
10766
  __fixedExportMap__: fixedExportMap= {},
10558
10767
  __liveExportMap__: liveExportMap= {},
10559
10768
  __reexportMap__: reexportMap= {},
10769
+ __needsImport__: needsImport= false,
10560
10770
  __needsImportMeta__: needsImportMeta= false,
10561
10771
  __syncModuleFunctor__}=
10562
10772
  moduleSource;
10563
10773
 
10564
10774
  const compartmentFields= weakmapGet(privateFields, compartment);
10565
10775
 
10566
- const { __shimTransforms__, importMetaHook}= compartmentFields;
10776
+ const { __shimTransforms__, resolveHook, importMetaHook, compartmentImport}=
10777
+ compartmentFields;
10567
10778
 
10568
10779
  const { exportsProxy, exportsTarget, activate}= getDeferredExports(
10569
10780
  compartment,
@@ -10597,6 +10808,14 @@ $h͏_once.makeVirtualModuleInstance(makeVirtualModuleInstance);const makeModuleI
10597
10808
  importMetaHook(moduleSpecifier, importMeta);
10598
10809
  }
10599
10810
 
10811
+ /** @type {(fullSpecifier: string) => Promise<ModuleExportsNamespace>} */
10812
+ let dynamicImport;
10813
+ if( needsImport) {
10814
+ /** @param {string} importSpecifier */
10815
+ dynamicImport= async(importSpecifier)=>
10816
+ compartmentImport(resolveHook(importSpecifier, moduleSpecifier));
10817
+ }
10818
+
10600
10819
  // {_localName_: [{get, set, notify}]} used to merge all the export updaters.
10601
10820
  const localGetNotify= create(null);
10602
10821
 
@@ -10888,6 +11107,7 @@ $h͏_once.makeVirtualModuleInstance(makeVirtualModuleInstance);const makeModuleI
10888
11107
  imports: freeze(imports),
10889
11108
  onceVar: freeze(onceVar),
10890
11109
  liveVar: freeze(liveVar),
11110
+ import: dynamicImport,
10891
11111
  importMeta}));
10892
11112
 
10893
11113
 
@@ -10910,8 +11130,8 @@ $h͏_once.makeVirtualModuleInstance(makeVirtualModuleInstance);const makeModuleI
10910
11130
  };$h͏_once.makeModuleInstance(makeModuleInstance);
10911
11131
  })()
10912
11132
  ,
10913
- // === functors[44] ===
10914
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
11133
+ // === functors[45] ===
11134
+ ({ 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)]]]]]);
10915
11135
 
10916
11136
 
10917
11137
 
@@ -10989,27 +11209,27 @@ function mayBeVirtualModuleSource(moduleSource) {
10989
11209
  function validateVirtualModuleSource(moduleSource, moduleSpecifier) {
10990
11210
  const { exports}= moduleSource;
10991
11211
  isArray(exports)||
10992
- Fail `Property 'exports' of a third-party module source must be an array, got ${q(
11212
+ Fail `Invalid module source: 'exports' of a virtual module source must be an array, got ${q(
10993
11213
  exports)
10994
11214
  }, for module ${q(moduleSpecifier)}`;
10995
11215
  }
10996
11216
 
10997
11217
  function validateModuleSource(moduleSource, moduleSpecifier) {
10998
11218
  isObject(moduleSource)||
10999
- Fail `Module sources must be of type object, got ${q(
11219
+ Fail `Invalid module source: must be of type object, got ${q(
11000
11220
  moduleSource)
11001
11221
  }, for module ${q(moduleSpecifier)}`;
11002
11222
  const { imports, exports, reexports= []}= moduleSource;
11003
11223
  isArray(imports)||
11004
- Fail `Property 'imports' of a module source must be an array, got ${q(
11224
+ Fail `Invalid module source: 'imports' must be an array, got ${q(
11005
11225
  imports)
11006
11226
  }, for module ${q(moduleSpecifier)}`;
11007
11227
  isArray(exports)||
11008
- Fail `Property 'exports' of a precompiled module source must be an array, got ${q(
11228
+ Fail `Invalid module source: 'exports' must be an array, got ${q(
11009
11229
  exports)
11010
11230
  }, for module ${q(moduleSpecifier)}`;
11011
11231
  isArray(reexports)||
11012
- Fail `Property 'reexports' of a precompiled module source must be an array if present, got ${q(
11232
+ Fail `Invalid module source: 'reexports' must be an array if present, got ${q(
11013
11233
  reexports)
11014
11234
  }, for module ${q(moduleSpecifier)}`;
11015
11235
  }
@@ -11051,9 +11271,7 @@ const instantiate= (
11051
11271
  resolvedImports);
11052
11272
 
11053
11273
  }else {
11054
- throw TypeError(
11055
- `importHook must provide a module source, got ${q(moduleSource)}`);
11056
-
11274
+ throw TypeError( `Invalid module source, got ${q(moduleSource)}`);
11057
11275
  }
11058
11276
 
11059
11277
  // Memoize.
@@ -11074,8 +11292,33 @@ const instantiate= (
11074
11292
  };$h͏_once.instantiate(instantiate);
11075
11293
  })()
11076
11294
  ,
11077
- // === functors[45] ===
11078
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let Map,TypeError,WeakMap,assign,defineProperties,promiseThen,toStringTagSymbol,weakmapGet,weakmapSet,setGlobalObjectSymbolUnscopables,setGlobalObjectConstantProperties,setGlobalObjectMutableProperties,setGlobalObjectEvaluators,assert,assertEqual,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)]],["assign", [$h͏_a => (assign = $h͏_a)]],["defineProperties", [$h͏_a => (defineProperties = $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)]]]],["./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)]]]]]);
11295
+ // === functors[46] ===
11296
+ ({ 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)]]]]]);
11297
+
11298
+
11299
+
11300
+
11301
+
11302
+
11303
+
11304
+
11305
+
11306
+
11307
+
11308
+
11309
+
11310
+
11311
+
11312
+
11313
+
11314
+
11315
+
11316
+
11317
+
11318
+
11319
+
11320
+
11321
+
11079
11322
 
11080
11323
 
11081
11324
 
@@ -11104,7 +11347,21 @@ const instantiate= (
11104
11347
 
11105
11348
 
11106
11349
 
11107
- /** @import {ModuleDescriptor} from '../types.js' */
11350
+
11351
+
11352
+
11353
+
11354
+
11355
+
11356
+
11357
+
11358
+
11359
+
11360
+
11361
+
11362
+
11363
+
11364
+ /** @import {ModuleDescriptor, ModuleExportsNamespace} from '../types.js' */
11108
11365
 
11109
11366
  // moduleAliases associates every public module exports namespace with its
11110
11367
  // corresponding compartment and specifier so they can be used to link modules
@@ -11248,7 +11505,9 @@ defineProperties(InertCompartment, {
11248
11505
  * @param {MakeCompartmentConstructor} targetMakeCompartmentConstructor
11249
11506
  * @param {Record<string, any>} intrinsics
11250
11507
  * @param {(object: object) => void} markVirtualizedNativeFunction
11251
- * @param {Compartment} [parentCompartment]
11508
+ * @param {object} [options]
11509
+ * @param {Compartment} [options.parentCompartment]
11510
+ * @param {boolean} [options.enforceNew]
11252
11511
  * @returns {Compartment['constructor']}
11253
11512
  */
11254
11513
 
@@ -11261,7 +11520,7 @@ defineProperties(InertCompartment, {
11261
11520
  // positional arguments, this function detects the temporary sigil __options__
11262
11521
  // on the first argument and coerces compartments arguments into a single
11263
11522
  // compartments object.
11264
- const compartmentOptions= (...args)=> {
11523
+ const compartmentOptions= (...args)=> {
11265
11524
  if( args.length=== 0) {
11266
11525
  return {};
11267
11526
  }
@@ -11301,15 +11560,15 @@ const compartmentOptions= (...args)=> {
11301
11560
  }
11302
11561
  };
11303
11562
 
11304
- /** @type {MakeCompartmentConstructor} */
11563
+ /** @type {MakeCompartmentConstructor} */$h͏_once.compartmentOptions(compartmentOptions);
11305
11564
  const makeCompartmentConstructor= (
11306
11565
  targetMakeCompartmentConstructor,
11307
11566
  intrinsics,
11308
11567
  markVirtualizedNativeFunction,
11309
- parentCompartment= undefined)=>
11568
+ { parentCompartment= undefined, enforceNew= false}= {})=>
11310
11569
  {
11311
11570
  function Compartment(...args) {
11312
- if( new.target=== undefined) {
11571
+ if( enforceNew&& new.target=== undefined) {
11313
11572
  throw TypeError(
11314
11573
  "Class constructor Compartment cannot be invoked without 'new'");
11315
11574
 
@@ -11329,7 +11588,10 @@ const makeCompartmentConstructor= (
11329
11588
  importMetaHook,
11330
11589
  __noNamespaceBox__: noNamespaceBox= false}=
11331
11590
  compartmentOptions(...args);
11332
- const globalTransforms= [...transforms, ...__shimTransforms__];
11591
+ const globalTransforms= arrayFlatMap(
11592
+ [transforms, __shimTransforms__],
11593
+ identity);
11594
+
11333
11595
  const endowments= { __proto__: null, ...endowmentsOption};
11334
11596
  const moduleMap= { __proto__: null, ...moduleMapOption};
11335
11597
 
@@ -11374,6 +11636,43 @@ const makeCompartmentConstructor= (
11374
11636
 
11375
11637
  assign(globalObject, endowments);
11376
11638
 
11639
+ /**
11640
+ * In support dynamic import in a module source loaded by this compartment,
11641
+ * like `await import(importSpecifier)`, induces this compartment to import
11642
+ * a module, returning a promise for the resulting module exports
11643
+ * namespace.
11644
+ * Unlike `compartment.import`, never creates a box object for the
11645
+ * namespace as that behavior is deprecated and inconsistent with the
11646
+ * standard behavior of dynamic import.
11647
+ * Obliges the caller to resolve import specifiers to their corresponding
11648
+ * full specifier.
11649
+ * That is, every module must have its own dynamic import function that
11650
+ * closes over the surrounding module's full module specifier and calls
11651
+ * through to this function.
11652
+ * @param {string} fullSpecifier - A full specifier is a key in the
11653
+ * compartment's module memo.
11654
+ * The method `compartment.import` accepts a full specifier, but dynamic
11655
+ * import accepts an import specifier and resolves it to a full specifier
11656
+ * relative to the calling module's full specifier.
11657
+ * @returns {Promise<ModuleExportsNamespace>}
11658
+ */
11659
+ const compartmentImport= async(fullSpecifier)=> {
11660
+ if( typeof resolveHook!== 'function') {
11661
+ throw TypeError(
11662
+ `Compartment does not support dynamic import: no configured resolveHook for compartment ${q(name)}`);
11663
+
11664
+ }
11665
+ await load(privateFields, moduleAliases, this, fullSpecifier);
11666
+ const { execute, exportsProxy}= link(
11667
+ privateFields,
11668
+ moduleAliases,
11669
+ this,
11670
+ fullSpecifier);
11671
+
11672
+ execute();
11673
+ return exportsProxy;
11674
+ };
11675
+
11377
11676
  weakmapSet(privateFields, this, {
11378
11677
  name: `${name}`,
11379
11678
  globalTransforms,
@@ -11390,7 +11689,8 @@ const makeCompartmentConstructor= (
11390
11689
  deferredExports,
11391
11690
  instances,
11392
11691
  parentCompartment,
11393
- noNamespaceBox});
11692
+ noNamespaceBox,
11693
+ compartmentImport});
11394
11694
 
11395
11695
  }
11396
11696
 
@@ -11400,8 +11700,8 @@ const makeCompartmentConstructor= (
11400
11700
  };$h͏_once.makeCompartmentConstructor(makeCompartmentConstructor);
11401
11701
  })()
11402
11702
  ,
11403
- // === functors[46] ===
11404
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let FERAL_FUNCTION,Float32Array,Map,Set,String,getOwnPropertyDescriptor,getPrototypeOf,iterateArray,iterateMap,iterateSet,iterateString,matchAllRegExp,matchAllSymbol,regexpPrototype,globalThis,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)]]]],["./compartment.js", [["InertCompartment", [$h͏_a => (InertCompartment = $h͏_a)]]]]]);
11703
+ // === functors[47] ===
11704
+ ({ 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,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)]]]],["./compartment.js", [["InertCompartment", [$h͏_a => (InertCompartment = $h͏_a)]]]]]);
11405
11705
 
11406
11706
 
11407
11707
 
@@ -11568,8 +11868,8 @@ const getAnonymousIntrinsics= ()=> {
11568
11868
  };$h͏_once.getAnonymousIntrinsics(getAnonymousIntrinsics);
11569
11869
  })()
11570
11870
  ,
11571
- // === functors[47] ===
11572
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
11871
+ // === functors[48] ===
11872
+ ({ 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)]]]]]);
11573
11873
 
11574
11874
 
11575
11875
  /** @import {Harden} from '../types.js'; */
@@ -11604,8 +11904,8 @@ const tameHarden= (safeHarden, hardenTaming)=> {
11604
11904
  freeze(tameHarden);
11605
11905
  })()
11606
11906
  ,
11607
- // === functors[48] ===
11608
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
11907
+ // === functors[49] ===
11908
+ ({ 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)]]]]]);
11609
11909
 
11610
11910
 
11611
11911
 
@@ -11623,8 +11923,8 @@ freeze(tameHarden);
11623
11923
  * `Symbol` constructor on constructed compartments.
11624
11924
  *
11625
11925
  * Starting these properties as configurable assumes two succeeding phases of
11626
- * processing: A whitelisting phase, that
11627
- * removes all properties not on the whitelist (which requires them to be
11926
+ * processing: A permit enforcement phase, that
11927
+ * removes all properties not on the permits (which requires them to be
11628
11928
  * configurable) and a global hardening step that freezes all primordials,
11629
11929
  * returning these properties to their expected non-configurable status.
11630
11930
  *
@@ -11671,8 +11971,8 @@ const tameSymbolConstructor= ()=> {
11671
11971
  };$h͏_once.tameSymbolConstructor(tameSymbolConstructor);
11672
11972
  })()
11673
11973
  ,
11674
- // === functors[49] ===
11675
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
11974
+ // === functors[50] ===
11975
+ ({ 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)]]]]]);
11676
11976
 
11677
11977
 
11678
11978
 
@@ -11884,8 +12184,8 @@ const tameFauxDataProperties= (intrinsics)=>{
11884
12184
  };$h͏_once.tameFauxDataProperties(tameFauxDataProperties);
11885
12185
  })()
11886
12186
  ,
11887
- // === functors[50] ===
11888
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
12187
+ // === functors[51] ===
12188
+ ({ 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)]]]]]);
11889
12189
 
11890
12190
 
11891
12191
 
@@ -11916,8 +12216,8 @@ const tameRegeneratorRuntime= ()=> {
11916
12216
  };$h͏_once.tameRegeneratorRuntime(tameRegeneratorRuntime);
11917
12217
  })()
11918
12218
  ,
11919
- // === functors[51] ===
11920
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
12219
+ // === functors[52] ===
12220
+ ({ 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)]]]]]);
11921
12221
 
11922
12222
 
11923
12223
 
@@ -12005,8 +12305,120 @@ const shimArrayBufferTransfer= ()=> {
12005
12305
  };$h͏_once.shimArrayBufferTransfer(shimArrayBufferTransfer);
12006
12306
  })()
12007
12307
  ,
12008
- // === functors[52] ===
12009
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let getenv,FERAL_FUNCTION,FERAL_EVAL,TypeError,arrayFilter,globalThis,is,ownKeys,stringSplit,noEvalEvaluate,getOwnPropertyNames,getPrototypeOf,makeHardener,makeIntrinsicsCollector,whitelistIntrinsics,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;$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 => (whitelistIntrinsics = $h͏_a)]]]],["./tame-function-constructors.js", [["default", [$h͏_a => (tameFunctionConstructors = $h͏_a)]]]],["./tame-date-constructor.js", [["default", [$h͏_a => (tameDateConstructor = $h͏_a)]]]],["./tame-math-object.js", [["default", [$h͏_a => (tameMathObject = $h͏_a)]]]],["./tame-regexp-constructor.js", [["default", [$h͏_a => (tameRegExpConstructor = $h͏_a)]]]],["./enable-property-overrides.js", [["default", [$h͏_a => (enablePropertyOverrides = $h͏_a)]]]],["./tame-locale-methods.js", [["default", [$h͏_a => (tameLocaleMethods = $h͏_a)]]]],["./global-object.js", [["setGlobalObjectConstantProperties", [$h͏_a => (setGlobalObjectConstantProperties = $h͏_a)]],["setGlobalObjectMutableProperties", [$h͏_a => (setGlobalObjectMutableProperties = $h͏_a)]],["setGlobalObjectEvaluators", [$h͏_a => (setGlobalObjectEvaluators = $h͏_a)]]]],["./make-safe-evaluator.js", [["makeSafeEvaluator", [$h͏_a => (makeSafeEvaluator = $h͏_a)]]]],["./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)]]]]]);
12308
+ // === functors[53] ===
12309
+ ({ 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)]]]]]);
12310
+
12311
+
12312
+ /**
12313
+ * @import {Reporter, GroupReporter} from './reporting-types.js'
12314
+ */
12315
+
12316
+ /**
12317
+ * Creates a suitable reporter for internal errors and warnings out of the
12318
+ * Node.js console.error to ensure all messages to go stderr, including the
12319
+ * group label.
12320
+ * Accounts for the extra space introduced by console.error as a delimiter
12321
+ * between the indent and subsequent arguments.
12322
+ *
12323
+ * @param {(...message: Array<any>) => void} print
12324
+ */
12325
+ const makeReportPrinter= (print)=>{
12326
+ let indent= false;
12327
+ /** @param {Array<any>} args */
12328
+ const printIndent= (...args)=> {
12329
+ if( indent) {
12330
+ print(' ', ...args);
12331
+ }else {
12332
+ print(...args);
12333
+ }
12334
+ };
12335
+ return (/** @type {GroupReporter} */ {
12336
+ warn(...args) {
12337
+ printIndent(...args);
12338
+ },
12339
+ error(...args) {
12340
+ printIndent(...args);
12341
+ },
12342
+ groupCollapsed(...args) {
12343
+ assert(!indent);
12344
+ print(...args);
12345
+ indent= true;
12346
+ },
12347
+ groupEnd() {
12348
+ indent= false;
12349
+ }});
12350
+
12351
+ };
12352
+
12353
+ const mute= ()=> { };
12354
+
12355
+ /**
12356
+ * @param {"platform" | "console" | "none"} reporting
12357
+ */
12358
+ const chooseReporter= (reporting)=>{
12359
+ if( reporting=== 'none') {
12360
+ return makeReportPrinter(mute);
12361
+ }
12362
+ if( reporting!== 'platform'&& reporting!== 'console') {
12363
+ throw new TypeError( `Invalid lockdown reporting option: ${reporting}`);
12364
+ }
12365
+ if(
12366
+ reporting=== 'console'||
12367
+ globalThis.window=== globalThis||
12368
+ globalThis.importScripts!== undefined)
12369
+ {
12370
+ return console;
12371
+ }
12372
+ if( globalThis.console!== undefined) {
12373
+ // On Node.js, we send all feedback to stderr, regardless of purported level.
12374
+ const console= globalThis.console;
12375
+ const error= functionBind(console.error, console);
12376
+ return makeReportPrinter(error);
12377
+ }
12378
+ if( globalThis.print!== undefined) {
12379
+ return makeReportPrinter(globalThis.print);
12380
+ }
12381
+ return makeReportPrinter(mute);
12382
+ };
12383
+
12384
+ /**
12385
+ * @param {string} groupLabel
12386
+ * @param {GroupReporter} console
12387
+ * @param {(internalConsole: Reporter) => void} callback
12388
+ */$h͏_once.chooseReporter(chooseReporter);
12389
+ const reportInGroup= (groupLabel, console, callback)=> {
12390
+ const { warn, error, groupCollapsed, groupEnd}= console;
12391
+ const grouping= groupCollapsed&& groupEnd;
12392
+ let groupStarted= false;
12393
+ try {
12394
+ return callback({
12395
+ warn(...args) {
12396
+ if( grouping&& !groupStarted) {
12397
+ groupCollapsed(groupLabel);
12398
+ groupStarted= true;
12399
+ }
12400
+ warn(...args);
12401
+ },
12402
+ error(...args) {
12403
+ if( grouping&& !groupStarted) {
12404
+ groupCollapsed(groupLabel);
12405
+ groupStarted= true;
12406
+ }
12407
+ error(...args);
12408
+ }});
12409
+
12410
+ }finally {
12411
+ if( grouping&& groupStarted) {
12412
+ groupEnd();
12413
+ groupStarted= false;
12414
+ }
12415
+ }
12416
+ };$h͏_once.reportInGroup(reportInGroup);
12417
+ })()
12418
+ ,
12419
+ // === functors[54] ===
12420
+ ({ 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)]]]]]);
12421
+
12010
12422
 
12011
12423
 
12012
12424
 
@@ -12170,19 +12582,24 @@ const repairIntrinsics= (options= {})=> {
12170
12582
 
12171
12583
  const {
12172
12584
  errorTaming= getenv('LOCKDOWN_ERROR_TAMING', 'safe'),
12173
- errorTrapping= /** @type {"platform" | "none" | "report" | "abort" | "exit" | undefined} */
12585
+ errorTrapping= /** @type {"platform" | "none" | "report" | "abort" | "exit"} */
12174
12586
  getenv('LOCKDOWN_ERROR_TRAPPING', 'platform'),
12175
12587
 
12176
- unhandledRejectionTrapping= /** @type {"none" | "report" | undefined} */
12588
+ reporting= /** @type {"platform" | "console" | "none"} */
12589
+ getenv('LOCKDOWN_REPORTING', 'platform'),
12590
+
12591
+ unhandledRejectionTrapping= /** @type {"none" | "report"} */
12177
12592
  getenv('LOCKDOWN_UNHANDLED_REJECTION_TRAPPING', 'report'),
12178
12593
 
12179
12594
  regExpTaming= getenv('LOCKDOWN_REGEXP_TAMING', 'safe'),
12180
12595
  localeTaming= getenv('LOCKDOWN_LOCALE_TAMING', 'safe'),
12181
12596
 
12182
- consoleTaming= /** @type {'unsafe' | 'safe' | undefined} */
12597
+ consoleTaming= /** @type {'unsafe' | 'safe'} */
12183
12598
  getenv('LOCKDOWN_CONSOLE_TAMING', 'safe'),
12184
12599
 
12185
- overrideTaming= getenv('LOCKDOWN_OVERRIDE_TAMING', 'moderate'),
12600
+ overrideTaming= /** @type {'moderate' | 'min' | 'severe'} */
12601
+ getenv('LOCKDOWN_OVERRIDE_TAMING', 'moderate'),
12602
+
12186
12603
  stackFiltering= getenv('LOCKDOWN_STACK_FILTERING', 'concise'),
12187
12604
  domainTaming= getenv('LOCKDOWN_DOMAIN_TAMING', 'safe'),
12188
12605
  evalTaming= getenv('LOCKDOWN_EVAL_TAMING', 'safeEval'),
@@ -12196,8 +12613,8 @@ const repairIntrinsics= (options= {})=> {
12196
12613
  'safe'),
12197
12614
 
12198
12615
  __hardenTaming__= getenv('LOCKDOWN_HARDEN_TAMING', 'safe'),
12199
- dateTaming= 'safe', // deprecated
12200
- mathTaming= 'safe', // deprecated
12616
+ dateTaming, // deprecated
12617
+ mathTaming, // deprecated
12201
12618
  ...extraOptions}=
12202
12619
  options;
12203
12620
 
@@ -12216,6 +12633,22 @@ const repairIntrinsics= (options= {})=> {
12216
12633
  extraOptionsNames.length=== 0||
12217
12634
  Fail `lockdown(): non supported option ${q(extraOptionsNames)}`;
12218
12635
 
12636
+ const reporter= chooseReporter(reporting);
12637
+ const { warn}= reporter;
12638
+
12639
+ if( dateTaming!== undefined) {
12640
+ // eslint-disable-next-line no-console
12641
+ warn(
12642
+ `SES The 'dateTaming' option is deprecated and does nothing. In the future specifying it will be an error.`);
12643
+
12644
+ }
12645
+ if( mathTaming!== undefined) {
12646
+ // eslint-disable-next-line no-console
12647
+ warn(
12648
+ `SES The 'mathTaming' option is deprecated and does nothing. In the future specifying it will be an error.`);
12649
+
12650
+ }
12651
+
12219
12652
  priorRepairIntrinsics=== undefined||
12220
12653
  // eslint-disable-next-line @endo/no-polymorphic-call
12221
12654
  assert.fail(
@@ -12281,7 +12714,7 @@ const repairIntrinsics= (options= {})=> {
12281
12714
  const markVirtualizedNativeFunction= tameFunctionToString();
12282
12715
 
12283
12716
  const { addIntrinsics, completePrototypes, finalIntrinsics}=
12284
- makeIntrinsicsCollector();
12717
+ makeIntrinsicsCollector(reporter);
12285
12718
 
12286
12719
  // @ts-expect-error __hardenTaming__ could be any string
12287
12720
  const tamedHarden= tameHarden(safeHarden, __hardenTaming__);
@@ -12289,9 +12722,9 @@ const repairIntrinsics= (options= {})=> {
12289
12722
 
12290
12723
  addIntrinsics(tameFunctionConstructors());
12291
12724
 
12292
- addIntrinsics(tameDateConstructor(dateTaming));
12725
+ addIntrinsics(tameDateConstructor());
12293
12726
  addIntrinsics(tameErrorConstructor(errorTaming, stackFiltering));
12294
- addIntrinsics(tameMathObject(mathTaming));
12727
+ addIntrinsics(tameMathObject());
12295
12728
  addIntrinsics(tameRegExpConstructor(regExpTaming));
12296
12729
  addIntrinsics(tameSymbolConstructor());
12297
12730
  addIntrinsics(shimArrayBufferTransfer());
@@ -12365,13 +12798,22 @@ const repairIntrinsics= (options= {})=> {
12365
12798
  tameFauxDataProperties(intrinsics);
12366
12799
 
12367
12800
  /**
12368
- * 2. WHITELIST to standardize the environment.
12801
+ * 2. Enforce PERMITS on shared intrinsics
12369
12802
  */
12370
12803
 
12371
12804
  // Remove non-standard properties.
12372
- // All remaining function encountered during whitelisting are
12805
+ // All remaining functions encountered during whitelisting are
12373
12806
  // branded as honorary native functions.
12374
- whitelistIntrinsics(intrinsics, markVirtualizedNativeFunction);
12807
+ reportInGroup(
12808
+ 'SES Removing unpermitted intrinsics',
12809
+ reporter,
12810
+ (groupReporter)=>
12811
+ removeUnpermittedIntrinsics(
12812
+ intrinsics,
12813
+ markVirtualizedNativeFunction,
12814
+ groupReporter));
12815
+
12816
+
12375
12817
 
12376
12818
  // Initialize the powerful initial global, i.e., the global of the
12377
12819
  // start compartment, from the intrinsics.
@@ -12433,7 +12875,14 @@ const repairIntrinsics= (options= {})=> {
12433
12875
  // therefore before vetted shims rather than afterwards. It is not
12434
12876
  // clear yet which is better.
12435
12877
  // @ts-ignore enablePropertyOverrides does its own input validation
12436
- enablePropertyOverrides(intrinsics, overrideTaming, overrideDebug);
12878
+ reportInGroup('SES Enabling property overrides', reporter, (groupReporter)=>
12879
+ enablePropertyOverrides(
12880
+ intrinsics,
12881
+ overrideTaming,
12882
+ groupReporter,
12883
+ overrideDebug));
12884
+
12885
+
12437
12886
  if( legacyRegeneratorRuntimeTaming=== 'unsafe-ignore') {
12438
12887
  tameRegeneratorRuntime();
12439
12888
  }
@@ -12469,8 +12918,8 @@ const repairIntrinsics= (options= {})=> {
12469
12918
  };$h͏_once.repairIntrinsics(repairIntrinsics);
12470
12919
  })()
12471
12920
  ,
12472
- // === functors[53] ===
12473
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
12921
+ // === functors[55] ===
12922
+ ({ 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)]]]]]);
12474
12923
 
12475
12924
 
12476
12925
 
@@ -12509,30 +12958,38 @@ globalThis.repairIntrinsics= (options)=>{
12509
12958
  };
12510
12959
  })()
12511
12960
  ,
12512
- // === functors[54] ===
12513
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; let globalThis,makeCompartmentConstructor,tameFunctionToString,getGlobalIntrinsics;$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)]]]]]);
12961
+ // === functors[56] ===
12962
+ ({ 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)]]]]]);
12963
+
12514
12964
 
12515
12965
 
12516
12966
 
12517
12967
 
12518
12968
  const markVirtualizedNativeFunction= tameFunctionToString();
12519
12969
 
12970
+ const muteReporter= chooseReporter('none');
12971
+
12520
12972
  // @ts-ignore Compartment is definitely on globalThis.
12521
12973
  globalThis.Compartment= makeCompartmentConstructor(
12522
12974
  makeCompartmentConstructor,
12523
- getGlobalIntrinsics(globalThis),
12524
- markVirtualizedNativeFunction);
12975
+ // Any reporting that would need to be done should have already been done
12976
+ // during `lockdown()`.
12977
+ // See https://github.com/endojs/endo/pull/2624#discussion_r1840979770
12978
+ getGlobalIntrinsics(globalThis, muteReporter),
12979
+ markVirtualizedNativeFunction,
12980
+ {
12981
+ enforceNew: true});
12525
12982
  })()
12526
12983
  ,
12527
- // === functors[55] ===
12528
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
12984
+ // === functors[57] ===
12985
+ ({ 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)]]]]]);
12529
12986
 
12530
12987
 
12531
12988
  globalThis.assert= assert;
12532
12989
  })()
12533
12990
  ,
12534
- // === functors[56] ===
12535
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, 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)]]]]]);
12991
+ // === functors[58] ===
12992
+ ({ 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)]]]]]);
12536
12993
 
12537
12994
 
12538
12995
 
@@ -12584,8 +13041,8 @@ globalThis[MAKE_CAUSAL_CONSOLE_FROM_LOGGER_KEY_FOR_SES_AVA]=
12584
13041
  makeCausalConsoleFromLoggerForSesAva;
12585
13042
  })()
12586
13043
  ,
12587
- // === functors[57] ===
12588
- ({ imports: $h͏_imports, liveVar: $h͏_live, onceVar: $h͏_once, importMeta: $h͏____meta, }) => (function () { 'use strict'; $h͏_imports([["./src/lockdown-shim.js", []],["./src/compartment-shim.js", []],["./src/assert-shim.js", []],["./src/console-shim.js", []]]);
13044
+ // === functors[59] ===
13045
+ ({ 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", []]]);
12589
13046
  })()
12590
13047
  ,
12591
13048
  ]);