ses 1.6.0 → 1.8.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.
package/dist/ses.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- // ses@1.6.0
1
+ // ses@1.8.0
2
2
  'use strict';
3
3
  (functors => {
4
4
 
@@ -100,6 +100,7 @@
100
100
  functionPrototype: cell("functionPrototype"),
101
101
  promisePrototype: cell("promisePrototype"),
102
102
  generatorPrototype: cell("generatorPrototype"),
103
+ iteratorPrototype: cell("iteratorPrototype"),
103
104
  typedArrayPrototype: cell("typedArrayPrototype"),
104
105
  uncurryThis: cell("uncurryThis"),
105
106
  objectHasOwnProperty: cell("objectHasOwnProperty"),
@@ -191,6 +192,7 @@
191
192
  },
192
193
  {
193
194
  q: cell("q"),
195
+ b: cell("b"),
194
196
  X: cell("X"),
195
197
  unredactedDetails: cell("unredactedDetails"),
196
198
  makeError: cell("makeError"),
@@ -361,6 +363,9 @@
361
363
  tameFauxDataProperty: cell("tameFauxDataProperty"),
362
364
  tameFauxDataProperties: cell("tameFauxDataProperties"),
363
365
  },
366
+ {
367
+ tameRegeneratorRuntime: cell("tameRegeneratorRuntime"),
368
+ },
364
369
  {
365
370
  repairIntrinsics: cell("repairIntrinsics"),
366
371
  },
@@ -489,6 +494,7 @@ function observeImports(map, importName, importIndex) {
489
494
  functionPrototype: cells[0].functionPrototype.set,
490
495
  promisePrototype: cells[0].promisePrototype.set,
491
496
  generatorPrototype: cells[0].generatorPrototype.set,
497
+ iteratorPrototype: cells[0].iteratorPrototype.set,
492
498
  typedArrayPrototype: cells[0].typedArrayPrototype.set,
493
499
  uncurryThis: cells[0].uncurryThis.set,
494
500
  objectHasOwnProperty: cells[0].objectHasOwnProperty.set,
@@ -662,6 +668,7 @@ function observeImports(map, importName, importIndex) {
662
668
  },
663
669
  onceVar: {
664
670
  quote: cells[9].q.set,
671
+ bare: cells[9].b.set,
665
672
  redactedDetails: cells[9].X.set,
666
673
  unredactedDetails: cells[9].unredactedDetails.set,
667
674
  makeError: cells[9].makeError.set,
@@ -1234,6 +1241,18 @@ function observeImports(map, importName, importIndex) {
1234
1241
  importMeta: {},
1235
1242
  });
1236
1243
  functors[49]({
1244
+ imports(entries) {
1245
+ const map = new Map(entries);
1246
+ observeImports(map, "./commons.js", 0);
1247
+ },
1248
+ liveVar: {
1249
+ },
1250
+ onceVar: {
1251
+ tameRegeneratorRuntime: cells[49].tameRegeneratorRuntime.set,
1252
+ },
1253
+ importMeta: {},
1254
+ });
1255
+ functors[50]({
1237
1256
  imports(entries) {
1238
1257
  const map = new Map(entries);
1239
1258
  observeImports(map, "@endo/env-options", 3);
@@ -1260,20 +1279,21 @@ function observeImports(map, importName, importIndex) {
1260
1279
  observeImports(map, "./tame-harden.js", 46);
1261
1280
  observeImports(map, "./tame-symbol-constructor.js", 47);
1262
1281
  observeImports(map, "./tame-faux-data-properties.js", 48);
1282
+ observeImports(map, "./tame-regenerator-runtime.js", 49);
1263
1283
  },
1264
1284
  liveVar: {
1265
1285
  },
1266
1286
  onceVar: {
1267
- repairIntrinsics: cells[49].repairIntrinsics.set,
1287
+ repairIntrinsics: cells[50].repairIntrinsics.set,
1268
1288
  },
1269
1289
  importMeta: {},
1270
1290
  });
1271
- functors[50]({
1291
+ functors[51]({
1272
1292
  imports(entries) {
1273
1293
  const map = new Map(entries);
1274
1294
  observeImports(map, "./assert-sloppy-mode.js", 1);
1275
1295
  observeImports(map, "./commons.js", 0);
1276
- observeImports(map, "./lockdown.js", 49);
1296
+ observeImports(map, "./lockdown.js", 50);
1277
1297
  },
1278
1298
  liveVar: {
1279
1299
  },
@@ -1281,7 +1301,7 @@ function observeImports(map, importName, importIndex) {
1281
1301
  },
1282
1302
  importMeta: {},
1283
1303
  });
1284
- functors[51]({
1304
+ functors[52]({
1285
1305
  imports(entries) {
1286
1306
  const map = new Map(entries);
1287
1307
  observeImports(map, "./commons.js", 0);
@@ -1295,7 +1315,7 @@ function observeImports(map, importName, importIndex) {
1295
1315
  },
1296
1316
  importMeta: {},
1297
1317
  });
1298
- functors[52]({
1318
+ functors[53]({
1299
1319
  imports(entries) {
1300
1320
  const map = new Map(entries);
1301
1321
  observeImports(map, "./commons.js", 0);
@@ -1307,7 +1327,7 @@ function observeImports(map, importName, importIndex) {
1307
1327
  },
1308
1328
  importMeta: {},
1309
1329
  });
1310
- functors[53]({
1330
+ functors[54]({
1311
1331
  imports(entries) {
1312
1332
  const map = new Map(entries);
1313
1333
  observeImports(map, "./commons.js", 0);
@@ -1320,13 +1340,13 @@ function observeImports(map, importName, importIndex) {
1320
1340
  },
1321
1341
  importMeta: {},
1322
1342
  });
1323
- functors[54]({
1343
+ functors[55]({
1324
1344
  imports(entries) {
1325
1345
  const map = new Map(entries);
1326
- observeImports(map, "./src/lockdown-shim.js", 50);
1327
- observeImports(map, "./src/compartment-shim.js", 51);
1328
- observeImports(map, "./src/assert-shim.js", 52);
1329
- observeImports(map, "./src/console-shim.js", 53);
1346
+ observeImports(map, "./src/lockdown-shim.js", 51);
1347
+ observeImports(map, "./src/compartment-shim.js", 52);
1348
+ observeImports(map, "./src/assert-shim.js", 53);
1349
+ observeImports(map, "./src/console-shim.js", 54);
1330
1350
  },
1331
1351
  liveVar: {
1332
1352
  },
@@ -1476,6 +1496,10 @@ const { prototype: generatorPrototype}= getPrototypeOf(
1476
1496
  // eslint-disable-next-line no-empty-function, func-names
1477
1497
  function*() { });$h‍_once.generatorPrototype(generatorPrototype);
1478
1498
 
1499
+ const iteratorPrototype= getPrototypeOf(
1500
+ // eslint-disable-next-line @endo/no-polymorphic-call
1501
+ getPrototypeOf(arrayPrototype.values()));$h‍_once.iteratorPrototype(iteratorPrototype);
1502
+
1479
1503
 
1480
1504
  const typedArrayPrototype= getPrototypeOf(Uint8Array.prototype);$h‍_once.typedArrayPrototype(typedArrayPrototype);
1481
1505
 
@@ -1547,9 +1571,11 @@ const stringReplace= /** @type {any} */
1547
1571
  uncurryThis(stringPrototype.replace);$h‍_once.stringReplace(stringReplace);
1548
1572
 
1549
1573
  const stringSearch= uncurryThis(stringPrototype.search);$h‍_once.stringSearch(stringSearch);
1550
- const stringSlice= uncurryThis(stringPrototype.slice);
1551
- /** @type {(thisArg: string, splitter: string | RegExp | { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number) => string[]} */$h‍_once.stringSlice(stringSlice);
1552
- const stringSplit= uncurryThis(stringPrototype.split);$h‍_once.stringSplit(stringSplit);
1574
+ const stringSlice= uncurryThis(stringPrototype.slice);$h‍_once.stringSlice(stringSlice);
1575
+ const stringSplit=
1576
+ /** @type {(thisArg: string, splitter: string | RegExp | { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number) => string[]} */
1577
+ uncurryThis(stringPrototype.split);$h‍_once.stringSplit(stringSplit);
1578
+
1553
1579
  const stringStartsWith= uncurryThis(stringPrototype.startsWith);$h‍_once.stringStartsWith(stringStartsWith);
1554
1580
  const iterateString= uncurryThis(stringPrototype[iteratorSymbol]);
1555
1581
  //
@@ -2600,7 +2626,7 @@ const bare= (payload, spaces= undefined)=> {
2600
2626
 
2601
2627
  weakmapSet(declassifiers, result, payload);
2602
2628
  return result;
2603
- };
2629
+ };$h‍_once.bare(bare);
2604
2630
  freeze(bare);
2605
2631
 
2606
2632
  // /////////////////////////////////////////////////////////////////////////////
@@ -8564,8 +8590,8 @@ const tameConsole= (
8564
8590
  }
8565
8591
 
8566
8592
  globalProcess.on('uncaughtException', (error)=>{
8567
- // causalConsole is born frozen so not vulnerable to method tampering.
8568
- ourConsole.error(error);
8593
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_UNCAUGHT_EXCEPTION.md
8594
+ ourConsole.error('SES_UNCAUGHT_EXCEPTION:', error);
8569
8595
  if( terminate) {
8570
8596
  terminate();
8571
8597
  }
@@ -8577,8 +8603,9 @@ const tameConsole= (
8577
8603
  typeof globalProcess.on=== 'function')
8578
8604
  {
8579
8605
  const handleRejection= (reason)=>{
8580
- // 'platform' and 'report' just log the reason.
8606
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_UNHANDLED_REJECTION.md
8581
8607
  ourConsole.error('SES_UNHANDLED_REJECTION:', reason);
8608
+ // 'platform' and 'report' just log the reason.
8582
8609
  };
8583
8610
  // Maybe track unhandled promise rejections.
8584
8611
  const h= makeRejectionHandlers(handleRejection);
@@ -8599,8 +8626,9 @@ const tameConsole= (
8599
8626
  {
8600
8627
  globalWindow.addEventListener('error', (event)=>{
8601
8628
  event.preventDefault();
8629
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_UNCAUGHT_EXCEPTION.md
8630
+ ourConsole.error('SES_UNCAUGHT_EXCEPTION:', event.error);
8602
8631
  // 'platform' and 'report' just log the reason.
8603
- ourConsole.error(event.error);
8604
8632
  if( errorTrapping=== 'exit'|| errorTrapping=== 'abort') {
8605
8633
  globalWindow.location.href= `about:blank`;
8606
8634
  }
@@ -8612,6 +8640,7 @@ const tameConsole= (
8612
8640
  typeof globalWindow.addEventListener=== 'function')
8613
8641
  {
8614
8642
  const handleRejection= (reason)=>{
8643
+ // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_UNHANDLED_REJECTION.md
8615
8644
  ourConsole.error('SES_UNHANDLED_REJECTION:', reason);
8616
8645
  };
8617
8646
 
@@ -9284,7 +9313,7 @@ function tameErrorConstructor(
9284
9313
  })()
9285
9314
  ,
9286
9315
  // === functors[39] ===
9287
- ({ 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,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)]],["X", [$h‍_a => (X = $h‍_a)]]]]]);
9316
+ ({ 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)]]]]]);
9288
9317
 
9289
9318
 
9290
9319
 
@@ -9440,7 +9469,7 @@ function* loadWithoutErrorAnnotation(
9440
9469
  'importNowHook');
9441
9470
 
9442
9471
  throw makeError(
9443
- X `${moduleHookName} needed to load module ${q(
9472
+ X `${b(moduleHookName)} needed to load module ${q(
9444
9473
  moduleSpecifier)
9445
9474
  } in compartment ${q(compartment.name)}`);
9446
9475
 
@@ -11357,7 +11386,11 @@ const getAnonymousIntrinsics= ()=> {
11357
11386
 
11358
11387
  intrinsics['%WrapForValidIteratorPrototype%']= getPrototypeOf(
11359
11388
  // eslint-disable-next-line @endo/no-polymorphic-call
11360
- globalThis.Iterator.from({ next() { }}));
11389
+ globalThis.Iterator.from({
11390
+ next() {
11391
+ return { value: undefined};
11392
+ }}));
11393
+
11361
11394
 
11362
11395
  }
11363
11396
 
@@ -11380,6 +11413,9 @@ const getAnonymousIntrinsics= ()=> {
11380
11413
  ({ 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)]]]]]);
11381
11414
 
11382
11415
 
11416
+ /** @import {Harden} from '../types.js'; */
11417
+
11418
+ /** @type {(safeHarden: Harden, hardenTaming: 'safe' | 'unsafe') => Harden} */
11383
11419
  const tameHarden= (safeHarden, hardenTaming)=> {
11384
11420
  if( hardenTaming!== 'safe'&& hardenTaming!== 'unsafe') {
11385
11421
  throw TypeError( `unrecognized fakeHardenOption ${hardenTaming}`);
@@ -11395,6 +11431,7 @@ const tameHarden= (safeHarden, hardenTaming)=> {
11395
11431
  Object.isSealed= ()=> true;
11396
11432
  Reflect.isExtensible= ()=> false;
11397
11433
 
11434
+ // @ts-expect-error secret property
11398
11435
  if( safeHarden.isFake) {
11399
11436
  // The "safe" hardener is already a fake hardener.
11400
11437
  // Just use it.
@@ -11689,7 +11726,40 @@ const tameFauxDataProperties= (intrinsics)=>{
11689
11726
  })()
11690
11727
  ,
11691
11728
  // === functors[49] ===
11692
- ({ 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,tameConsole,tameErrorConstructor,assert,makeAssert,getAnonymousIntrinsics,makeCompartmentConstructor,tameHarden,tameSymbolConstructor,tameFauxDataProperties;$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)]]]],["./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)]]]]]);
11729
+ ({ 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)]]]]]);
11730
+
11731
+
11732
+
11733
+
11734
+
11735
+
11736
+ const tameRegeneratorRuntime= ()=> {
11737
+ const iter= iteratorPrototype[iteratorSymbol];
11738
+ defineProperty(iteratorPrototype, iteratorSymbol, {
11739
+ configurable: true,
11740
+ get() {
11741
+ return iter;
11742
+ },
11743
+ set(value) {
11744
+ // ignore the assignment on IteratorPrototype
11745
+ if( this=== iteratorPrototype) return;
11746
+ if( objectHasOwnProperty(this, iteratorSymbol)) {
11747
+ this[iteratorSymbol]= value;
11748
+ }
11749
+ defineProperty(this, iteratorSymbol, {
11750
+ value,
11751
+ writable: true,
11752
+ enumerable: true,
11753
+ configurable: true});
11754
+
11755
+ }});
11756
+
11757
+ };$h‍_once.tameRegeneratorRuntime(tameRegeneratorRuntime);
11758
+ })()
11759
+ ,
11760
+ // === functors[50] ===
11761
+ ({ 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,tameConsole,tameErrorConstructor,assert,makeAssert,getAnonymousIntrinsics,makeCompartmentConstructor,tameHarden,tameSymbolConstructor,tameFauxDataProperties,tameRegeneratorRuntime;$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)]]]],["./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)]]]]]);
11762
+
11693
11763
 
11694
11764
 
11695
11765
 
@@ -11871,12 +11941,20 @@ const repairIntrinsics= (options= {})=> {
11871
11941
  /** @param {string} debugName */
11872
11942
  (debugName)=>debugName!== ''),
11873
11943
 
11944
+ legacyRegeneratorRuntimeTaming= getenv(
11945
+ 'LOCKDOWN_LEGACY_REGENERATOR_RUNTIME_TAMING',
11946
+ 'safe'),
11947
+
11874
11948
  __hardenTaming__= getenv('LOCKDOWN_HARDEN_TAMING', 'safe'),
11875
11949
  dateTaming= 'safe', // deprecated
11876
11950
  mathTaming= 'safe', // deprecated
11877
11951
  ...extraOptions}=
11878
11952
  options;
11879
11953
 
11954
+ legacyRegeneratorRuntimeTaming=== 'safe'||
11955
+ legacyRegeneratorRuntimeTaming=== 'unsafe-ignore'||
11956
+ Fail `lockdown(): non supported option legacyRegeneratorRuntimeTaming: ${q(legacyRegeneratorRuntimeTaming)}`;
11957
+
11880
11958
  evalTaming=== 'unsafeEval'||
11881
11959
  evalTaming=== 'safeEval'||
11882
11960
  evalTaming=== 'noEval'||
@@ -11955,6 +12033,7 @@ const repairIntrinsics= (options= {})=> {
11955
12033
  const { addIntrinsics, completePrototypes, finalIntrinsics}=
11956
12034
  makeIntrinsicsCollector();
11957
12035
 
12036
+ // @ts-expect-error __hardenTaming__ could be any string
11958
12037
  const tamedHarden= tameHarden(safeHarden, __hardenTaming__);
11959
12038
  addIntrinsics({ harden: tamedHarden});
11960
12039
 
@@ -12103,6 +12182,9 @@ const repairIntrinsics= (options= {})=> {
12103
12182
  // clear yet which is better.
12104
12183
  // @ts-ignore enablePropertyOverrides does its own input validation
12105
12184
  enablePropertyOverrides(intrinsics, overrideTaming, overrideDebug);
12185
+ if( legacyRegeneratorRuntimeTaming=== 'unsafe-ignore') {
12186
+ tameRegeneratorRuntime();
12187
+ }
12106
12188
 
12107
12189
  // Finally register and optionally freeze all the intrinsics. This
12108
12190
  // must be the operation that modifies the intrinsics.
@@ -12135,7 +12217,7 @@ const repairIntrinsics= (options= {})=> {
12135
12217
  };$h‍_once.repairIntrinsics(repairIntrinsics);
12136
12218
  })()
12137
12219
  ,
12138
- // === functors[50] ===
12220
+ // === functors[51] ===
12139
12221
  ({ 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)]]]]]);
12140
12222
 
12141
12223
 
@@ -12148,7 +12230,7 @@ const repairIntrinsics= (options= {})=> {
12148
12230
  /** @import {LockdownOptions} from '../types.js' */
12149
12231
 
12150
12232
  /**
12151
- * @param {LockdownOptions} options
12233
+ * @param {LockdownOptions} [options]
12152
12234
  */
12153
12235
  globalThis.lockdown= (options)=>{
12154
12236
  const hardenIntrinsics= repairIntrinsics(options);
@@ -12156,7 +12238,7 @@ globalThis.lockdown= (options)=>{
12156
12238
  };
12157
12239
 
12158
12240
  /**
12159
- * @param {LockdownOptions} options
12241
+ * @param {LockdownOptions} [options]
12160
12242
  */
12161
12243
  globalThis.repairIntrinsics= (options)=>{
12162
12244
  const hardenIntrinsics= repairIntrinsics(options);
@@ -12175,7 +12257,7 @@ globalThis.repairIntrinsics= (options)=>{
12175
12257
  };
12176
12258
  })()
12177
12259
  ,
12178
- // === functors[51] ===
12260
+ // === functors[52] ===
12179
12261
  ({ 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)]]]]]);
12180
12262
 
12181
12263
 
@@ -12192,14 +12274,14 @@ globalThis.Compartment= makeCompartmentConstructor(
12192
12274
  markVirtualizedNativeFunction);
12193
12275
  })()
12194
12276
  ,
12195
- // === functors[52] ===
12277
+ // === functors[53] ===
12196
12278
  ({ 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)]]]]]);
12197
12279
 
12198
12280
 
12199
12281
  globalThis.assert= assert;
12200
12282
  })()
12201
12283
  ,
12202
- // === functors[53] ===
12284
+ // === functors[54] ===
12203
12285
  ({ 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)]]]]]);
12204
12286
 
12205
12287
 
@@ -12252,7 +12334,7 @@ globalThis[MAKE_CAUSAL_CONSOLE_FROM_LOGGER_KEY_FOR_SES_AVA]=
12252
12334
  makeCausalConsoleFromLoggerForSesAva;
12253
12335
  })()
12254
12336
  ,
12255
- // === functors[54] ===
12337
+ // === functors[55] ===
12256
12338
  ({ 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", []]]);
12257
12339
  })()
12258
12340
  ,