ses 0.15.9 → 0.15.12
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/CHANGELOG.md +39 -0
- package/dist/lockdown.cjs +2644 -2548
- package/dist/lockdown.mjs +2644 -2548
- package/dist/lockdown.umd.js +2644 -2548
- package/dist/lockdown.umd.min.js +1 -1
- package/dist/ses.cjs +2644 -2548
- package/dist/ses.mjs +2644 -2548
- package/dist/ses.umd.js +2644 -2548
- package/dist/ses.umd.min.js +1 -1
- package/index.d.ts +5 -0
- package/package.json +12 -11
- package/src/commons.js +8 -0
- package/src/compartment-shim.js +8 -1
- package/src/global-object.js +35 -4
- package/src/lockdown-shim.js +29 -3
- package/src/make-eval-function.js +3 -1
- package/src/module-instance.js +24 -9
- package/src/whitelist-intrinsics.js +51 -20
- package/src/whitelist.js +15 -13
package/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Types of the SES environment
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
/* eslint-disable no-restricted-globals, vars-on-top, no-var */
|
|
2
6
|
|
|
3
7
|
// It's academically tempting to define a hardened type, but TypeScript doesn't
|
|
@@ -23,6 +27,7 @@ export interface LockdownOptions {
|
|
|
23
27
|
errorTaming?: 'safe' | 'unsafe';
|
|
24
28
|
dateTaming?: 'safe' | 'unsafe'; // deprecated
|
|
25
29
|
mathTaming?: 'safe' | 'unsafe'; // deprecated
|
|
30
|
+
evalTaming?: 'safeEval' | 'unsafeEval' | 'noEval';
|
|
26
31
|
stackFiltering?: 'concise' | 'verbose';
|
|
27
32
|
overrideTaming?: 'moderate' | 'min' | 'severe';
|
|
28
33
|
overrideDebug?: Array<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ses",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.12",
|
|
4
4
|
"description": "Hardened JavaScript for Fearless Cooperation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lockdown",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"types": "./index.d.ts",
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|
|
38
|
-
"import": "./
|
|
38
|
+
"import": "./index.js",
|
|
39
39
|
"require": "./dist/ses.cjs"
|
|
40
40
|
},
|
|
41
41
|
"./lockdown": {
|
|
42
|
-
"import": "./
|
|
42
|
+
"import": "./index.js",
|
|
43
43
|
"require": "./dist/ses.cjs"
|
|
44
44
|
},
|
|
45
45
|
"./package.json": "./package.json"
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
"lint": "yarn lint:types && yarn lint:js",
|
|
53
53
|
"lint-fix": "eslint --fix .",
|
|
54
54
|
"lint:js": "eslint .",
|
|
55
|
-
"lint:types": "tsc
|
|
55
|
+
"lint:types": "tsc",
|
|
56
56
|
"prepublish": "yarn run clean && yarn build",
|
|
57
57
|
"qt": "ava",
|
|
58
|
-
"test": "
|
|
58
|
+
"test": "tsd && ava",
|
|
59
59
|
"test:platform-compatability": "node test/package/test.cjs"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@endo/compartment-mapper": "^0.
|
|
63
|
-
"@endo/eslint-config": "^0.4.
|
|
64
|
-
"@endo/static-module-record": "^0.
|
|
65
|
-
"@endo/test262-runner": "^0.1.
|
|
62
|
+
"@endo/compartment-mapper": "^0.7.2",
|
|
63
|
+
"@endo/eslint-config": "^0.4.7",
|
|
64
|
+
"@endo/static-module-record": "^0.7.1",
|
|
65
|
+
"@endo/test262-runner": "^0.1.23",
|
|
66
66
|
"ava": "^3.12.1",
|
|
67
67
|
"babel-eslint": "^10.0.3",
|
|
68
68
|
"c8": "^7.7.3",
|
|
@@ -75,7 +75,8 @@
|
|
|
75
75
|
"prettier": "^1.19.1",
|
|
76
76
|
"sinon": "8.0.4",
|
|
77
77
|
"terser": "^4.8.0",
|
|
78
|
-
"
|
|
78
|
+
"tsd": "^0.19.1",
|
|
79
|
+
"typescript": "~4.6.2"
|
|
79
80
|
},
|
|
80
81
|
"files": [
|
|
81
82
|
"LICENSE*",
|
|
@@ -178,5 +179,5 @@
|
|
|
178
179
|
],
|
|
179
180
|
"timeout": "2m"
|
|
180
181
|
},
|
|
181
|
-
"gitHead": "
|
|
182
|
+
"gitHead": "59e511891ab67f4fa52d67141510974e22362134"
|
|
182
183
|
}
|
package/src/commons.js
CHANGED
|
@@ -72,6 +72,8 @@ export const {
|
|
|
72
72
|
toStringTag: toStringTagSymbol,
|
|
73
73
|
iterator: iteratorSymbol,
|
|
74
74
|
matchAll: matchAllSymbol,
|
|
75
|
+
keyFor: symbolKeyFor,
|
|
76
|
+
for: symbolFor,
|
|
75
77
|
} = Symbol;
|
|
76
78
|
|
|
77
79
|
export const { isInteger } = Number;
|
|
@@ -272,3 +274,9 @@ export const FERAL_EVAL = eval;
|
|
|
272
274
|
// Sample at module initialization time, which is before lockdown can
|
|
273
275
|
// repair it. Use it only to build powerless abstractions.
|
|
274
276
|
export const FERAL_FUNCTION = Function;
|
|
277
|
+
|
|
278
|
+
export const noEvalEvaluate = () => {
|
|
279
|
+
throw new TypeError(
|
|
280
|
+
'Cannot eval with evalTaming set to "noEval" (SES_NO_EVAL)',
|
|
281
|
+
);
|
|
282
|
+
};
|
package/src/compartment-shim.js
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
setGlobalObjectConstantProperties,
|
|
25
25
|
setGlobalObjectMutableProperties,
|
|
26
|
+
setGlobalObjectEvaluators,
|
|
26
27
|
} from './global-object.js';
|
|
27
28
|
import { isValidIdentifierName } from './scope-constants.js';
|
|
28
29
|
import { sharedGlobalPropertyNames } from './whitelist.js';
|
|
@@ -292,10 +293,16 @@ export const makeCompartmentConstructor = (
|
|
|
292
293
|
intrinsics,
|
|
293
294
|
newGlobalPropertyNames: sharedGlobalPropertyNames,
|
|
294
295
|
makeCompartmentConstructor: targetMakeCompartmentConstructor,
|
|
295
|
-
safeEvaluate,
|
|
296
296
|
markVirtualizedNativeFunction,
|
|
297
297
|
});
|
|
298
298
|
|
|
299
|
+
// TODO: maybe add evalTaming to the Compartment constructor 3rd options?
|
|
300
|
+
setGlobalObjectEvaluators(
|
|
301
|
+
globalObject,
|
|
302
|
+
safeEvaluate,
|
|
303
|
+
markVirtualizedNativeFunction,
|
|
304
|
+
);
|
|
305
|
+
|
|
299
306
|
assign(globalObject, endowments);
|
|
300
307
|
|
|
301
308
|
weakmapSet(privateFields, this, {
|
package/src/global-object.js
CHANGED
|
@@ -34,7 +34,6 @@ export const setGlobalObjectConstantProperties = globalObject => {
|
|
|
34
34
|
* @param {Object} param1.intrinsics
|
|
35
35
|
* @param {Object} param1.newGlobalPropertyNames
|
|
36
36
|
* @param {Function} param1.makeCompartmentConstructor
|
|
37
|
-
* @param {(string, Object?) => any} param1.safeEvaluate
|
|
38
37
|
* @param {(Object) => void} param1.markVirtualizedNativeFunction
|
|
39
38
|
*/
|
|
40
39
|
export const setGlobalObjectMutableProperties = (
|
|
@@ -43,7 +42,6 @@ export const setGlobalObjectMutableProperties = (
|
|
|
43
42
|
intrinsics,
|
|
44
43
|
newGlobalPropertyNames,
|
|
45
44
|
makeCompartmentConstructor,
|
|
46
|
-
safeEvaluate,
|
|
47
45
|
markVirtualizedNativeFunction,
|
|
48
46
|
},
|
|
49
47
|
) => {
|
|
@@ -71,8 +69,6 @@ export const setGlobalObjectMutableProperties = (
|
|
|
71
69
|
|
|
72
70
|
const perCompartmentGlobals = {
|
|
73
71
|
globalThis: globalObject,
|
|
74
|
-
eval: makeEvalFunction(safeEvaluate),
|
|
75
|
-
Function: makeFunctionConstructor(safeEvaluate),
|
|
76
72
|
};
|
|
77
73
|
|
|
78
74
|
perCompartmentGlobals.Compartment = makeCompartmentConstructor(
|
|
@@ -95,3 +91,38 @@ export const setGlobalObjectMutableProperties = (
|
|
|
95
91
|
}
|
|
96
92
|
}
|
|
97
93
|
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* setGlobalObjectEvaluators()
|
|
97
|
+
* Set the eval and the Function evaluator on the global object with given evalTaming policy.
|
|
98
|
+
*
|
|
99
|
+
* @param {Object} globalObject
|
|
100
|
+
* @param {Function} evaluator
|
|
101
|
+
* @param {(Object) => void} markVirtualizedNativeFunction
|
|
102
|
+
*/
|
|
103
|
+
export const setGlobalObjectEvaluators = (
|
|
104
|
+
globalObject,
|
|
105
|
+
evaluator,
|
|
106
|
+
markVirtualizedNativeFunction,
|
|
107
|
+
) => {
|
|
108
|
+
{
|
|
109
|
+
const f = makeEvalFunction(evaluator);
|
|
110
|
+
markVirtualizedNativeFunction(f);
|
|
111
|
+
defineProperty(globalObject, 'eval', {
|
|
112
|
+
value: f,
|
|
113
|
+
writable: true,
|
|
114
|
+
enumerable: false,
|
|
115
|
+
configurable: true,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
{
|
|
119
|
+
const f = makeFunctionConstructor(evaluator);
|
|
120
|
+
markVirtualizedNativeFunction(f);
|
|
121
|
+
defineProperty(globalObject, 'Function', {
|
|
122
|
+
value: f,
|
|
123
|
+
writable: true,
|
|
124
|
+
enumerable: false,
|
|
125
|
+
configurable: true,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
};
|
package/src/lockdown-shim.js
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
is,
|
|
25
25
|
ownKeys,
|
|
26
26
|
stringSplit,
|
|
27
|
+
noEvalEvaluate,
|
|
27
28
|
} from './commons.js';
|
|
28
29
|
import { enJoin } from './error/stringify-utils.js';
|
|
29
30
|
import { makeHardener } from './make-hardener.js';
|
|
@@ -38,6 +39,7 @@ import tameLocaleMethods from './tame-locale-methods.js';
|
|
|
38
39
|
import {
|
|
39
40
|
setGlobalObjectConstantProperties,
|
|
40
41
|
setGlobalObjectMutableProperties,
|
|
42
|
+
setGlobalObjectEvaluators,
|
|
41
43
|
} from './global-object.js';
|
|
42
44
|
import { makeSafeEvaluator } from './make-safe-evaluator.js';
|
|
43
45
|
import { initialGlobalPropertyNames } from './whitelist.js';
|
|
@@ -164,6 +166,7 @@ export const repairIntrinsics = (options = {}) => {
|
|
|
164
166
|
overrideTaming = getenv('LOCKDOWN_OVERRIDE_TAMING', 'moderate'),
|
|
165
167
|
stackFiltering = getenv('LOCKDOWN_STACK_FILTERING', 'concise'),
|
|
166
168
|
domainTaming = getenv('LOCKDOWN_DOMAIN_TAMING', 'safe'),
|
|
169
|
+
evalTaming = getenv('LOCKDOWN_EVAL_TAMING', 'safeEval'),
|
|
167
170
|
overrideDebug = arrayFilter(
|
|
168
171
|
stringSplit(getenv('LOCKDOWN_OVERRIDE_DEBUG', ''), ','),
|
|
169
172
|
/** @param {string} debugName */
|
|
@@ -189,6 +192,13 @@ export const repairIntrinsics = (options = {}) => {
|
|
|
189
192
|
);
|
|
190
193
|
}
|
|
191
194
|
|
|
195
|
+
assert(
|
|
196
|
+
evalTaming === 'unsafeEval' ||
|
|
197
|
+
evalTaming === 'safeEval' ||
|
|
198
|
+
evalTaming === 'noEval',
|
|
199
|
+
d`lockdown(): non supported option evalTaming: ${q(evalTaming)}`,
|
|
200
|
+
);
|
|
201
|
+
|
|
192
202
|
// Assert that only supported options were passed.
|
|
193
203
|
// Use Reflect.ownKeys to reject symbol-named properties as well.
|
|
194
204
|
const extraOptionsNames = ownKeys(extraOptions);
|
|
@@ -324,16 +334,32 @@ export const repairIntrinsics = (options = {}) => {
|
|
|
324
334
|
|
|
325
335
|
setGlobalObjectConstantProperties(globalThis);
|
|
326
336
|
|
|
327
|
-
const { safeEvaluate } = makeSafeEvaluator({ globalObject: globalThis });
|
|
328
|
-
|
|
329
337
|
setGlobalObjectMutableProperties(globalThis, {
|
|
330
338
|
intrinsics,
|
|
331
339
|
newGlobalPropertyNames: initialGlobalPropertyNames,
|
|
332
340
|
makeCompartmentConstructor,
|
|
333
|
-
safeEvaluate,
|
|
334
341
|
markVirtualizedNativeFunction,
|
|
335
342
|
});
|
|
336
343
|
|
|
344
|
+
if (evalTaming === 'noEval') {
|
|
345
|
+
setGlobalObjectEvaluators(
|
|
346
|
+
globalThis,
|
|
347
|
+
noEvalEvaluate,
|
|
348
|
+
markVirtualizedNativeFunction,
|
|
349
|
+
);
|
|
350
|
+
} else if (evalTaming === 'safeEval') {
|
|
351
|
+
const { safeEvaluate } = makeSafeEvaluator({ globalObject: globalThis });
|
|
352
|
+
setGlobalObjectEvaluators(
|
|
353
|
+
globalThis,
|
|
354
|
+
safeEvaluate,
|
|
355
|
+
markVirtualizedNativeFunction,
|
|
356
|
+
);
|
|
357
|
+
} else if (evalTaming === 'unsafeEval') {
|
|
358
|
+
// Leave eval function and Function constructor of the initial compartment in-tact.
|
|
359
|
+
// Other compartments will not have access to these evaluators unless a guest program
|
|
360
|
+
// escapes containment.
|
|
361
|
+
}
|
|
362
|
+
|
|
337
363
|
/**
|
|
338
364
|
* 3. HARDEN to share the intrinsics.
|
|
339
365
|
*
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
2
|
* makeEvalFunction()
|
|
3
3
|
* A safe version of the native eval function which relies on
|
|
4
4
|
* the safety of safeEvaluate for confinement.
|
|
5
|
+
*
|
|
6
|
+
* @param {Function} safeEvaluate
|
|
5
7
|
*/
|
|
6
8
|
export const makeEvalFunction = safeEvaluate => {
|
|
7
9
|
// We use the the concise method syntax to create an eval without a
|
package/src/module-instance.js
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
keys,
|
|
18
18
|
mapGet,
|
|
19
19
|
weakmapGet,
|
|
20
|
+
reflectHas,
|
|
20
21
|
} from './commons.js';
|
|
21
22
|
import { compartmentEvaluate } from './compartment-evaluate.js';
|
|
22
23
|
|
|
@@ -73,22 +74,36 @@ export const makeThirdPartyModuleInstance = (
|
|
|
73
74
|
update(value);
|
|
74
75
|
};
|
|
75
76
|
});
|
|
77
|
+
// This is enough to support import * from cjs - the '*' field doesn't need to be in exports nor proxiedExports because import will only ever access it via notifiers
|
|
78
|
+
notifiers['*'] = update => {
|
|
79
|
+
update(proxiedExports);
|
|
80
|
+
};
|
|
76
81
|
}
|
|
77
82
|
|
|
78
|
-
|
|
83
|
+
const localState = {
|
|
84
|
+
activated: false,
|
|
85
|
+
};
|
|
79
86
|
return freeze({
|
|
80
87
|
notifiers,
|
|
81
88
|
exportsProxy,
|
|
82
89
|
execute() {
|
|
83
|
-
if (
|
|
90
|
+
if (reflectHas(localState, 'errorFromExecute')) {
|
|
91
|
+
throw localState.errorFromExecute;
|
|
92
|
+
}
|
|
93
|
+
if (!localState.activated) {
|
|
84
94
|
activate();
|
|
85
|
-
activated = true;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
localState.activated = true;
|
|
96
|
+
try {
|
|
97
|
+
// eslint-disable-next-line @endo/no-polymorphic-call
|
|
98
|
+
staticModuleRecord.execute(
|
|
99
|
+
proxiedExports,
|
|
100
|
+
compartment,
|
|
101
|
+
resolvedImports,
|
|
102
|
+
);
|
|
103
|
+
} catch (err) {
|
|
104
|
+
localState.errorFromExecute = err;
|
|
105
|
+
throw err;
|
|
106
|
+
}
|
|
92
107
|
}
|
|
93
108
|
},
|
|
94
109
|
});
|
|
@@ -45,35 +45,22 @@
|
|
|
45
45
|
|
|
46
46
|
import { whitelist, FunctionInstance, isAccessorPermit } from './whitelist.js';
|
|
47
47
|
import {
|
|
48
|
+
Map,
|
|
48
49
|
String,
|
|
49
50
|
TypeError,
|
|
51
|
+
arrayFilter,
|
|
50
52
|
arrayIncludes,
|
|
53
|
+
arrayMap,
|
|
54
|
+
entries,
|
|
51
55
|
getOwnPropertyDescriptor,
|
|
52
56
|
getPrototypeOf,
|
|
53
57
|
isObject,
|
|
58
|
+
mapGet,
|
|
54
59
|
objectHasOwnProperty,
|
|
55
60
|
ownKeys,
|
|
56
|
-
|
|
61
|
+
symbolKeyFor,
|
|
57
62
|
} from './commons.js';
|
|
58
63
|
|
|
59
|
-
/**
|
|
60
|
-
* asStringPropertyName()
|
|
61
|
-
*
|
|
62
|
-
* @param {string} path
|
|
63
|
-
* @param {string | symbol} prop
|
|
64
|
-
*/
|
|
65
|
-
function asStringPropertyName(path, prop) {
|
|
66
|
-
if (typeof prop === 'string') {
|
|
67
|
-
return prop;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (typeof prop === 'symbol') {
|
|
71
|
-
return `@@${stringSlice(String(prop), 14, -1)}`;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
throw new TypeError(`Unexpected property name type ${path} ${prop}`);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
64
|
/**
|
|
78
65
|
* whitelistIntrinsics()
|
|
79
66
|
* Removes all non-allowed properties found by recursively and
|
|
@@ -86,9 +73,53 @@ export default function whitelistIntrinsics(
|
|
|
86
73
|
intrinsics,
|
|
87
74
|
markVirtualizedNativeFunction,
|
|
88
75
|
) {
|
|
89
|
-
// These
|
|
76
|
+
// These primitives are allowed allowed for permits.
|
|
90
77
|
const primitives = ['undefined', 'boolean', 'number', 'string', 'symbol'];
|
|
91
78
|
|
|
79
|
+
// These symbols are allowed as well-known symbols
|
|
80
|
+
const wellKnownSymbolNames = new Map(
|
|
81
|
+
intrinsics.Symbol
|
|
82
|
+
? arrayMap(
|
|
83
|
+
arrayFilter(
|
|
84
|
+
entries(whitelist.Symbol),
|
|
85
|
+
([name, permit]) =>
|
|
86
|
+
permit === 'symbol' &&
|
|
87
|
+
typeof intrinsics.Symbol[name] === 'symbol',
|
|
88
|
+
),
|
|
89
|
+
([name]) => [intrinsics.Symbol[name], `@@${name}`],
|
|
90
|
+
)
|
|
91
|
+
: [],
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* asStringPropertyName()
|
|
96
|
+
*
|
|
97
|
+
* @param {string} path
|
|
98
|
+
* @param {string | symbol} prop
|
|
99
|
+
*/
|
|
100
|
+
function asStringPropertyName(path, prop) {
|
|
101
|
+
if (typeof prop === 'string') {
|
|
102
|
+
return prop;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const wellKnownSymbol = mapGet(wellKnownSymbolNames, prop);
|
|
106
|
+
|
|
107
|
+
if (typeof prop === 'symbol') {
|
|
108
|
+
if (wellKnownSymbol) {
|
|
109
|
+
return wellKnownSymbol;
|
|
110
|
+
} else {
|
|
111
|
+
const registeredKey = symbolKeyFor(prop);
|
|
112
|
+
if (registeredKey !== undefined) {
|
|
113
|
+
return `RegisteredSymbol(${registeredKey})`;
|
|
114
|
+
} else {
|
|
115
|
+
return `Unique${String(prop)}`;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
throw new TypeError(`Unexpected property name type ${path} ${prop}`);
|
|
121
|
+
}
|
|
122
|
+
|
|
92
123
|
/*
|
|
93
124
|
* visitPrototype()
|
|
94
125
|
* Validate the object's [[prototype]] against a permit.
|
package/src/whitelist.js
CHANGED
|
@@ -224,7 +224,10 @@ export const NativeErrors = [
|
|
|
224
224
|
* property definition.
|
|
225
225
|
* <li>"ObjectPrototype" is the default "[[Proto]]" (when not specified).
|
|
226
226
|
* <li>Constants "fn" and "getter" are used to keep the structure DRY.
|
|
227
|
-
* <li>Symbol properties are listed
|
|
227
|
+
* <li>Symbol properties are listed as follow:
|
|
228
|
+
* <li>Well-known symbols use the "@@name" form.
|
|
229
|
+
* <li>Registered symbols use the "RegisteredSymbol(key)" form.
|
|
230
|
+
* <li>Unique symbols use the "UniqueSymbol(description)" form.
|
|
228
231
|
*/
|
|
229
232
|
|
|
230
233
|
// Function Instances
|
|
@@ -418,6 +421,7 @@ export const whitelist = {
|
|
|
418
421
|
getOwnPropertyNames: fn,
|
|
419
422
|
getOwnPropertySymbols: fn,
|
|
420
423
|
getPrototypeOf: fn,
|
|
424
|
+
hasOwn: fn,
|
|
421
425
|
is: fn,
|
|
422
426
|
isExtensible: fn,
|
|
423
427
|
isFrozen: fn,
|
|
@@ -428,8 +432,6 @@ export const whitelist = {
|
|
|
428
432
|
seal: fn,
|
|
429
433
|
setPrototypeOf: fn,
|
|
430
434
|
values: fn,
|
|
431
|
-
// See https://github.com/tc39/proposal-accessible-object-hasownproperty
|
|
432
|
-
hasOwn: fn,
|
|
433
435
|
},
|
|
434
436
|
|
|
435
437
|
'%ObjectPrototype%': {
|
|
@@ -724,6 +726,7 @@ export const whitelist = {
|
|
|
724
726
|
'%StringPrototype%': {
|
|
725
727
|
// Properties of the String Prototype Object
|
|
726
728
|
length: 'number',
|
|
729
|
+
at: fn,
|
|
727
730
|
charAt: fn,
|
|
728
731
|
charCodeAt: fn,
|
|
729
732
|
codePointAt: fn,
|
|
@@ -777,10 +780,6 @@ export const whitelist = {
|
|
|
777
780
|
trimRight: fn,
|
|
778
781
|
// See https://github.com/Moddable-OpenSource/moddable/issues/523
|
|
779
782
|
compare: false,
|
|
780
|
-
|
|
781
|
-
// Stage 3:
|
|
782
|
-
// https://tc39.es/proposal-relative-indexing-method/
|
|
783
|
-
at: fn,
|
|
784
783
|
},
|
|
785
784
|
|
|
786
785
|
'%StringIteratorPrototype%': {
|
|
@@ -877,6 +876,7 @@ export const whitelist = {
|
|
|
877
876
|
|
|
878
877
|
'%ArrayPrototype%': {
|
|
879
878
|
// Properties of the Array Prototype Object
|
|
879
|
+
at: fn,
|
|
880
880
|
length: 'number',
|
|
881
881
|
concat: fn,
|
|
882
882
|
constructor: 'Array',
|
|
@@ -926,10 +926,10 @@ export const whitelist = {
|
|
|
926
926
|
// Failed tc39 proposal
|
|
927
927
|
// Seen on FF Nightly 88.0a1
|
|
928
928
|
at: false,
|
|
929
|
+
// See https://github.com/tc39/proposal-array-find-from-last
|
|
930
|
+
findLast: 'boolean',
|
|
931
|
+
findLastIndex: 'boolean',
|
|
929
932
|
},
|
|
930
|
-
// Failed tc39 proposal
|
|
931
|
-
// Seen on FF Nightly 88.0a1
|
|
932
|
-
at: false,
|
|
933
933
|
// See https://github.com/tc39/proposal-array-find-from-last
|
|
934
934
|
findLast: fn,
|
|
935
935
|
findLastIndex: fn,
|
|
@@ -954,6 +954,7 @@ export const whitelist = {
|
|
|
954
954
|
},
|
|
955
955
|
|
|
956
956
|
'%TypedArrayPrototype%': {
|
|
957
|
+
at: fn,
|
|
957
958
|
buffer: getter,
|
|
958
959
|
byteLength: getter,
|
|
959
960
|
byteOffset: getter,
|
|
@@ -986,9 +987,6 @@ export const whitelist = {
|
|
|
986
987
|
values: fn,
|
|
987
988
|
'@@iterator': fn,
|
|
988
989
|
'@@toStringTag': getter,
|
|
989
|
-
// Failed tc39 proposal
|
|
990
|
-
// Seen on FF Nightly 88.0a1
|
|
991
|
-
at: false,
|
|
992
990
|
// See https://github.com/tc39/proposal-array-find-from-last
|
|
993
991
|
findLast: fn,
|
|
994
992
|
findLastIndex: fn,
|
|
@@ -1289,6 +1287,10 @@ export const whitelist = {
|
|
|
1289
1287
|
finally: fn,
|
|
1290
1288
|
then: fn,
|
|
1291
1289
|
'@@toStringTag': 'string',
|
|
1290
|
+
// Non-standard, used in node to prevent async_hooks from breaking
|
|
1291
|
+
'UniqueSymbol(async_id_symbol)': accessor,
|
|
1292
|
+
'UniqueSymbol(trigger_async_id_symbol)': accessor,
|
|
1293
|
+
'UniqueSymbol(destroyed)': accessor,
|
|
1292
1294
|
},
|
|
1293
1295
|
|
|
1294
1296
|
'%InertAsyncFunction%': {
|