ses 1.11.0 → 1.13.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/LICENSE +1 -1
- package/SECURITY.md +2 -2
- package/dist/lockdown.cjs +4457 -3911
- package/dist/lockdown.mjs +4457 -3911
- package/dist/lockdown.umd.js +4457 -3911
- package/dist/lockdown.umd.min.js +1 -1
- package/dist/ses-hermes.cjs +13482 -0
- package/dist/ses.cjs +4457 -3911
- package/dist/ses.mjs +4457 -3911
- package/dist/ses.umd.js +4457 -3911
- package/dist/ses.umd.min.js +1 -1
- package/dist/types.d.cts +22 -6
- package/package.json +27 -11
- package/src/commons.js +44 -2
- package/src/compartment.js +7 -3
- package/src/enablements.js +3 -1
- package/src/error/tame-console.js +0 -4
- package/src/error/tame-error-constructor.js +0 -11
- package/src/error/tame-v8-error-constructor.js +58 -15
- package/src/get-anonymous-intrinsics.js +34 -18
- package/src/lockdown.js +118 -59
- package/src/make-eval-function.js +5 -4
- package/src/make-function-constructor.js +5 -4
- package/src/module-load.js +47 -24
- package/src/permits.js +30 -1
- package/src/reporting.js +1 -4
- package/src/shim-arraybuffer-transfer.js +0 -1
- package/src/strict-scope-terminator.js +1 -2
- package/src/tame-domains.js +0 -4
- package/src/tame-function-constructors.js +9 -5
- package/src/tame-harden.js +1 -5
- package/src/tame-locale-methods.js +0 -3
- package/src/tame-regexp-constructor.js +0 -3
- package/types.d.ts +22 -6
package/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Types of the SES environment
|
|
3
|
+
* @module
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
/* eslint-disable no-restricted-globals, vars-on-top, no-var */
|
|
@@ -19,6 +20,10 @@
|
|
|
19
20
|
// version of harden.
|
|
20
21
|
export type Harden = <T>(value: T) => T; // not Hardened<T>;
|
|
21
22
|
|
|
23
|
+
// TODO Somehow remove the redundancy between these type deinitions and the
|
|
24
|
+
// inline casts on each call to `getenv` in `lockdown.js`. Hopefully we can
|
|
25
|
+
// keep the type info in those casts so it is easily comparable by eye to
|
|
26
|
+
// the parameters of that call to `genev`.
|
|
22
27
|
export interface RepairOptions {
|
|
23
28
|
regExpTaming?: 'safe' | 'unsafe';
|
|
24
29
|
localeTaming?: 'safe' | 'unsafe';
|
|
@@ -35,8 +40,15 @@ export interface RepairOptions {
|
|
|
35
40
|
* @deprecated Deprecated and does nothing. In the future specifying it will be an error.
|
|
36
41
|
*/
|
|
37
42
|
mathTaming?: 'safe' | 'unsafe';
|
|
38
|
-
evalTaming?:
|
|
39
|
-
|
|
43
|
+
evalTaming?:
|
|
44
|
+
| 'safe-eval'
|
|
45
|
+
| 'unsafe-eval'
|
|
46
|
+
| 'no-eval'
|
|
47
|
+
// deprecated
|
|
48
|
+
| 'safeEval'
|
|
49
|
+
| 'unsafeEval'
|
|
50
|
+
| 'noEval';
|
|
51
|
+
stackFiltering?: 'concise' | 'omit-frames' | 'shorten-paths' | 'verbose';
|
|
40
52
|
overrideTaming?: 'moderate' | 'min' | 'severe';
|
|
41
53
|
overrideDebug?: Array<string>;
|
|
42
54
|
domainTaming?: 'safe' | 'unsafe';
|
|
@@ -135,10 +147,12 @@ export type ModuleMapHook = (
|
|
|
135
147
|
moduleSpecifier: string,
|
|
136
148
|
) => ModuleDescriptor | undefined;
|
|
137
149
|
export type ImportHook = (moduleSpecifier: string) => Promise<ModuleDescriptor>;
|
|
138
|
-
export type ImportNowHook = (
|
|
150
|
+
export type ImportNowHook = (
|
|
151
|
+
moduleSpecifier: string,
|
|
152
|
+
) => ModuleDescriptor | undefined;
|
|
139
153
|
export type ImportMetaHook = (
|
|
140
154
|
moduleSpecifier: string,
|
|
141
|
-
importMeta:
|
|
155
|
+
importMeta: ImportMeta,
|
|
142
156
|
) => void;
|
|
143
157
|
|
|
144
158
|
export interface CompartmentOptions {
|
|
@@ -569,7 +583,9 @@ declare global {
|
|
|
569
583
|
|
|
570
584
|
evaluate(code: string, options?: CompartmentEvaluateOptions): any;
|
|
571
585
|
|
|
572
|
-
import(
|
|
586
|
+
import(
|
|
587
|
+
specifier: string | null,
|
|
588
|
+
): Promise<{ namespace: ModuleExportsNamespace }>;
|
|
573
589
|
|
|
574
590
|
load(specifier: string): Promise<void>;
|
|
575
591
|
|