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.
- package/README.md +70 -52
- package/dist/lockdown.cjs +1346 -948
- package/dist/lockdown.mjs +1346 -948
- package/dist/lockdown.umd.js +1346 -948
- package/dist/lockdown.umd.min.js +1 -1
- package/dist/ses-hermes.cjs +1328 -804
- package/dist/ses.cjs +1346 -948
- package/dist/ses.mjs +1346 -948
- package/dist/ses.umd.js +1346 -948
- package/dist/ses.umd.min.js +1 -1
- package/dist/types.d.cts +115 -141
- package/package.json +19 -102
- package/src/assert-shim.js +2 -2
- package/src/cauterize-property.js +2 -2
- package/src/commons.js +111 -50
- package/src/compartment.js +25 -8
- package/src/enable-property-overrides.js +4 -4
- package/src/enablements.js +7 -8
- package/src/error/assert.js +126 -101
- package/src/error/note-log-args.js +5 -4
- package/src/error/stringify-utils.js +2 -2
- package/src/error/tame-v8-error-constructor.js +15 -12
- package/src/error/types.js +1 -1
- package/src/get-anonymous-intrinsics.js +0 -1
- package/src/global-object.js +3 -3
- package/src/intrinsics.js +8 -8
- package/src/lockdown.js +34 -12
- package/src/make-hardener.js +4 -4
- package/src/module-instance.js +22 -18
- package/src/module-link.js +4 -4
- package/src/module-load.js +48 -13
- package/src/permits-intrinsics.js +8 -8
- package/src/permits.js +5 -0
- package/src/reporting.js +48 -12
- package/src/scope-constants.js +19 -25
- package/src/tame-locale-methods.js +2 -2
- package/src/tame-regenerator-runtime.js +2 -2
- package/src/transforms.js +9 -7
- package/types.d.ts +115 -141
- package/src/error/README.md +0 -99
- 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
|
|
187
|
-
*
|
|
188
|
-
*
|
|
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
|
-
/**
|
|
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
|
|
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
|
|
306
|
-
* state defined by this module with other
|
|
307
|
-
* `
|
|
308
|
-
*
|
|
309
|
-
*
|
|
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 `
|
|
313
|
-
* `
|
|
314
|
-
* engage in even more violent termination behavior, like
|
|
315
|
-
* that prevents execution from reaching the following throw.
|
|
316
|
-
* `
|
|
317
|
-
*
|
|
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
|
|
325
|
-
|
|
326
|
-
/** The details
|
|
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
|
|
342
|
+
) => asserts condition;
|
|
332
343
|
|
|
333
344
|
export interface AssertionFunctions extends BaseAssert {
|
|
334
345
|
typeof: AssertTypeof;
|
|
335
346
|
|
|
336
347
|
/**
|
|
337
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
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
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
*
|
|
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
|
|
423
|
-
*
|
|
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
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
*
|
|
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
|
-
*
|
|
462
|
-
*
|
|
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
|
-
*
|
|
468
|
-
* Fail`...complaint...`;
|
|
469
|
-
* }
|
|
440
|
+
* sky.isBlue() || Fail`${sky.color} should be "blue"`;
|
|
470
441
|
* ```
|
|
471
|
-
*
|
|
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
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
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
|
-
*
|
|
483
|
-
*
|
|
484
|
-
* in a
|
|
485
|
-
*
|
|
486
|
-
*
|
|
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
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
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
|
-
*
|
|
496
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
534
|
-
*
|
|
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
|
|
548
|
-
*
|
|
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.
|
|
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/
|
|
98
|
-
"@endo/
|
|
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.
|
|
102
|
-
"@babel/parser": "~7.
|
|
103
|
-
"@babel/traverse": "~7.
|
|
104
|
-
"@babel/types": "~7.
|
|
105
|
-
"@endo/compartment-mapper": "^
|
|
106
|
-
"@endo/module-source": "^1.
|
|
107
|
-
"@endo/test262-runner": "^0.1.
|
|
108
|
-
"
|
|
109
|
-
"
|
|
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": "
|
|
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": "
|
|
122
|
-
"typescript": "~5.
|
|
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/
|
|
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": "
|
|
146
|
+
"gitHead": "f91329e8616a19f131d009356a5f11ef11c839cc"
|
|
230
147
|
}
|
package/src/assert-shim.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 (
|
|
55
|
+
if (hasOwn(obj, prop)) {
|
|
56
56
|
if (typeof obj === 'function' && prop === 'prototype') {
|
|
57
57
|
obj.prototype = undefined;
|
|
58
58
|
if (obj.prototype === undefined) {
|