ses 1.13.1 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +70 -52
  2. package/dist/lockdown.cjs +1346 -948
  3. package/dist/lockdown.mjs +1346 -948
  4. package/dist/lockdown.umd.js +1346 -948
  5. package/dist/lockdown.umd.min.js +1 -1
  6. package/dist/ses-hermes.cjs +1328 -804
  7. package/dist/ses.cjs +1346 -948
  8. package/dist/ses.mjs +1346 -948
  9. package/dist/ses.umd.js +1346 -948
  10. package/dist/ses.umd.min.js +1 -1
  11. package/dist/types.d.cts +115 -141
  12. package/package.json +19 -102
  13. package/src/assert-shim.js +2 -2
  14. package/src/cauterize-property.js +2 -2
  15. package/src/commons.js +111 -50
  16. package/src/compartment.js +25 -8
  17. package/src/enable-property-overrides.js +4 -4
  18. package/src/enablements.js +7 -8
  19. package/src/error/assert.js +126 -101
  20. package/src/error/note-log-args.js +5 -4
  21. package/src/error/stringify-utils.js +2 -2
  22. package/src/error/tame-v8-error-constructor.js +15 -12
  23. package/src/error/types.js +1 -1
  24. package/src/get-anonymous-intrinsics.js +0 -1
  25. package/src/global-object.js +3 -3
  26. package/src/intrinsics.js +8 -8
  27. package/src/lockdown.js +34 -12
  28. package/src/make-hardener.js +4 -4
  29. package/src/module-instance.js +22 -18
  30. package/src/module-link.js +4 -4
  31. package/src/module-load.js +48 -13
  32. package/src/permits-intrinsics.js +8 -8
  33. package/src/permits.js +5 -0
  34. package/src/reporting.js +48 -12
  35. package/src/scope-constants.js +19 -25
  36. package/src/tame-locale-methods.js +2 -2
  37. package/src/tame-regenerator-runtime.js +2 -2
  38. package/src/transforms.js +9 -7
  39. package/types.d.ts +115 -141
  40. package/src/error/README.md +0 -99
  41. package/src/make-lru-cachemap.js +0 -221
package/dist/types.d.cts CHANGED
@@ -3,6 +3,8 @@
3
3
  * @module
4
4
  */
5
5
 
6
+ import '@endo/immutable-arraybuffer/shim.js';
7
+
6
8
  /* eslint-disable no-restricted-globals, vars-on-top, no-var */
7
9
 
8
10
  // It's academically tempting to define a hardened type, but TypeScript doesn't
@@ -172,6 +174,11 @@ export interface CompartmentOptions {
172
174
  /** @deprecated */
173
175
  loadNowHook?: (specifier: string) => ModuleDescriptor;
174
176
  __native__?: boolean;
177
+
178
+ /**
179
+ * If `true`, the first error encountered during module loading will be thrown immediately
180
+ */
181
+ noAggregateLoadErrors?: boolean;
175
182
  }
176
183
 
177
184
  export interface EvaluateOptions {
@@ -182,20 +189,30 @@ export interface EvaluateOptions {
182
189
  __rejectSomeDirectEvalExpressions__?: boolean;
183
190
  }
184
191
 
192
+ interface Stringable {
193
+ toString(): string;
194
+ }
195
+
196
+ /** @deprecated */
197
+ type StringPayload = Stringable;
198
+
185
199
  /**
186
- * A call to the `details` template literal makes and returns a fresh details
187
- * token, which is a frozen empty object associated with the arguments of that
188
- * `details` template literal expression.
200
+ * A call to the {@link details} template literal makes and returns a fresh
201
+ * DetailsToken, which is a frozen empty object associated with the arguments of
202
+ * that expression.
189
203
  */
190
204
  export type DetailsToken = Record<any, never>;
191
- /** Either a plain string, or made by the `details` template literal tag. */
205
+ /**
206
+ * A plain string, or a {@link DetailsToken} from the {@link details} template
207
+ * literal tag.
208
+ */
192
209
  export type Details = string | DetailsToken;
193
210
 
194
211
  export interface AssertMakeErrorOptions {
195
212
  /**
196
213
  * Does not affect the error.name property. That remains determined by
197
214
  * the constructor. Rather, the `errorName` determines how this error is
198
- * identified in the causal console log's output.
215
+ * identified in an associated console's output.
199
216
  */
200
217
  errorName?: string;
201
218
 
@@ -275,10 +292,6 @@ export type AssertTypeof = AssertTypeofBigint &
275
292
  AssertTypeofSymbol &
276
293
  AssertTypeofUndefined;
277
294
 
278
- interface StringablePayload {
279
- toString(): string;
280
- }
281
-
282
295
  /**
283
296
  * TypeScript does not treat `AggregateErrorConstructor` as a subtype of
284
297
  * `ErrorConstructor`, which makes sense because their constructors
@@ -302,48 +315,44 @@ export type GenericErrorConstructor =
302
315
  export type Raise = (reason: Error) => void;
303
316
 
304
317
  /**
305
- * Makes and returns an `assert` function object that shares the bookkeeping
306
- * state defined by this module with other `assert` function objects made by
307
- * `makeAssert`. This state is per-module-instance and is exposed by the
308
- * `loggedErrorHandler` above. We refer to `assert` as a "function object"
309
- * because it can be called directly as a function, but also has methods that
310
- * can be called.
318
+ * Makes and returns an `assert` function object that shares the
319
+ * per-module-instance bookkeeping state defined by this module with other
320
+ * `assert` function objects made by `makeAssert`. We refer to `assert` as a
321
+ * "function object" because it can be called directly as a function, but also
322
+ * has callable methods of its own.
311
323
  *
312
- * If `optRaise` is provided, the returned `assert` function object will call
313
- * `optRaise(reason)` before throwing the error. This enables `optRaise` to
314
- * engage in even more violent termination behavior, like terminating the vat,
315
- * that prevents execution from reaching the following throw. However, if
316
- * `optRaise` returns normally, which would be unusual, the throw following
317
- * `optRaise(reason)` would still happen.
324
+ * If `raise` is provided, the returned `assert` function object will call
325
+ * `raise(reason)` before throwing an assertion-failure error. This enables
326
+ * `raise` to engage in even more violent termination behavior, like process
327
+ * termination, that prevents execution from reaching the following throw.
328
+ * However, if `raise(reason)` returns normally, which would be unusual, that
329
+ * throw still happens.
318
330
  */
319
- // Behold: recursion.
320
331
  // eslint-disable-next-line no-use-before-define
321
332
  export type MakeAssert = (raise?: Raise, unredacted?: boolean) => Assert;
322
333
 
323
334
  export type BaseAssert = (
324
- /** The truthy/falsy value we're testing */
325
- flag: any,
326
- /** The details of what was asserted */
335
+ /** The condition whose truthiness is being asserted */
336
+ condition: any,
337
+ /** The details associated with assertion failure (falsy condition) */
327
338
  details?: Details,
328
339
  /** An optional alternate error constructor to use */
329
340
  errConstructor?: GenericErrorConstructor,
330
341
  options?: AssertMakeErrorOptions,
331
- ) => asserts flag;
342
+ ) => asserts condition;
332
343
 
333
344
  export interface AssertionFunctions extends BaseAssert {
334
345
  typeof: AssertTypeof;
335
346
 
336
347
  /**
337
- * The `assert.equal` method
338
- *
339
- * Assert that two values must be `Object.is`.
348
+ * Assert that two values are the same as observed by `Object.is`.
340
349
  */
341
350
  equal<T>(
342
351
  /** What we received */
343
352
  actual: unknown,
344
353
  /** What we wanted */
345
354
  expected: T,
346
- /** The details of what was asserted */
355
+ /** The details associated with assertion failure (`Object.is` returning false) */
347
356
  details?: Details,
348
357
  /** An optional alternate error constructor to use */
349
358
  errConstructor?: GenericErrorConstructor,
@@ -351,12 +360,9 @@ export interface AssertionFunctions extends BaseAssert {
351
360
  ): asserts actual is T;
352
361
 
353
362
  /**
354
- * The `assert.string` method.
355
- *
363
+ * Assert that a value is a primitive string.
356
364
  * `assert.string(v)` is equivalent to `assert.typeof(v, 'string')`. We
357
365
  * special case this one because it is the most frequently used.
358
- *
359
- * Assert an expected typeof result.
360
366
  */
361
367
  string(
362
368
  specimen: any,
@@ -365,14 +371,9 @@ export interface AssertionFunctions extends BaseAssert {
365
371
  ): asserts specimen is string;
366
372
 
367
373
  /**
368
- * The `assert.fail` method.
369
- *
370
- * Fail an assertion, recording full details to the console and
371
- * raising an exception with a message in which `details` substitution values
372
- * have been redacted.
373
- *
374
- * The optional `optDetails` can be a string for backwards compatibility
375
- * with the nodejs assertion library.
374
+ * Fail an assertion, raising an exception with a `message` in which unquoted
375
+ * `details` substitution values may have been redacted into `typeof` types
376
+ * but are still available for logging to an associated console.
376
377
  */
377
378
  fail(
378
379
  /** The details of what was asserted */
@@ -385,11 +386,11 @@ export interface AssertionFunctions extends BaseAssert {
385
386
 
386
387
  export interface AssertionUtilities {
387
388
  /**
388
- * Aka the `makeError` function as imported from `@endo/errors`
389
- *
390
- * Recording unredacted details for the console.
389
+ * Create an error with a `message` in which unquoted {@link details}
390
+ * substitution values may have been redacted into lossy `typeof` output but
391
+ * are still available for logging to an associated console.
391
392
  */
392
- error(
393
+ makeError(
393
394
  /** The details of what was asserted */
394
395
  details?: Details,
395
396
  /** An optional alternate error constructor to use */
@@ -398,43 +399,27 @@ export interface AssertionUtilities {
398
399
  ): Error;
399
400
 
400
401
  /**
401
- * Aka the `annotateError` function as imported from `@endo/errors`
402
- *
403
- * Annotate an error with details, potentially to be used by an
404
- * augmented console such as the causal console of `console.js`, to
405
- * provide extra information associated with logged errors.
402
+ * Associate `details` with `error`, potentially to be logged by an associated
403
+ * console for providing extra information about the error.
406
404
  */
407
405
  note(error: Error, details: Details): void;
408
406
 
409
407
  /**
410
- * Use the `details` function as a template literal tag to create
411
- * informative error messages. The assertion functions take such messages
412
- * as optional arguments:
413
- * ```js
414
- * assert(sky.isBlue(), details`${sky.color} should be "blue"`);
415
- * ```
416
- * or following the normal convention to locally rename `details` to `X`
417
- * and `quote` to `q` like `const { details: X, quote: q } = assert;`:
418
- * ```js
419
- * assert(sky.isBlue(), X`${sky.color} should be "blue"`);
420
- * ```
408
+ * Use as a template literal tag to create an opaque {@link DetailsToken} for
409
+ * use with other assertion functions that might redact unquoted substitution
410
+ * values (i.e., those that are not output from the {@link quote} function)
411
+ * into lossy `typeof` output but still preserve them for logging to an
412
+ * associated console.
413
+ *
414
+ * The normal convention is to locally rename `details` to `X` like
415
+ * `const { details: X, quote: q, Fail } = assert;`.
421
416
  * However, note that in most cases it is preferable to instead use the `Fail`
422
- * template literal tag (which has the same input signature as `details`
423
- * but automatically creates and throws an error):
417
+ * template literal tag (which has the same input signature but automatically
418
+ * creates and throws an error):
424
419
  * ```js
425
420
  * sky.isBlue() || Fail`${sky.color} should be "blue"`;
426
421
  * ```
427
422
  *
428
- * The details template tag returns a `DetailsToken` object that can print
429
- * itself with the formatted message in two ways.
430
- * It will report full details to the console, but
431
- * mask embedded substitution values with their typeof information in the thrown error
432
- * to prevent revealing secrets up the exceptional path. In the example
433
- * above, the thrown error may reveal only that `sky.color` is a string,
434
- * whereas the same diagnostic printed to the console reveals that the
435
- * sky was green. This masking can be disabled for an individual substitution value
436
- * using `quote`.
437
- *
438
423
  * The `raw` property of an input template array is ignored, so a simple
439
424
  * array of strings may be provided directly.
440
425
  */
@@ -444,70 +429,69 @@ export interface AssertionUtilities {
444
429
  ): DetailsToken;
445
430
 
446
431
  /**
447
- * Use the `Fail` function as a template literal tag to efficiently
448
- * create and throw a `details`-style error only when a condition is not satisfied.
449
- * ```js
450
- * condition || Fail`...complaint...`;
451
- * ```
452
- * This avoids the overhead of creating usually-unnecessary errors like
453
- * ```js
454
- * assert(condition, details`...complaint...`);
455
- * ```
456
- * while improving readability over alternatives like
457
- * ```js
458
- * condition || assert.fail(details`...complaint...`);
459
- * ```
432
+ * Use as a template literal tag to create and throw an error in whose
433
+ * `message` unquoted substitution values (i.e., those that are not output
434
+ * from the {@link quote} function) may have been redacted into lossy `typeof`
435
+ * output but are still available for logging to an associated console.
460
436
  *
461
- * However, due to current weakness in TypeScript, static reasoning
462
- * is less powerful with the `||` patterns than with an `assert` call.
463
- * Until/unless https://github.com/microsoft/TypeScript/issues/51426 is fixed,
464
- * for `||`-style assertions where this loss of static reasoning is a problem,
465
- * instead express the assertion as
437
+ * For example, using the normal convention to locally rename properties like
438
+ * `const { quote: q, Fail } = assert;`:
466
439
  * ```js
467
- * if (!condition) {
468
- * Fail`...complaint...`;
469
- * }
440
+ * sky.isBlue() || Fail`${sky.color} should be "blue"`;
470
441
  * ```
471
- * or, if needed,
442
+ *
443
+ * This `||` pattern saves the cost of creating {@link DetailsToken} and/or
444
+ * error instances when the asserted condition holds, but can weaken
445
+ * TypeScript static reasoning due to
446
+ * https://github.com/microsoft/TypeScript/issues/51426 . Where this is a
447
+ * problem, instead express the assertion as
472
448
  * ```js
473
- * if (!condition) {
474
- * // `throw` is noop since `Fail` throws, but it improves static analysis
475
- * throw Fail`...complaint...`;
476
- * }
449
+ * if (!sky.isBlue()) {
450
+ * // This `throw` does not affect runtime behavior since `Fail` throws, but
451
+ * // might be needed to improve static analysis.
452
+ * throw Fail`${sky.color} should be "blue"`;
453
+ * }
477
454
  * ```
455
+ *
456
+ * The `raw` property of an input template array is ignored, so a simple
457
+ * array of strings may be provided directly.
478
458
  */
479
459
  Fail(template: TemplateStringsArray | string[], ...args: any): never;
480
460
 
481
461
  /**
482
- * To "declassify" and quote a substitution value used in a
483
- * ``` details`...` ``` template literal, enclose that substitution expression
484
- * in a call to `quote`. This makes the value appear quoted
485
- * (as if with `JSON.stringify`) in the message of the thrown error. The
486
- * payload itself is still passed unquoted to the console as it would be
487
- * without `quote`.
462
+ * Wrap a value such that its use as a substitution value in a template
463
+ * literal tagged with {@link details} or {@link Fail} will result in it
464
+ * appearing quoted (in a way similar to but more general than
465
+ * `JSON.stringify`) rather than redacted in the `message` of errors based on
466
+ * the resulting {@link DetailsToken}.
488
467
  *
489
- * For example, the following will reveal the expected sky color, but not the
490
- * actual incorrect sky color, in the thrown error's message:
491
- * ```js
492
- * sky.color === expectedColor || Fail`${sky.color} should be ${quote(expectedColor)}`;
493
- * ```
468
+ * This does not affect representation in output of an associated console,
469
+ * which still logs the value as it would without `quote`, but *does* reveal
470
+ * it to functions in the propagation path of such errors.
494
471
  *
495
- * The normal convention is to locally rename `details` to `X` and `quote` to `q`
496
- * like `const { details: X, quote: q } = assert;`, so the above example would then be
472
+ * For example, the following will reveal the expected value in the thrown
473
+ * error's `message`, but only the _type_ of the actual incorrect value (using
474
+ * the normal convention to locally rename properties like
475
+ * `const { quote: q, Fail } = assert;`):
497
476
  * ```js
498
- * sky.color === expectedColor || Fail`${sky.color} should be ${q(expectedColor)}`;
477
+ * actual === expected || Fail`${actual} should be ${q(expected)}`;
499
478
  * ```
479
+ *
480
+ * The optional `space` parameter matches that of `JSON.stringify`, and is
481
+ * used to request insertion of non-semantic line feeds, indentation, and
482
+ * separating spaces in the output for improving readability of objects and
483
+ * arrays.
500
484
  */
501
- quote(
502
- /** What to declassify */
503
- payload: any,
504
- spaces?: string | number,
505
- ): /** The declassified and quoted payload */ StringablePayload;
485
+ quote(value: any, space?: string | number): Stringable;
506
486
 
507
487
  /**
508
- * Embed a string directly into error details without wrapping punctuation.
488
+ * Wrap a string such that its use as a substitution value in a template
489
+ * literal tagged with {@link details} or {@link Fail} will be treated
490
+ * literally rather than being quoted or redacted.
491
+ *
509
492
  * To avoid injection attacks that exploit quoting confusion, this must NEVER
510
493
  * be used with data that is possibly attacker-controlled.
494
+ *
511
495
  * As a further safeguard, we fall back to quoting any input that is not a
512
496
  * string of sufficiently word-like parts separated by isolated spaces (rather
513
497
  * than throwing an exception, which could hide the original problem for which
@@ -517,35 +501,25 @@ export interface AssertionUtilities {
517
501
  * by inline replacement similar to that of `bestEffortStringify` for producing
518
502
  * rendered messages like `(an object) was tagged "[Unsafe bare string]"`).
519
503
  */
520
- bare(
521
- /** What to declassify */
522
- payload: any,
523
- spaces?: string | number,
524
- ): /** The declassified payload without quotes (beware confusion hazard) */
525
- StringablePayload;
504
+ bare(text: string, spaces?: string | number): Stringable;
526
505
  }
527
506
 
528
507
  export interface DeprecatedAssertionUtilities {
529
508
  makeAssert: MakeAssert;
509
+ error: AssertionUtilities['makeError'];
530
510
  }
531
511
 
532
512
  /**
533
- * assert that expr is truthy, with an optional details to describe
534
- * the assertion. It is a tagged template literal like
535
- * ```js
536
- * assert(expr, details`....`);`
537
- * ```
538
- *
539
- * The literal portions of the template are assumed non-sensitive, as
540
- * are the `typeof` types of the substitution values. These are
541
- * assembled into the thrown error message. The actual contents of the
542
- * substitution values are assumed sensitive, to be revealed to
543
- * the console only. We assume only the virtual platform's owner can read
544
- * what is written to the console, where the owner is in a privileged
545
- * position over computation running on that platform.
513
+ * Assert that `condition` is truthy, with optional details associated with
514
+ * assertion failure (falsy condition).
546
515
  *
547
- * The optional `optDetails` can be a string for backwards compatibility
548
- * with the nodejs assertion library.
516
+ * The literal portions of the template used to make a {@link DetailsToken} are
517
+ * assumed non-sensitive, as are the `typeof` output for substitution values.
518
+ * These are assembled into the error `message`. The actual contents of the
519
+ * substitution values are assumed sensitive and usually redacted, to be
520
+ * revealed only to an associated console. We assume only the virtual platform's
521
+ * owner can read what is written to the console, where the owner is in a
522
+ * privileged position over computation running on that platform.
549
523
  */
550
524
  export type Assert = AssertionFunctions &
551
525
  AssertionUtilities &
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ses",
3
- "version": "1.13.1",
3
+ "version": "1.15.0",
4
4
  "description": "Hardened JavaScript for Fearless Cooperation",
5
5
  "keywords": [
6
6
  "lockdown",
@@ -80,7 +80,7 @@
80
80
  "build:hermes": "node scripts/bundle.js hermes",
81
81
  "build": "yarn build:vanilla && yarn build:hermes",
82
82
  "clean": "rm -rf dist",
83
- "cover": "c8 ava",
83
+ "cover": "c8 ava --config test/_ava-ses.config.js",
84
84
  "demo": "python3 -m http.server",
85
85
  "lint": "yarn lint:types && yarn lint:eslint",
86
86
  "lint-fix": "eslint --fix .",
@@ -94,32 +94,26 @@
94
94
  "postpack": "git clean -fX \"*.d.ts*\" \"*.d.cts*\" \"*.d.mts*\" \"*.tsbuildinfo\""
95
95
  },
96
96
  "dependencies": {
97
- "@endo/env-options": "^1.1.10",
98
- "@endo/immutable-arraybuffer": "^1.1.1"
97
+ "@endo/cache-map": "^1.1.0",
98
+ "@endo/env-options": "^1.1.11",
99
+ "@endo/immutable-arraybuffer": "^1.1.2"
99
100
  },
100
101
  "devDependencies": {
101
- "@babel/generator": "^7.26.3",
102
- "@babel/parser": "~7.26.2",
103
- "@babel/traverse": "~7.25.9",
104
- "@babel/types": "~7.26.0",
105
- "@endo/compartment-mapper": "^1.6.2",
106
- "@endo/module-source": "^1.3.2",
107
- "@endo/test262-runner": "^0.1.47",
108
- "@types/babel__traverse": "^7.20.5",
109
- "ava": "^6.1.3",
110
- "babel-eslint": "^10.1.0",
111
- "c8": "^7.14.0",
102
+ "@babel/generator": "^7.28.3",
103
+ "@babel/parser": "~7.28.3",
104
+ "@babel/traverse": "~7.28.3",
105
+ "@babel/types": "~7.28.2",
106
+ "@endo/compartment-mapper": "^2.0.0",
107
+ "@endo/module-source": "^1.4.0",
108
+ "@endo/test262-runner": "^0.1.49",
109
+ "ava": "catalog:dev",
110
+ "c8": "catalog:dev",
112
111
  "core-js": "^3.31.0",
113
- "eslint": "^8.57.1",
114
- "eslint-config-airbnb-base": "^15.0.0",
115
- "eslint-config-prettier": "^9.1.0",
116
- "eslint-plugin-eslint-comments": "^3.2.0",
117
- "eslint-plugin-import": "^2.31.0",
112
+ "eslint": "catalog:dev",
118
113
  "hermes-engine-cli": "^0.12.0",
119
- "prettier": "^3.5.3",
120
114
  "terser": "^5.16.6",
121
- "tsd": "^0.31.2",
122
- "typescript": "~5.8.3"
115
+ "tsd": "catalog:dev",
116
+ "typescript": "~5.9.2"
123
117
  },
124
118
  "files": [
125
119
  "./*.d.ts",
@@ -137,84 +131,7 @@
137
131
  },
138
132
  "eslintConfig": {
139
133
  "extends": [
140
- "plugin:@endo/internal"
141
- ],
142
- "rules": {
143
- "no-restricted-globals": [
144
- "error",
145
- "AggregateError",
146
- "Array",
147
- "ArrayBuffer",
148
- "Atomics",
149
- "BigInt",
150
- "BigInt64Array",
151
- "BigUint64Array",
152
- "Boolean",
153
- "Compartment",
154
- "DataView",
155
- "Date",
156
- "Error",
157
- "EvalError",
158
- "Float32Array",
159
- "Float64Array",
160
- "Function",
161
- "HandledPromise",
162
- "Int16Array",
163
- "Int32Array",
164
- "Int8Array",
165
- "JSON",
166
- "Map",
167
- "Math",
168
- "Number",
169
- "Object",
170
- "Promise",
171
- "Proxy",
172
- "RangeError",
173
- "ReferenceError",
174
- "Reflect",
175
- "RegExp",
176
- "Set",
177
- "SharedArrayBuffer",
178
- "String",
179
- "Symbol",
180
- "SyntaxError",
181
- "TypeError",
182
- "URIError",
183
- "Uint16Array",
184
- "Uint32Array",
185
- "Uint8Array",
186
- "Uint8ClampedArray",
187
- "WeakMap",
188
- "WeakSet",
189
- "assert",
190
- "decodeURI",
191
- "decodeURIComponent",
192
- "encodeURI",
193
- "encodeURIComponent",
194
- "escape",
195
- "eval",
196
- "globalThis",
197
- "isFinite",
198
- "isNaN",
199
- "lockdown",
200
- "parseFloat",
201
- "parseInt",
202
- "unescape"
203
- ],
204
- "@endo/no-polymorphic-call": "error"
205
- },
206
- "overrides": [
207
- {
208
- "files": [
209
- "test/**/*.js",
210
- "demos/**/*.js",
211
- "scripts/**/*.js"
212
- ],
213
- "rules": {
214
- "no-restricted-globals": "off",
215
- "@endo/no-polymorphic-call": "off"
216
- }
217
- }
134
+ "plugin:@endo/ses"
218
135
  ]
219
136
  },
220
137
  "ava": {
@@ -226,5 +143,5 @@
226
143
  "typeCoverage": {
227
144
  "atLeast": 81.17
228
145
  },
229
- "gitHead": "03b92fc383da5d8bb4ea993b90149a0db5799d0b"
146
+ "gitHead": "f91329e8616a19f131d009356a5f11ef11c839cc"
230
147
  }
@@ -1,4 +1,4 @@
1
1
  import { globalThis } from './commons.js';
2
- import { assert } from './error/assert.js';
2
+ import { makeAssert } from './error/assert.js';
3
3
 
4
- globalThis.assert = assert;
4
+ globalThis.assert = makeAssert(undefined, true);
@@ -1,4 +1,4 @@
1
- import { objectHasOwnProperty } from './commons.js';
1
+ import { hasOwn } from './commons.js';
2
2
 
3
3
  /**
4
4
  * @import {Reporter} from './reporting-types.js'
@@ -52,7 +52,7 @@ export const cauterizeProperty = (
52
52
  try {
53
53
  delete obj[prop];
54
54
  } catch (err) {
55
- if (objectHasOwnProperty(obj, prop)) {
55
+ if (hasOwn(obj, prop)) {
56
56
  if (typeof obj === 'function' && prop === 'prototype') {
57
57
  obj.prototype = undefined;
58
58
  if (obj.prototype === undefined) {