@nocobase/plugin-flow-engine 2.0.0-alpha.10

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 (127) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +29 -0
  3. package/build.config.ts +22 -0
  4. package/client.d.ts +2 -0
  5. package/client.js +1 -0
  6. package/dist/client/index.d.ts +15 -0
  7. package/dist/client/index.js +10 -0
  8. package/dist/externalVersion.js +21 -0
  9. package/dist/index.d.ts +10 -0
  10. package/dist/index.js +48 -0
  11. package/dist/locale/en-US.json +61 -0
  12. package/dist/locale/index.d.ts +141 -0
  13. package/dist/locale/index.js +79 -0
  14. package/dist/locale/zh-CN.json +61 -0
  15. package/dist/node_modules/ses/LICENSE +201 -0
  16. package/dist/node_modules/ses/LICENSE-aura +16 -0
  17. package/dist/node_modules/ses/LICENSE-caja +13 -0
  18. package/dist/node_modules/ses/LICENSE-corejs +19 -0
  19. package/dist/node_modules/ses/LICENSE-v8 +9 -0
  20. package/dist/node_modules/ses/assert-shim.js +1 -0
  21. package/dist/node_modules/ses/compartment-shim.js +1 -0
  22. package/dist/node_modules/ses/console-shim.js +1 -0
  23. package/dist/node_modules/ses/dist/lockdown.cjs +13912 -0
  24. package/dist/node_modules/ses/dist/lockdown.umd.js +13912 -0
  25. package/dist/node_modules/ses/dist/lockdown.umd.min.js +1 -0
  26. package/dist/node_modules/ses/dist/ses-hermes.cjs +13912 -0
  27. package/dist/node_modules/ses/dist/ses.cjs +1 -0
  28. package/dist/node_modules/ses/dist/ses.umd.js +13912 -0
  29. package/dist/node_modules/ses/dist/ses.umd.min.js +1 -0
  30. package/dist/node_modules/ses/dist/types.d.cts +606 -0
  31. package/dist/node_modules/ses/index.js +18 -0
  32. package/dist/node_modules/ses/lockdown-shim.js +1 -0
  33. package/dist/node_modules/ses/lockdown.js +1 -0
  34. package/dist/node_modules/ses/package.json +1 -0
  35. package/dist/node_modules/ses/src/assert-shim.js +4 -0
  36. package/dist/node_modules/ses/src/assert-sloppy-mode.js +11 -0
  37. package/dist/node_modules/ses/src/cauterize-property.js +69 -0
  38. package/dist/node_modules/ses/src/commons.js +425 -0
  39. package/dist/node_modules/ses/src/compartment-evaluate.js +93 -0
  40. package/dist/node_modules/ses/src/compartment-shim.js +22 -0
  41. package/dist/node_modules/ses/src/compartment.js +477 -0
  42. package/dist/node_modules/ses/src/console-shim.js +50 -0
  43. package/dist/node_modules/ses/src/enable-property-overrides.js +211 -0
  44. package/dist/node_modules/ses/src/enablements.js +244 -0
  45. package/dist/node_modules/ses/src/error/assert.js +584 -0
  46. package/dist/node_modules/ses/src/error/console.js +541 -0
  47. package/dist/node_modules/ses/src/error/fatal-assert.js +54 -0
  48. package/dist/node_modules/ses/src/error/internal-types.js +98 -0
  49. package/dist/node_modules/ses/src/error/note-log-args.js +77 -0
  50. package/dist/node_modules/ses/src/error/stringify-utils.js +195 -0
  51. package/dist/node_modules/ses/src/error/tame-console.js +197 -0
  52. package/dist/node_modules/ses/src/error/tame-error-constructor.js +284 -0
  53. package/dist/node_modules/ses/src/error/tame-v8-error-constructor.js +386 -0
  54. package/dist/node_modules/ses/src/error/types.js +59 -0
  55. package/dist/node_modules/ses/src/error/unhandled-rejection.js +122 -0
  56. package/dist/node_modules/ses/src/eval-scope.js +89 -0
  57. package/dist/node_modules/ses/src/get-anonymous-intrinsics.js +181 -0
  58. package/dist/node_modules/ses/src/get-source-url.js +50 -0
  59. package/dist/node_modules/ses/src/global-object.js +175 -0
  60. package/dist/node_modules/ses/src/intrinsics.js +192 -0
  61. package/dist/node_modules/ses/src/lockdown-shim.js +37 -0
  62. package/dist/node_modules/ses/src/lockdown.js +558 -0
  63. package/dist/node_modules/ses/src/make-eval-function.js +28 -0
  64. package/dist/node_modules/ses/src/make-evaluate.js +110 -0
  65. package/dist/node_modules/ses/src/make-function-constructor.js +79 -0
  66. package/dist/node_modules/ses/src/make-hardener.js +275 -0
  67. package/dist/node_modules/ses/src/make-safe-evaluator.js +112 -0
  68. package/dist/node_modules/ses/src/module-instance.js +497 -0
  69. package/dist/node_modules/ses/src/module-link.js +159 -0
  70. package/dist/node_modules/ses/src/module-load.js +719 -0
  71. package/dist/node_modules/ses/src/module-proxy.js +200 -0
  72. package/dist/node_modules/ses/src/permits-intrinsics.js +291 -0
  73. package/dist/node_modules/ses/src/permits.js +1761 -0
  74. package/dist/node_modules/ses/src/reporting-types.d.ts +13 -0
  75. package/dist/node_modules/ses/src/reporting.js +105 -0
  76. package/dist/node_modules/ses/src/scope-constants.js +180 -0
  77. package/dist/node_modules/ses/src/shim-arraybuffer-transfer.js +85 -0
  78. package/dist/node_modules/ses/src/sloppy-globals-scope-terminator.js +61 -0
  79. package/dist/node_modules/ses/src/strict-scope-terminator.js +99 -0
  80. package/dist/node_modules/ses/src/tame-date-constructor.js +127 -0
  81. package/dist/node_modules/ses/src/tame-domains.js +41 -0
  82. package/dist/node_modules/ses/src/tame-faux-data-properties.js +210 -0
  83. package/dist/node_modules/ses/src/tame-function-constructors.js +140 -0
  84. package/dist/node_modules/ses/src/tame-function-tostring.js +50 -0
  85. package/dist/node_modules/ses/src/tame-harden.js +29 -0
  86. package/dist/node_modules/ses/src/tame-locale-methods.js +78 -0
  87. package/dist/node_modules/ses/src/tame-math-object.js +41 -0
  88. package/dist/node_modules/ses/src/tame-module-source.js +51 -0
  89. package/dist/node_modules/ses/src/tame-regenerator-runtime.js +29 -0
  90. package/dist/node_modules/ses/src/tame-regexp-constructor.js +65 -0
  91. package/dist/node_modules/ses/src/tame-symbol-constructor.js +64 -0
  92. package/dist/node_modules/ses/src/transforms.js +267 -0
  93. package/dist/node_modules/ses/tools.js +25 -0
  94. package/dist/node_modules/ses/types.d.ts +606 -0
  95. package/dist/server/actions/ui-schema-action.d.ts +27 -0
  96. package/dist/server/actions/ui-schema-action.js +118 -0
  97. package/dist/server/collections/flowModelTreePath.d.ts +11 -0
  98. package/dist/server/collections/flowModelTreePath.js +74 -0
  99. package/dist/server/collections/flowModels.d.ts +11 -0
  100. package/dist/server/collections/flowModels.js +57 -0
  101. package/dist/server/collections/flowsql.d.ts +10 -0
  102. package/dist/server/collections/flowsql.js +51 -0
  103. package/dist/server/dao/ui_schema_node_dao.d.ts +26 -0
  104. package/dist/server/dao/ui_schema_node_dao.js +24 -0
  105. package/dist/server/helper.d.ts +8 -0
  106. package/dist/server/helper.js +9 -0
  107. package/dist/server/index.d.ts +9 -0
  108. package/dist/server/index.js +42 -0
  109. package/dist/server/model.d.ts +12 -0
  110. package/dist/server/model.js +38 -0
  111. package/dist/server/plugin.d.ts +25 -0
  112. package/dist/server/plugin.js +191 -0
  113. package/dist/server/repository.d.ts +116 -0
  114. package/dist/server/repository.js +1209 -0
  115. package/dist/server/server.d.ts +16 -0
  116. package/dist/server/server.js +198 -0
  117. package/dist/server/template/contexts.d.ts +73 -0
  118. package/dist/server/template/contexts.js +233 -0
  119. package/dist/server/template/resolver.d.ts +30 -0
  120. package/dist/server/template/resolver.js +225 -0
  121. package/dist/server/variables/registry.d.ts +52 -0
  122. package/dist/server/variables/registry.js +333 -0
  123. package/dist/server/variables/utils.d.ts +17 -0
  124. package/dist/server/variables/utils.js +113 -0
  125. package/package.json +28 -0
  126. package/server.d.ts +2 -0
  127. package/server.js +1 -0
@@ -0,0 +1,1761 @@
1
+ /* eslint-disable no-restricted-globals */
2
+ /* eslint max-lines: 0 */
3
+
4
+ import { arrayPush, arrayForEach } from './commons.js';
5
+
6
+ /** @import {GenericErrorConstructor} from '../types.js' */
7
+
8
+ /**
9
+ * Exports {@code permits}, a recursively defined
10
+ * JSON record enumerating all intrinsics and their properties
11
+ * according to ECMA specs.
12
+ *
13
+ * @author JF Paradis
14
+ * @author Mark S. Miller
15
+ *
16
+ * @module
17
+ */
18
+
19
+ /**
20
+ * constantProperties
21
+ * non-configurable, non-writable data properties of all global objects.
22
+ * Must be powerless.
23
+ * Maps from property name to the actual value
24
+ */
25
+ export const constantProperties = {
26
+ // *** Value Properties of the Global Object
27
+
28
+ Infinity,
29
+ NaN,
30
+ undefined,
31
+ };
32
+
33
+ /**
34
+ * universalPropertyNames
35
+ * Properties of all global objects.
36
+ * Must be powerless.
37
+ * Maps from property name to the intrinsic name in the permits.
38
+ */
39
+ export const universalPropertyNames = {
40
+ // *** Function Properties of the Global Object
41
+
42
+ isFinite: 'isFinite',
43
+ isNaN: 'isNaN',
44
+ parseFloat: 'parseFloat',
45
+ parseInt: 'parseInt',
46
+
47
+ decodeURI: 'decodeURI',
48
+ decodeURIComponent: 'decodeURIComponent',
49
+ encodeURI: 'encodeURI',
50
+ encodeURIComponent: 'encodeURIComponent',
51
+
52
+ // *** Constructor Properties of the Global Object
53
+
54
+ Array: 'Array',
55
+ ArrayBuffer: 'ArrayBuffer',
56
+ BigInt: 'BigInt',
57
+ BigInt64Array: 'BigInt64Array',
58
+ BigUint64Array: 'BigUint64Array',
59
+ Boolean: 'Boolean',
60
+ DataView: 'DataView',
61
+ EvalError: 'EvalError',
62
+ // https://github.com/tc39/proposal-float16array
63
+ Float16Array: 'Float16Array',
64
+ Float32Array: 'Float32Array',
65
+ Float64Array: 'Float64Array',
66
+ Int8Array: 'Int8Array',
67
+ Int16Array: 'Int16Array',
68
+ Int32Array: 'Int32Array',
69
+ Map: 'Map',
70
+ Number: 'Number',
71
+ Object: 'Object',
72
+ Promise: 'Promise',
73
+ Proxy: 'Proxy',
74
+ RangeError: 'RangeError',
75
+ ReferenceError: 'ReferenceError',
76
+ Set: 'Set',
77
+ String: 'String',
78
+ SyntaxError: 'SyntaxError',
79
+ TypeError: 'TypeError',
80
+ Uint8Array: 'Uint8Array',
81
+ Uint8ClampedArray: 'Uint8ClampedArray',
82
+ Uint16Array: 'Uint16Array',
83
+ Uint32Array: 'Uint32Array',
84
+ URIError: 'URIError',
85
+ WeakMap: 'WeakMap',
86
+ WeakSet: 'WeakSet',
87
+ // https://github.com/tc39/proposal-iterator-helpers
88
+ Iterator: 'Iterator',
89
+ // https://github.com/tc39/proposal-async-iterator-helpers
90
+ AsyncIterator: 'AsyncIterator',
91
+ // https://github.com/endojs/endo/issues/550
92
+ AggregateError: 'AggregateError',
93
+
94
+ // https://github.com/tc39/proposal-explicit-resource-management
95
+ // TODO DisposableStack, AsyncDisposableStack
96
+ // DisposableStack: 'DisposableStack',
97
+ // AsyncDisposableStack: 'AsyncDisposableStack',
98
+
99
+ // https://tc39.es/proposal-shadowrealm/
100
+ // TODO ShadowRealm
101
+ // ShadowRealm: 'ShadowRealm',
102
+
103
+ // *** Other Properties of the Global Object
104
+
105
+ JSON: 'JSON',
106
+ Reflect: 'Reflect',
107
+
108
+ // *** Annex B
109
+
110
+ escape: 'escape',
111
+ unescape: 'unescape',
112
+
113
+ // ESNext
114
+
115
+ // https://github.com/tc39/proposal-source-phase-imports?tab=readme-ov-file#js-module-source
116
+ ModuleSource: 'ModuleSource',
117
+
118
+ lockdown: 'lockdown',
119
+ harden: 'harden',
120
+
121
+ HandledPromise: 'HandledPromise', // TODO: Until Promise.delegate (see below).
122
+ };
123
+
124
+ /**
125
+ * initialGlobalPropertyNames
126
+ * Those found only on the initial global, i.e., the global of the
127
+ * start compartment, as well as any compartments created before lockdown.
128
+ * These may provide much of the power provided by the original.
129
+ * Maps from property name to the intrinsic name in the permits.
130
+ */
131
+ export const initialGlobalPropertyNames = {
132
+ // *** Constructor Properties of the Global Object
133
+
134
+ Date: '%InitialDate%',
135
+ Error: '%InitialError%',
136
+ RegExp: '%InitialRegExp%',
137
+
138
+ // Omit `Symbol`, because we want the original to appear on the
139
+ // start compartment without passing through the permits mechanism, since
140
+ // we want to preserve all its properties, even if we never heard of them.
141
+ // Symbol: '%InitialSymbol%',
142
+
143
+ // *** Other Properties of the Global Object
144
+
145
+ Math: '%InitialMath%',
146
+
147
+ // ESNext
148
+
149
+ // From Error-stack proposal
150
+ // Only on initial global. No corresponding
151
+ // powerless form for other globals.
152
+ getStackString: '%InitialGetStackString%',
153
+
154
+ // TODO https://github.com/Agoric/SES-shim/issues/551
155
+ // Need initial WeakRef and FinalizationGroup in
156
+ // start compartment only.
157
+
158
+ // TODO Temporal
159
+ // https://github.com/tc39/proposal-temporal
160
+ // Temporal: '%InitialTemporal%' // with Temporal.Now
161
+ };
162
+
163
+ /**
164
+ * sharedGlobalPropertyNames
165
+ * Those found only on the globals of new compartments created after lockdown,
166
+ * which must therefore be powerless.
167
+ * Maps from property name to the intrinsic name in the permits.
168
+ */
169
+ export const sharedGlobalPropertyNames = {
170
+ // *** Constructor Properties of the Global Object
171
+
172
+ Date: '%SharedDate%',
173
+ Error: '%SharedError%',
174
+ RegExp: '%SharedRegExp%',
175
+ Symbol: '%SharedSymbol%',
176
+
177
+ // *** Other Properties of the Global Object
178
+
179
+ Math: '%SharedMath%',
180
+
181
+ // TODO Temporal
182
+ // https://github.com/tc39/proposal-temporal
183
+ // Temporal: '%SharedTemporal%' // without Temporal.Now
184
+ };
185
+
186
+ /**
187
+ * uniqueGlobalPropertyNames
188
+ * Those made separately for each global, including the initial global
189
+ * of the start compartment.
190
+ * Maps from property name to the intrinsic name in the permits
191
+ * (which is currently always the same).
192
+ */
193
+ export const uniqueGlobalPropertyNames = {
194
+ // *** Value Properties of the Global Object
195
+
196
+ globalThis: '%UniqueGlobalThis%',
197
+
198
+ // *** Function Properties of the Global Object
199
+
200
+ eval: '%UniqueEval%',
201
+
202
+ // *** Constructor Properties of the Global Object
203
+
204
+ Function: '%UniqueFunction%',
205
+
206
+ // *** Other Properties of the Global Object
207
+
208
+ // ESNext
209
+
210
+ Compartment: '%UniqueCompartment%',
211
+ // According to current agreements, eventually the Realm constructor too.
212
+ // 'Realm',
213
+ };
214
+
215
+ // All the "subclasses" of Error. These are collectively represented in the
216
+ // ECMAScript spec by the meta variable NativeError.
217
+ /** @type {GenericErrorConstructor[]} */
218
+ const NativeErrors = [
219
+ EvalError,
220
+ RangeError,
221
+ ReferenceError,
222
+ SyntaxError,
223
+ TypeError,
224
+ URIError,
225
+ // https://github.com/endojs/endo/issues/550
226
+ // Commented out to accommodate platforms prior to AggregateError.
227
+ // Instead, conditional push below.
228
+ // AggregateError,
229
+ ];
230
+
231
+ if (typeof AggregateError !== 'undefined') {
232
+ // Conditional, to accommodate platforms prior to AggregateError
233
+ arrayPush(NativeErrors, AggregateError);
234
+ }
235
+
236
+ export { NativeErrors };
237
+
238
+ /**
239
+ * <p>Each JSON record enumerates the disposition of the properties on
240
+ * some corresponding intrinsic object.
241
+ *
242
+ * <p>All records are made of key-value pairs where the key
243
+ * is the property to process, and the value is the associated
244
+ * dispositions a.k.a. the "permit". Those permits can be:
245
+ * <ul>
246
+ * <li>The boolean value "false", in which case this property is
247
+ * blacklisted and simply removed. Properties not mentioned
248
+ * are also considered blacklisted and are removed.
249
+ * <li>A string value equal to a primitive ("number", "string", etc),
250
+ * in which case the property is permitted if its value property
251
+ * is typeof the given type. For example, {@code "Infinity"} leads to
252
+ * "number" and property values that fail {@code typeof "number"}.
253
+ * are removed.
254
+ * <li>A string value equal to an intinsic name ("ObjectPrototype",
255
+ * "Array", etc), in which case the property permitted if its
256
+ * value property is equal to the value of the corresponfing
257
+ * intrinsics. For example, {@code Map.prototype} leads to
258
+ * "MapPrototype" and the property is removed if its value is
259
+ * not equal to %MapPrototype%
260
+ * <li>Another record, in which case this property is simply
261
+ * permitted and that next record represents the disposition of
262
+ * the object which is its value. For example, {@code "Object"}
263
+ * leads to another record explaining what properties {@code
264
+ * "Object"} may have and how each such property should be treated.
265
+ *
266
+ * <p>Notes:
267
+ * <li>"[[Proto]]" is used to refer to the "[[Prototype]]" internal
268
+ * slot, which says which object this object inherits from.
269
+ * <li>"--proto--" is used to refer to the "__proto__" property name,
270
+ * which is the name of an accessor property on Object.prototype.
271
+ * In practice, it is used to access the [[Proto]] internal slot,
272
+ * but is distinct from the internal slot itself. We use
273
+ * "--proto--" rather than "__proto__" below because "__proto__"
274
+ * in an object literal is special syntax rather than a normal
275
+ * property definition.
276
+ * <li>"ObjectPrototype" is the default "[[Proto]]" (when not specified).
277
+ * <li>Constants "fn" and "getter" are used to keep the structure DRY.
278
+ * <li>Symbol properties are listed as follow:
279
+ * <li>Well-known symbols use the "@@name" form.
280
+ * <li>Registered symbols use the "RegisteredSymbol(key)" form.
281
+ * <li>Unique symbols use the "UniqueSymbol(description)" form.
282
+ */
283
+
284
+ // Function Instances
285
+ export const FunctionInstance = {
286
+ '[[Proto]]': '%FunctionPrototype%',
287
+ length: 'number',
288
+ name: 'string',
289
+ // Do not specify "prototype" here, since only Function instances that can
290
+ // be used as a constructor have a prototype property. For constructors,
291
+ // since prototype properties are instance-specific, we define it there.
292
+ };
293
+
294
+ // AsyncFunction Instances
295
+ export const AsyncFunctionInstance = {
296
+ // This property is not mentioned in ECMA 262, but is present in V8 and
297
+ // necessary for lockdown to succeed.
298
+ '[[Proto]]': '%AsyncFunctionPrototype%',
299
+ };
300
+
301
+ // Aliases
302
+ const fn = FunctionInstance;
303
+ const asyncFn = AsyncFunctionInstance;
304
+
305
+ const getter = {
306
+ get: fn,
307
+ set: 'undefined',
308
+ };
309
+
310
+ // Possible but not encountered in the specs
311
+ // export const setter = {
312
+ // get: 'undefined',
313
+ // set: fn,
314
+ // };
315
+
316
+ const accessor = {
317
+ get: fn,
318
+ set: fn,
319
+ };
320
+
321
+ // eslint-disable-next-line func-names
322
+ const strict = function () {
323
+ 'use strict';
324
+ };
325
+
326
+ // TODO Remove this once we no longer support the Hermes that needed this.
327
+ arrayForEach(['caller', 'arguments'], prop => {
328
+ try {
329
+ strict[prop];
330
+ } catch (e) {
331
+ // https://github.com/facebook/hermes/blob/main/test/hermes/function-non-strict.js
332
+ if (e.message === 'Restricted in strict mode') {
333
+ // Fixed in Static Hermes: https://github.com/facebook/hermes/issues/1582
334
+ FunctionInstance[prop] = accessor;
335
+ }
336
+ }
337
+ });
338
+
339
+ export const isAccessorPermit = permit => {
340
+ return permit === getter || permit === accessor;
341
+ };
342
+
343
+ // NativeError Object Structure
344
+ function NativeError(prototype) {
345
+ return {
346
+ // Properties of the NativeError Constructors
347
+ '[[Proto]]': '%SharedError%',
348
+
349
+ // NativeError.prototype
350
+ prototype,
351
+ };
352
+ }
353
+
354
+ function NativeErrorPrototype(constructor) {
355
+ return {
356
+ // Properties of the NativeError Prototype Objects
357
+ '[[Proto]]': '%ErrorPrototype%',
358
+ constructor,
359
+ message: 'string',
360
+ name: 'string',
361
+ // Redundantly present only on v8. Safe to remove.
362
+ toString: false,
363
+ // Superfluously present in some versions of V8.
364
+ // https://github.com/tc39/notes/blob/master/meetings/2021-10/oct-26.md#:~:text=However%2C%20Chrome%2093,and%20node%2016.11.
365
+ cause: false,
366
+ };
367
+ }
368
+
369
+ // The TypedArray Constructors
370
+ function TypedArray(prototype) {
371
+ return {
372
+ // Properties of the TypedArray Constructors
373
+ '[[Proto]]': '%TypedArray%',
374
+ BYTES_PER_ELEMENT: 'number',
375
+ prototype,
376
+ };
377
+ }
378
+
379
+ function TypedArrayPrototype(constructor) {
380
+ return {
381
+ // Properties of the TypedArray Prototype Objects
382
+ '[[Proto]]': '%TypedArrayPrototype%',
383
+ BYTES_PER_ELEMENT: 'number',
384
+ constructor,
385
+ };
386
+ }
387
+
388
+ // Without Math.random
389
+ const CommonMath = {
390
+ E: 'number',
391
+ LN10: 'number',
392
+ LN2: 'number',
393
+ LOG10E: 'number',
394
+ LOG2E: 'number',
395
+ PI: 'number',
396
+ SQRT1_2: 'number',
397
+ SQRT2: 'number',
398
+ '@@toStringTag': 'string',
399
+ abs: fn,
400
+ acos: fn,
401
+ acosh: fn,
402
+ asin: fn,
403
+ asinh: fn,
404
+ atan: fn,
405
+ atanh: fn,
406
+ atan2: fn,
407
+ cbrt: fn,
408
+ ceil: fn,
409
+ clz32: fn,
410
+ cos: fn,
411
+ cosh: fn,
412
+ exp: fn,
413
+ expm1: fn,
414
+ floor: fn,
415
+ fround: fn,
416
+ hypot: fn,
417
+ imul: fn,
418
+ log: fn,
419
+ log1p: fn,
420
+ log10: fn,
421
+ log2: fn,
422
+ max: fn,
423
+ min: fn,
424
+ pow: fn,
425
+ round: fn,
426
+ sign: fn,
427
+ sin: fn,
428
+ sinh: fn,
429
+ sqrt: fn,
430
+ tan: fn,
431
+ tanh: fn,
432
+ trunc: fn,
433
+ // https://github.com/tc39/proposal-float16array
434
+ f16round: fn,
435
+ // https://github.com/tc39/proposal-math-sum
436
+ sumPrecise: fn,
437
+
438
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
439
+ idiv: false,
440
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
441
+ idivmod: false,
442
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
443
+ imod: false,
444
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
445
+ imuldiv: false,
446
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
447
+ irem: false,
448
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
449
+ mod: false,
450
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523#issuecomment-1942904505
451
+ irandom: false,
452
+ };
453
+
454
+ export const permitted = {
455
+ // ECMA https://tc39.es/ecma262
456
+
457
+ // The intrinsics object has no prototype to avoid conflicts.
458
+ '[[Proto]]': null,
459
+
460
+ // %ThrowTypeError%
461
+ '%ThrowTypeError%': fn,
462
+
463
+ // *** The Global Object
464
+
465
+ // *** Value Properties of the Global Object
466
+ Infinity: 'number',
467
+ NaN: 'number',
468
+ undefined: 'undefined',
469
+
470
+ // *** Function Properties of the Global Object
471
+
472
+ // eval
473
+ '%UniqueEval%': fn,
474
+ isFinite: fn,
475
+ isNaN: fn,
476
+ parseFloat: fn,
477
+ parseInt: fn,
478
+ decodeURI: fn,
479
+ decodeURIComponent: fn,
480
+ encodeURI: fn,
481
+ encodeURIComponent: fn,
482
+
483
+ // *** Fundamental Objects
484
+
485
+ Object: {
486
+ // Properties of the Object Constructor
487
+ '[[Proto]]': '%FunctionPrototype%',
488
+ assign: fn,
489
+ create: fn,
490
+ defineProperties: fn,
491
+ defineProperty: fn,
492
+ entries: fn,
493
+ freeze: fn,
494
+ fromEntries: fn,
495
+ getOwnPropertyDescriptor: fn,
496
+ getOwnPropertyDescriptors: fn,
497
+ getOwnPropertyNames: fn,
498
+ getOwnPropertySymbols: fn,
499
+ getPrototypeOf: fn,
500
+ is: fn,
501
+ isExtensible: fn,
502
+ isFrozen: fn,
503
+ isSealed: fn,
504
+ keys: fn,
505
+ preventExtensions: fn,
506
+ prototype: '%ObjectPrototype%',
507
+ seal: fn,
508
+ setPrototypeOf: fn,
509
+ values: fn,
510
+ // https://github.com/tc39/proposal-accessible-object-hasownproperty
511
+ hasOwn: fn,
512
+ // https://github.com/tc39/proposal-array-grouping
513
+ groupBy: fn,
514
+ // Seen on QuickJS
515
+ __getClass: false,
516
+ },
517
+
518
+ '%ObjectPrototype%': {
519
+ // Properties of the Object Prototype Object
520
+ '[[Proto]]': null,
521
+ constructor: 'Object',
522
+ hasOwnProperty: fn,
523
+ isPrototypeOf: fn,
524
+ propertyIsEnumerable: fn,
525
+ toLocaleString: fn,
526
+ toString: fn,
527
+ valueOf: fn,
528
+
529
+ // Annex B: Additional Properties of the Object.prototype Object
530
+
531
+ // See note in header about the difference between [[Proto]] and --proto--
532
+ // special notations.
533
+ '--proto--': accessor,
534
+ __defineGetter__: fn,
535
+ __defineSetter__: fn,
536
+ __lookupGetter__: fn,
537
+ __lookupSetter__: fn,
538
+ },
539
+
540
+ '%UniqueFunction%': {
541
+ // Properties of the Function Constructor
542
+ '[[Proto]]': '%FunctionPrototype%',
543
+ prototype: '%FunctionPrototype%',
544
+ },
545
+
546
+ '%InertFunction%': {
547
+ '[[Proto]]': '%FunctionPrototype%',
548
+ prototype: '%FunctionPrototype%',
549
+ },
550
+
551
+ '%FunctionPrototype%': {
552
+ apply: fn,
553
+ bind: fn,
554
+ call: fn,
555
+ constructor: '%InertFunction%',
556
+ toString: fn,
557
+ '@@hasInstance': fn,
558
+ // proposed but not yet std. To be removed if there
559
+ caller: false,
560
+ // proposed but not yet std. To be removed if there
561
+ arguments: false,
562
+ // Seen on QuickJS. TODO grab getter for use by console
563
+ fileName: false,
564
+ // Seen on QuickJS. TODO grab getter for use by console
565
+ lineNumber: false,
566
+ },
567
+
568
+ Boolean: {
569
+ // Properties of the Boolean Constructor
570
+ '[[Proto]]': '%FunctionPrototype%',
571
+ prototype: '%BooleanPrototype%',
572
+ },
573
+
574
+ '%BooleanPrototype%': {
575
+ constructor: 'Boolean',
576
+ toString: fn,
577
+ valueOf: fn,
578
+ },
579
+
580
+ '%SharedSymbol%': {
581
+ // Properties of the Symbol Constructor
582
+ '[[Proto]]': '%FunctionPrototype%',
583
+ asyncIterator: 'symbol',
584
+ for: fn,
585
+ hasInstance: 'symbol',
586
+ isConcatSpreadable: 'symbol',
587
+ iterator: 'symbol',
588
+ keyFor: fn,
589
+ match: 'symbol',
590
+ matchAll: 'symbol',
591
+ prototype: '%SymbolPrototype%',
592
+ replace: 'symbol',
593
+ search: 'symbol',
594
+ species: 'symbol',
595
+ split: 'symbol',
596
+ toPrimitive: 'symbol',
597
+ toStringTag: 'symbol',
598
+ unscopables: 'symbol',
599
+ // https://github.com/tc39/proposal-explicit-resource-management
600
+ asyncDispose: 'symbol',
601
+ // https://github.com/tc39/proposal-explicit-resource-management
602
+ dispose: 'symbol',
603
+ // Seen at core-js https://github.com/zloirock/core-js#ecmascript-symbol
604
+ useSimple: false,
605
+ // Seen at core-js https://github.com/zloirock/core-js#ecmascript-symbol
606
+ useSetter: false,
607
+ // Seen on QuickJS
608
+ operatorSet: false,
609
+ },
610
+
611
+ '%SymbolPrototype%': {
612
+ // Properties of the Symbol Prototype Object
613
+ constructor: '%SharedSymbol%',
614
+ description: getter,
615
+ toString: fn,
616
+ valueOf: fn,
617
+ '@@toPrimitive': fn,
618
+ '@@toStringTag': 'string',
619
+ },
620
+
621
+ '%InitialError%': {
622
+ // Properties of the Error Constructor
623
+ '[[Proto]]': '%FunctionPrototype%',
624
+ prototype: '%ErrorPrototype%',
625
+ // Non standard, v8 only, used by tap
626
+ captureStackTrace: fn,
627
+ // Non standard, v8 only, used by tap, tamed to accessor
628
+ stackTraceLimit: accessor,
629
+ // Non standard, v8 only, used by several, tamed to accessor
630
+ prepareStackTrace: accessor,
631
+ // https://github.com/tc39/proposal-is-error
632
+ isError: fn,
633
+ },
634
+
635
+ '%SharedError%': {
636
+ // Properties of the Error Constructor
637
+ '[[Proto]]': '%FunctionPrototype%',
638
+ prototype: '%ErrorPrototype%',
639
+ // Non standard, v8 only, used by tap
640
+ captureStackTrace: fn,
641
+ // Non standard, v8 only, used by tap, tamed to accessor
642
+ stackTraceLimit: accessor,
643
+ // Non standard, v8 only, used by several, tamed to accessor
644
+ prepareStackTrace: accessor,
645
+ // https://github.com/tc39/proposal-is-error
646
+ isError: fn,
647
+ },
648
+
649
+ '%ErrorPrototype%': {
650
+ constructor: '%SharedError%',
651
+ message: 'string',
652
+ name: 'string',
653
+ toString: fn,
654
+ // proposed de-facto, assumed TODO
655
+ // Seen on FF Nightly 88.0a1
656
+ at: false,
657
+ // Seen on FF and XS
658
+ stack: accessor,
659
+ // Superfluously present in some versions of V8.
660
+ // https://github.com/tc39/notes/blob/master/meetings/2021-10/oct-26.md#:~:text=However%2C%20Chrome%2093,and%20node%2016.11.
661
+ cause: false,
662
+ },
663
+
664
+ // NativeError
665
+
666
+ EvalError: NativeError('%EvalErrorPrototype%'),
667
+ RangeError: NativeError('%RangeErrorPrototype%'),
668
+ ReferenceError: NativeError('%ReferenceErrorPrototype%'),
669
+ SyntaxError: NativeError('%SyntaxErrorPrototype%'),
670
+ TypeError: NativeError('%TypeErrorPrototype%'),
671
+ URIError: NativeError('%URIErrorPrototype%'),
672
+ // https://github.com/endojs/endo/issues/550
673
+ AggregateError: NativeError('%AggregateErrorPrototype%'),
674
+
675
+ // TODO SuppressedError
676
+ // https://github.com/tc39/proposal-explicit-resource-management
677
+ // SuppressedError: NativeError('%SuppressedErrorPrototype%'),
678
+
679
+ '%EvalErrorPrototype%': NativeErrorPrototype('EvalError'),
680
+ '%RangeErrorPrototype%': NativeErrorPrototype('RangeError'),
681
+ '%ReferenceErrorPrototype%': NativeErrorPrototype('ReferenceError'),
682
+ '%SyntaxErrorPrototype%': NativeErrorPrototype('SyntaxError'),
683
+ '%TypeErrorPrototype%': NativeErrorPrototype('TypeError'),
684
+ '%URIErrorPrototype%': NativeErrorPrototype('URIError'),
685
+ // https://github.com/endojs/endo/issues/550
686
+ '%AggregateErrorPrototype%': NativeErrorPrototype('AggregateError'),
687
+ // TODO AggregateError .errors
688
+
689
+ // TODO SuppressedError
690
+ // https://github.com/tc39/proposal-explicit-resource-management
691
+ // '%SuppressedErrorPrototype%': NativeErrorPrototype('SuppressedError'),
692
+ // TODO SuppressedError .error
693
+ // TODO SuppressedError .suppressed
694
+
695
+ // *** Numbers and Dates
696
+
697
+ Number: {
698
+ // Properties of the Number Constructor
699
+ '[[Proto]]': '%FunctionPrototype%',
700
+ EPSILON: 'number',
701
+ isFinite: fn,
702
+ isInteger: fn,
703
+ isNaN: fn,
704
+ isSafeInteger: fn,
705
+ MAX_SAFE_INTEGER: 'number',
706
+ MAX_VALUE: 'number',
707
+ MIN_SAFE_INTEGER: 'number',
708
+ MIN_VALUE: 'number',
709
+ NaN: 'number',
710
+ NEGATIVE_INFINITY: 'number',
711
+ parseFloat: fn,
712
+ parseInt: fn,
713
+ POSITIVE_INFINITY: 'number',
714
+ prototype: '%NumberPrototype%',
715
+ },
716
+
717
+ '%NumberPrototype%': {
718
+ // Properties of the Number Prototype Object
719
+ constructor: 'Number',
720
+ toExponential: fn,
721
+ toFixed: fn,
722
+ toLocaleString: fn,
723
+ toPrecision: fn,
724
+ toString: fn,
725
+ valueOf: fn,
726
+ },
727
+
728
+ BigInt: {
729
+ // Properties of the BigInt Constructor
730
+ '[[Proto]]': '%FunctionPrototype%',
731
+ asIntN: fn,
732
+ asUintN: fn,
733
+ prototype: '%BigIntPrototype%',
734
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
735
+ bitLength: false,
736
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
737
+ fromArrayBuffer: false,
738
+ // Seen on QuickJS
739
+ tdiv: false,
740
+ // Seen on QuickJS
741
+ fdiv: false,
742
+ // Seen on QuickJS
743
+ cdiv: false,
744
+ // Seen on QuickJS
745
+ ediv: false,
746
+ // Seen on QuickJS
747
+ tdivrem: false,
748
+ // Seen on QuickJS
749
+ fdivrem: false,
750
+ // Seen on QuickJS
751
+ cdivrem: false,
752
+ // Seen on QuickJS
753
+ edivrem: false,
754
+ // Seen on QuickJS
755
+ sqrt: false,
756
+ // Seen on QuickJS
757
+ sqrtrem: false,
758
+ // Seen on QuickJS
759
+ floorLog2: false,
760
+ // Seen on QuickJS
761
+ ctz: false,
762
+ },
763
+
764
+ '%BigIntPrototype%': {
765
+ constructor: 'BigInt',
766
+ toLocaleString: fn,
767
+ toString: fn,
768
+ valueOf: fn,
769
+ '@@toStringTag': 'string',
770
+ },
771
+
772
+ '%InitialMath%': {
773
+ ...CommonMath,
774
+ // `%InitialMath%.random()` has the standard unsafe behavior
775
+ random: fn,
776
+ },
777
+
778
+ '%SharedMath%': {
779
+ ...CommonMath,
780
+ // `%SharedMath%.random()` is tamed to always throw
781
+ random: fn,
782
+ },
783
+
784
+ '%InitialDate%': {
785
+ // Properties of the Date Constructor
786
+ '[[Proto]]': '%FunctionPrototype%',
787
+ now: fn,
788
+ parse: fn,
789
+ prototype: '%DatePrototype%',
790
+ UTC: fn,
791
+ },
792
+
793
+ '%SharedDate%': {
794
+ // Properties of the Date Constructor
795
+ '[[Proto]]': '%FunctionPrototype%',
796
+ // `%SharedDate%.now()` is tamed to always throw
797
+ now: fn,
798
+ parse: fn,
799
+ prototype: '%DatePrototype%',
800
+ UTC: fn,
801
+ },
802
+
803
+ '%DatePrototype%': {
804
+ constructor: '%SharedDate%',
805
+ getDate: fn,
806
+ getDay: fn,
807
+ getFullYear: fn,
808
+ getHours: fn,
809
+ getMilliseconds: fn,
810
+ getMinutes: fn,
811
+ getMonth: fn,
812
+ getSeconds: fn,
813
+ getTime: fn,
814
+ getTimezoneOffset: fn,
815
+ getUTCDate: fn,
816
+ getUTCDay: fn,
817
+ getUTCFullYear: fn,
818
+ getUTCHours: fn,
819
+ getUTCMilliseconds: fn,
820
+ getUTCMinutes: fn,
821
+ getUTCMonth: fn,
822
+ getUTCSeconds: fn,
823
+ setDate: fn,
824
+ setFullYear: fn,
825
+ setHours: fn,
826
+ setMilliseconds: fn,
827
+ setMinutes: fn,
828
+ setMonth: fn,
829
+ setSeconds: fn,
830
+ setTime: fn,
831
+ setUTCDate: fn,
832
+ setUTCFullYear: fn,
833
+ setUTCHours: fn,
834
+ setUTCMilliseconds: fn,
835
+ setUTCMinutes: fn,
836
+ setUTCMonth: fn,
837
+ setUTCSeconds: fn,
838
+ toDateString: fn,
839
+ toISOString: fn,
840
+ toJSON: fn,
841
+ toLocaleDateString: fn,
842
+ toLocaleString: fn,
843
+ toLocaleTimeString: fn,
844
+ toString: fn,
845
+ toTimeString: fn,
846
+ toUTCString: fn,
847
+ valueOf: fn,
848
+ '@@toPrimitive': fn,
849
+
850
+ // Annex B: Additional Properties of the Date.prototype Object
851
+ getYear: fn,
852
+ setYear: fn,
853
+ toGMTString: fn,
854
+ },
855
+
856
+ // Text Processing
857
+
858
+ String: {
859
+ // Properties of the String Constructor
860
+ '[[Proto]]': '%FunctionPrototype%',
861
+ fromCharCode: fn,
862
+ fromCodePoint: fn,
863
+ prototype: '%StringPrototype%',
864
+ raw: fn,
865
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
866
+ fromArrayBuffer: false,
867
+ },
868
+
869
+ '%StringPrototype%': {
870
+ // Properties of the String Prototype Object
871
+ length: 'number',
872
+ charAt: fn,
873
+ charCodeAt: fn,
874
+ codePointAt: fn,
875
+ concat: fn,
876
+ constructor: 'String',
877
+ endsWith: fn,
878
+ includes: fn,
879
+ indexOf: fn,
880
+ lastIndexOf: fn,
881
+ localeCompare: fn,
882
+ match: fn,
883
+ matchAll: fn,
884
+ normalize: fn,
885
+ padEnd: fn,
886
+ padStart: fn,
887
+ repeat: fn,
888
+ replace: fn,
889
+ replaceAll: fn, // ES2021
890
+ search: fn,
891
+ slice: fn,
892
+ split: fn,
893
+ startsWith: fn,
894
+ substring: fn,
895
+ toLocaleLowerCase: fn,
896
+ toLocaleUpperCase: fn,
897
+ toLowerCase: fn,
898
+ toString: fn,
899
+ toUpperCase: fn,
900
+ trim: fn,
901
+ trimEnd: fn,
902
+ trimStart: fn,
903
+ valueOf: fn,
904
+ '@@iterator': fn,
905
+ // Failed tc39 proposal
906
+ // https://github.com/tc39/proposal-relative-indexing-method
907
+ at: fn,
908
+ // https://github.com/tc39/proposal-is-usv-string
909
+ isWellFormed: fn,
910
+ toWellFormed: fn,
911
+ unicodeSets: fn,
912
+
913
+ // Annex B: Additional Properties of the String.prototype Object
914
+ substr: fn,
915
+ anchor: fn,
916
+ big: fn,
917
+ blink: fn,
918
+ bold: fn,
919
+ fixed: fn,
920
+ fontcolor: fn,
921
+ fontsize: fn,
922
+ italics: fn,
923
+ link: fn,
924
+ small: fn,
925
+ strike: fn,
926
+ sub: fn,
927
+ sup: fn,
928
+ trimLeft: fn,
929
+ trimRight: fn,
930
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
931
+ compare: false,
932
+ // Seen on QuickJS
933
+ __quote: false,
934
+ },
935
+
936
+ '%StringIteratorPrototype%': {
937
+ '[[Proto]]': '%IteratorPrototype%',
938
+ next: fn,
939
+ '@@toStringTag': 'string',
940
+ },
941
+
942
+ '%InitialRegExp%': {
943
+ // Properties of the RegExp Constructor
944
+ '[[Proto]]': '%FunctionPrototype%',
945
+ prototype: '%RegExpPrototype%',
946
+ '@@species': getter,
947
+ // https://github.com/tc39/proposal-regex-escaping
948
+ escape: fn,
949
+
950
+ // The https://github.com/tc39/proposal-regexp-legacy-features
951
+ // are all optional, unsafe, and omitted
952
+ input: false,
953
+ $_: false,
954
+ lastMatch: false,
955
+ '$&': false,
956
+ lastParen: false,
957
+ '$+': false,
958
+ leftContext: false,
959
+ '$`': false,
960
+ rightContext: false,
961
+ "$'": false,
962
+ $1: false,
963
+ $2: false,
964
+ $3: false,
965
+ $4: false,
966
+ $5: false,
967
+ $6: false,
968
+ $7: false,
969
+ $8: false,
970
+ $9: false,
971
+ },
972
+
973
+ '%SharedRegExp%': {
974
+ // Properties of the RegExp Constructor
975
+ '[[Proto]]': '%FunctionPrototype%',
976
+ prototype: '%RegExpPrototype%',
977
+ '@@species': getter,
978
+ // https://github.com/tc39/proposal-regex-escaping
979
+ escape: fn,
980
+ },
981
+
982
+ '%RegExpPrototype%': {
983
+ // Properties of the RegExp Prototype Object
984
+ constructor: '%SharedRegExp%',
985
+ exec: fn,
986
+ dotAll: getter,
987
+ flags: getter,
988
+ global: getter,
989
+ hasIndices: getter,
990
+ ignoreCase: getter,
991
+ '@@match': fn,
992
+ '@@matchAll': fn,
993
+ multiline: getter,
994
+ '@@replace': fn,
995
+ '@@search': fn,
996
+ source: getter,
997
+ '@@split': fn,
998
+ sticky: getter,
999
+ test: fn,
1000
+ toString: fn,
1001
+ unicode: getter,
1002
+ unicodeSets: getter,
1003
+
1004
+ // Annex B: Additional Properties of the RegExp.prototype Object
1005
+ compile: false, // UNSAFE and suppressed.
1006
+ },
1007
+
1008
+ '%RegExpStringIteratorPrototype%': {
1009
+ // The %RegExpStringIteratorPrototype% Object
1010
+ '[[Proto]]': '%IteratorPrototype%',
1011
+ next: fn,
1012
+ '@@toStringTag': 'string',
1013
+ },
1014
+
1015
+ // Indexed Collections
1016
+
1017
+ Array: {
1018
+ // Properties of the Array Constructor
1019
+ '[[Proto]]': '%FunctionPrototype%',
1020
+ from: fn,
1021
+ isArray: fn,
1022
+ of: fn,
1023
+ prototype: '%ArrayPrototype%',
1024
+ '@@species': getter,
1025
+
1026
+ // Failed tc39 proposal
1027
+ // https://tc39.es/proposal-relative-indexing-method/
1028
+ at: fn,
1029
+ // https://tc39.es/proposal-array-from-async/
1030
+ fromAsync: fn,
1031
+ },
1032
+
1033
+ '%ArrayPrototype%': {
1034
+ // Properties of the Array Prototype Object
1035
+ length: 'number',
1036
+ concat: fn,
1037
+ constructor: 'Array',
1038
+ copyWithin: fn,
1039
+ entries: fn,
1040
+ every: fn,
1041
+ fill: fn,
1042
+ filter: fn,
1043
+ find: fn,
1044
+ findIndex: fn,
1045
+ flat: fn,
1046
+ flatMap: fn,
1047
+ forEach: fn,
1048
+ includes: fn,
1049
+ indexOf: fn,
1050
+ join: fn,
1051
+ keys: fn,
1052
+ lastIndexOf: fn,
1053
+ map: fn,
1054
+ pop: fn,
1055
+ push: fn,
1056
+ reduce: fn,
1057
+ reduceRight: fn,
1058
+ reverse: fn,
1059
+ shift: fn,
1060
+ slice: fn,
1061
+ some: fn,
1062
+ sort: fn,
1063
+ splice: fn,
1064
+ toLocaleString: fn,
1065
+ toString: fn,
1066
+ unshift: fn,
1067
+ values: fn,
1068
+ '@@iterator': fn,
1069
+ '@@unscopables': {
1070
+ '[[Proto]]': null,
1071
+ copyWithin: 'boolean',
1072
+ entries: 'boolean',
1073
+ fill: 'boolean',
1074
+ find: 'boolean',
1075
+ findIndex: 'boolean',
1076
+ flat: 'boolean',
1077
+ flatMap: 'boolean',
1078
+ includes: 'boolean',
1079
+ keys: 'boolean',
1080
+ values: 'boolean',
1081
+ // Failed tc39 proposal
1082
+ // https://tc39.es/proposal-relative-indexing-method/
1083
+ // Seen on FF Nightly 88.0a1
1084
+ at: 'boolean',
1085
+ // See https://github.com/tc39/proposal-array-find-from-last
1086
+ findLast: 'boolean',
1087
+ findLastIndex: 'boolean',
1088
+ // https://github.com/tc39/proposal-change-array-by-copy
1089
+ toReversed: 'boolean',
1090
+ toSorted: 'boolean',
1091
+ toSpliced: 'boolean',
1092
+ with: 'boolean',
1093
+ // https://github.com/tc39/proposal-array-grouping
1094
+ group: 'boolean',
1095
+ groupToMap: 'boolean',
1096
+ groupBy: 'boolean',
1097
+ },
1098
+ // See https://github.com/tc39/proposal-array-find-from-last
1099
+ findLast: fn,
1100
+ findLastIndex: fn,
1101
+ // https://github.com/tc39/proposal-change-array-by-copy
1102
+ toReversed: fn,
1103
+ toSorted: fn,
1104
+ toSpliced: fn,
1105
+ with: fn,
1106
+ // https://github.com/tc39/proposal-array-grouping
1107
+ group: fn, // Not in proposal? Where?
1108
+ groupToMap: fn, // Not in proposal? Where?
1109
+ groupBy: fn,
1110
+ // Failed tc39 proposal
1111
+ // https://tc39.es/proposal-relative-indexing-method/
1112
+ at: fn,
1113
+ },
1114
+
1115
+ '%ArrayIteratorPrototype%': {
1116
+ // The %ArrayIteratorPrototype% Object
1117
+ '[[Proto]]': '%IteratorPrototype%',
1118
+ next: fn,
1119
+ '@@toStringTag': 'string',
1120
+ },
1121
+
1122
+ // *** TypedArray Objects
1123
+
1124
+ '%TypedArray%': {
1125
+ // Properties of the %TypedArray% Intrinsic Object
1126
+ '[[Proto]]': '%FunctionPrototype%',
1127
+ from: fn,
1128
+ of: fn,
1129
+ prototype: '%TypedArrayPrototype%',
1130
+ '@@species': getter,
1131
+ },
1132
+
1133
+ '%TypedArrayPrototype%': {
1134
+ buffer: getter,
1135
+ byteLength: getter,
1136
+ byteOffset: getter,
1137
+ constructor: '%TypedArray%',
1138
+ copyWithin: fn,
1139
+ entries: fn,
1140
+ every: fn,
1141
+ fill: fn,
1142
+ filter: fn,
1143
+ find: fn,
1144
+ findIndex: fn,
1145
+ forEach: fn,
1146
+ includes: fn,
1147
+ indexOf: fn,
1148
+ join: fn,
1149
+ keys: fn,
1150
+ lastIndexOf: fn,
1151
+ length: getter,
1152
+ map: fn,
1153
+ reduce: fn,
1154
+ reduceRight: fn,
1155
+ reverse: fn,
1156
+ set: fn,
1157
+ slice: fn,
1158
+ some: fn,
1159
+ sort: fn,
1160
+ subarray: fn,
1161
+ toLocaleString: fn,
1162
+ toString: fn,
1163
+ values: fn,
1164
+ '@@iterator': fn,
1165
+ '@@toStringTag': getter,
1166
+ // Failed tc39 proposal
1167
+ // https://tc39.es/proposal-relative-indexing-method/
1168
+ at: fn,
1169
+ // See https://github.com/tc39/proposal-array-find-from-last
1170
+ findLast: fn,
1171
+ findLastIndex: fn,
1172
+ // https://github.com/tc39/proposal-change-array-by-copy
1173
+ toReversed: fn,
1174
+ toSorted: fn,
1175
+ with: fn,
1176
+ },
1177
+
1178
+ // The TypedArray Constructors
1179
+
1180
+ BigInt64Array: TypedArray('%BigInt64ArrayPrototype%'),
1181
+ BigUint64Array: TypedArray('%BigUint64ArrayPrototype%'),
1182
+ // https://github.com/tc39/proposal-float16array
1183
+ Float16Array: TypedArray('%Float16ArrayPrototype%'),
1184
+ Float32Array: TypedArray('%Float32ArrayPrototype%'),
1185
+ Float64Array: TypedArray('%Float64ArrayPrototype%'),
1186
+ Int16Array: TypedArray('%Int16ArrayPrototype%'),
1187
+ Int32Array: TypedArray('%Int32ArrayPrototype%'),
1188
+ Int8Array: TypedArray('%Int8ArrayPrototype%'),
1189
+ Uint16Array: TypedArray('%Uint16ArrayPrototype%'),
1190
+ Uint32Array: TypedArray('%Uint32ArrayPrototype%'),
1191
+ Uint8ClampedArray: TypedArray('%Uint8ClampedArrayPrototype%'),
1192
+ Uint8Array: {
1193
+ ...TypedArray('%Uint8ArrayPrototype%'),
1194
+ // https://github.com/tc39/proposal-arraybuffer-base64
1195
+ fromBase64: fn,
1196
+ // https://github.com/tc39/proposal-arraybuffer-base64
1197
+ fromHex: fn,
1198
+ },
1199
+
1200
+ '%BigInt64ArrayPrototype%': TypedArrayPrototype('BigInt64Array'),
1201
+ '%BigUint64ArrayPrototype%': TypedArrayPrototype('BigUint64Array'),
1202
+ // https://github.com/tc39/proposal-float16array
1203
+ '%Float16ArrayPrototype%': TypedArrayPrototype('Float16Array'),
1204
+ '%Float32ArrayPrototype%': TypedArrayPrototype('Float32Array'),
1205
+ '%Float64ArrayPrototype%': TypedArrayPrototype('Float64Array'),
1206
+ '%Int16ArrayPrototype%': TypedArrayPrototype('Int16Array'),
1207
+ '%Int32ArrayPrototype%': TypedArrayPrototype('Int32Array'),
1208
+ '%Int8ArrayPrototype%': TypedArrayPrototype('Int8Array'),
1209
+ '%Uint16ArrayPrototype%': TypedArrayPrototype('Uint16Array'),
1210
+ '%Uint32ArrayPrototype%': TypedArrayPrototype('Uint32Array'),
1211
+ '%Uint8ClampedArrayPrototype%': TypedArrayPrototype('Uint8ClampedArray'),
1212
+ '%Uint8ArrayPrototype%': {
1213
+ ...TypedArrayPrototype('Uint8Array'),
1214
+ // https://github.com/tc39/proposal-arraybuffer-base64
1215
+ setFromBase64: fn,
1216
+ // https://github.com/tc39/proposal-arraybuffer-base64
1217
+ setFromHex: fn,
1218
+ // https://github.com/tc39/proposal-arraybuffer-base64
1219
+ toBase64: fn,
1220
+ // https://github.com/tc39/proposal-arraybuffer-base64
1221
+ toHex: fn,
1222
+ },
1223
+
1224
+ // *** Keyed Collections
1225
+
1226
+ Map: {
1227
+ // Properties of the Map Constructor
1228
+ '[[Proto]]': '%FunctionPrototype%',
1229
+ '@@species': getter,
1230
+ prototype: '%MapPrototype%',
1231
+ // https://github.com/tc39/proposal-array-grouping
1232
+ groupBy: fn,
1233
+ },
1234
+
1235
+ '%MapPrototype%': {
1236
+ clear: fn,
1237
+ constructor: 'Map',
1238
+ delete: fn,
1239
+ entries: fn,
1240
+ forEach: fn,
1241
+ get: fn,
1242
+ has: fn,
1243
+ keys: fn,
1244
+ set: fn,
1245
+ size: getter,
1246
+ values: fn,
1247
+ '@@iterator': fn,
1248
+ '@@toStringTag': 'string',
1249
+ },
1250
+
1251
+ '%MapIteratorPrototype%': {
1252
+ // The %MapIteratorPrototype% Object
1253
+ '[[Proto]]': '%IteratorPrototype%',
1254
+ next: fn,
1255
+ '@@toStringTag': 'string',
1256
+ },
1257
+
1258
+ Set: {
1259
+ // Properties of the Set Constructor
1260
+ '[[Proto]]': '%FunctionPrototype%',
1261
+ prototype: '%SetPrototype%',
1262
+ '@@species': getter,
1263
+ // Seen on QuickJS
1264
+ groupBy: false,
1265
+ },
1266
+
1267
+ '%SetPrototype%': {
1268
+ add: fn,
1269
+ clear: fn,
1270
+ constructor: 'Set',
1271
+ delete: fn,
1272
+ entries: fn,
1273
+ forEach: fn,
1274
+ has: fn,
1275
+ keys: fn,
1276
+ size: getter,
1277
+ values: fn,
1278
+ '@@iterator': fn,
1279
+ '@@toStringTag': 'string',
1280
+ // See https://github.com/tc39/proposal-set-methods
1281
+ intersection: fn,
1282
+ // See https://github.com/tc39/proposal-set-methods
1283
+ union: fn,
1284
+ // See https://github.com/tc39/proposal-set-methods
1285
+ difference: fn,
1286
+ // See https://github.com/tc39/proposal-set-methods
1287
+ symmetricDifference: fn,
1288
+ // See https://github.com/tc39/proposal-set-methods
1289
+ isSubsetOf: fn,
1290
+ // See https://github.com/tc39/proposal-set-methods
1291
+ isSupersetOf: fn,
1292
+ // See https://github.com/tc39/proposal-set-methods
1293
+ isDisjointFrom: fn,
1294
+ },
1295
+
1296
+ '%SetIteratorPrototype%': {
1297
+ // The %SetIteratorPrototype% Object
1298
+ '[[Proto]]': '%IteratorPrototype%',
1299
+ next: fn,
1300
+ '@@toStringTag': 'string',
1301
+ },
1302
+
1303
+ WeakMap: {
1304
+ // Properties of the WeakMap Constructor
1305
+ '[[Proto]]': '%FunctionPrototype%',
1306
+ prototype: '%WeakMapPrototype%',
1307
+ },
1308
+
1309
+ '%WeakMapPrototype%': {
1310
+ constructor: 'WeakMap',
1311
+ delete: fn,
1312
+ get: fn,
1313
+ has: fn,
1314
+ set: fn,
1315
+ '@@toStringTag': 'string',
1316
+ },
1317
+
1318
+ WeakSet: {
1319
+ // Properties of the WeakSet Constructor
1320
+ '[[Proto]]': '%FunctionPrototype%',
1321
+ prototype: '%WeakSetPrototype%',
1322
+ },
1323
+
1324
+ '%WeakSetPrototype%': {
1325
+ add: fn,
1326
+ constructor: 'WeakSet',
1327
+ delete: fn,
1328
+ has: fn,
1329
+ '@@toStringTag': 'string',
1330
+ },
1331
+
1332
+ // *** Structured Data
1333
+
1334
+ ArrayBuffer: {
1335
+ // Properties of the ArrayBuffer Constructor
1336
+ '[[Proto]]': '%FunctionPrototype%',
1337
+ isView: fn,
1338
+ prototype: '%ArrayBufferPrototype%',
1339
+ '@@species': getter,
1340
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
1341
+ fromString: false,
1342
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
1343
+ fromBigInt: false,
1344
+ },
1345
+
1346
+ '%ArrayBufferPrototype%': {
1347
+ byteLength: getter,
1348
+ constructor: 'ArrayBuffer',
1349
+ slice: fn,
1350
+ '@@toStringTag': 'string',
1351
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523
1352
+ concat: false,
1353
+ // See https://github.com/tc39/proposal-resizablearraybuffer
1354
+ transfer: fn,
1355
+ resize: fn,
1356
+ resizable: getter,
1357
+ maxByteLength: getter,
1358
+ // https://github.com/tc39/proposal-arraybuffer-transfer
1359
+ transferToFixedLength: fn,
1360
+ detached: getter,
1361
+ // https://github.com/endojs/endo/pull/2309#issuecomment-2155513240
1362
+ // to be proposed
1363
+ transferToImmutable: fn,
1364
+ sliceToImmutable: fn,
1365
+ immutable: getter,
1366
+ },
1367
+
1368
+ // If this exists, it is purely an artifact of how we currently shim
1369
+ // `transferToImmutable`. As natively implemented, there would be no
1370
+ // such extra prototype.
1371
+ '%ImmutableArrayBufferPrototype%': {
1372
+ '[[Proto]]': '%ArrayBufferPrototype%',
1373
+ byteLength: getter,
1374
+ slice: fn,
1375
+ // See https://github.com/endojs/endo/tree/master/packages/immutable-arraybuffer#purposeful-violation
1376
+ '@@toStringTag': 'string',
1377
+ // See https://github.com/tc39/proposal-resizablearraybuffer
1378
+ transfer: fn,
1379
+ resize: fn,
1380
+ resizable: getter,
1381
+ maxByteLength: getter,
1382
+ // https://github.com/tc39/proposal-arraybuffer-transfer
1383
+ transferToFixedLength: fn,
1384
+ detached: getter,
1385
+ // https://github.com/endojs/endo/pull/2309#issuecomment-2155513240
1386
+ // to be proposed
1387
+ transferToImmutable: fn,
1388
+ sliceToImmutable: fn,
1389
+ immutable: getter,
1390
+ },
1391
+
1392
+ // SharedArrayBuffer Objects
1393
+ SharedArrayBuffer: false, // UNSAFE and purposely suppressed.
1394
+ '%SharedArrayBufferPrototype%': false, // UNSAFE and purposely suppressed.
1395
+
1396
+ DataView: {
1397
+ // Properties of the DataView Constructor
1398
+ '[[Proto]]': '%FunctionPrototype%',
1399
+ BYTES_PER_ELEMENT: 'number', // Non std but undeletable on Safari.
1400
+ prototype: '%DataViewPrototype%',
1401
+ },
1402
+
1403
+ '%DataViewPrototype%': {
1404
+ buffer: getter,
1405
+ byteLength: getter,
1406
+ byteOffset: getter,
1407
+ constructor: 'DataView',
1408
+ getBigInt64: fn,
1409
+ getBigUint64: fn,
1410
+ // https://github.com/tc39/proposal-float16array
1411
+ getFloat16: fn,
1412
+ getFloat32: fn,
1413
+ getFloat64: fn,
1414
+ getInt8: fn,
1415
+ getInt16: fn,
1416
+ getInt32: fn,
1417
+ getUint8: fn,
1418
+ getUint16: fn,
1419
+ getUint32: fn,
1420
+ setBigInt64: fn,
1421
+ setBigUint64: fn,
1422
+ // https://github.com/tc39/proposal-float16array
1423
+ setFloat16: fn,
1424
+ setFloat32: fn,
1425
+ setFloat64: fn,
1426
+ setInt8: fn,
1427
+ setInt16: fn,
1428
+ setInt32: fn,
1429
+ setUint8: fn,
1430
+ setUint16: fn,
1431
+ setUint32: fn,
1432
+ '@@toStringTag': 'string',
1433
+ },
1434
+
1435
+ // Atomics
1436
+ Atomics: false, // UNSAFE and suppressed.
1437
+
1438
+ JSON: {
1439
+ parse: fn,
1440
+ stringify: fn,
1441
+ '@@toStringTag': 'string',
1442
+ // https://github.com/tc39/proposal-json-parse-with-source/
1443
+ rawJSON: fn,
1444
+ isRawJSON: fn,
1445
+ },
1446
+
1447
+ // *** Control Abstraction Objects
1448
+
1449
+ // https://github.com/tc39/proposal-iterator-helpers
1450
+ Iterator: {
1451
+ // Properties of the Iterator Constructor
1452
+ '[[Proto]]': '%FunctionPrototype%',
1453
+ prototype: '%IteratorPrototype%',
1454
+ from: fn,
1455
+ // https://github.com/tc39/proposal-joint-iteration
1456
+ zip: fn,
1457
+ zipKeyed: fn,
1458
+ // https://github.com/tc39/proposal-iterator-sequencing
1459
+ concat: fn,
1460
+ },
1461
+
1462
+ '%IteratorPrototype%': {
1463
+ // The %IteratorPrototype% Object
1464
+ '@@iterator': fn,
1465
+ // https://github.com/tc39/proposal-iterator-helpers
1466
+ constructor: 'Iterator',
1467
+ map: fn,
1468
+ filter: fn,
1469
+ take: fn,
1470
+ drop: fn,
1471
+ flatMap: fn,
1472
+ reduce: fn,
1473
+ toArray: fn,
1474
+ forEach: fn,
1475
+ some: fn,
1476
+ every: fn,
1477
+ find: fn,
1478
+ '@@toStringTag': 'string',
1479
+ // https://github.com/tc39/proposal-async-iterator-helpers
1480
+ toAsync: fn,
1481
+ // https://github.com/tc39/proposal-explicit-resource-management
1482
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523#issuecomment-1942904505
1483
+ '@@dispose': false,
1484
+ },
1485
+
1486
+ // https://github.com/tc39/proposal-iterator-helpers
1487
+ '%WrapForValidIteratorPrototype%': {
1488
+ '[[Proto]]': '%IteratorPrototype%',
1489
+ next: fn,
1490
+ return: fn,
1491
+ },
1492
+
1493
+ // https://github.com/tc39/proposal-iterator-helpers
1494
+ '%IteratorHelperPrototype%': {
1495
+ '[[Proto]]': '%IteratorPrototype%',
1496
+ next: fn,
1497
+ return: fn,
1498
+ '@@toStringTag': 'string',
1499
+ },
1500
+
1501
+ // https://github.com/tc39/proposal-async-iterator-helpers
1502
+ AsyncIterator: {
1503
+ // Properties of the Iterator Constructor
1504
+ '[[Proto]]': '%FunctionPrototype%',
1505
+ prototype: '%AsyncIteratorPrototype%',
1506
+ from: fn,
1507
+ },
1508
+
1509
+ '%AsyncIteratorPrototype%': {
1510
+ // The %AsyncIteratorPrototype% Object
1511
+ '@@asyncIterator': fn,
1512
+ // https://github.com/tc39/proposal-async-iterator-helpers
1513
+ constructor: 'AsyncIterator',
1514
+ map: fn,
1515
+ filter: fn,
1516
+ take: fn,
1517
+ drop: fn,
1518
+ flatMap: fn,
1519
+ reduce: fn,
1520
+ toArray: fn,
1521
+ forEach: fn,
1522
+ some: fn,
1523
+ every: fn,
1524
+ find: fn,
1525
+ '@@toStringTag': 'string',
1526
+ // https://github.com/tc39/proposal-explicit-resource-management
1527
+ // See https://github.com/Moddable-OpenSource/moddable/issues/523#issuecomment-1942904505
1528
+ '@@asyncDispose': false,
1529
+ },
1530
+
1531
+ // https://github.com/tc39/proposal-async-iterator-helpers
1532
+ '%WrapForValidAsyncIteratorPrototype%': {
1533
+ '[[Proto]]': '%AsyncIteratorPrototype%',
1534
+ next: fn,
1535
+ return: fn,
1536
+ },
1537
+
1538
+ // https://github.com/tc39/proposal-async-iterator-helpers
1539
+ '%AsyncIteratorHelperPrototype%': {
1540
+ '[[Proto]]': '%AsyncIteratorPrototype%',
1541
+ next: fn,
1542
+ return: fn,
1543
+ '@@toStringTag': 'string',
1544
+ },
1545
+
1546
+ '%InertGeneratorFunction%': {
1547
+ // Properties of the GeneratorFunction Constructor
1548
+ '[[Proto]]': '%InertFunction%',
1549
+ prototype: '%Generator%',
1550
+ },
1551
+
1552
+ '%Generator%': {
1553
+ // Properties of the GeneratorFunction Prototype Object
1554
+ '[[Proto]]': '%FunctionPrototype%',
1555
+ constructor: '%InertGeneratorFunction%',
1556
+ prototype: '%GeneratorPrototype%',
1557
+ '@@toStringTag': 'string',
1558
+ },
1559
+
1560
+ '%InertAsyncGeneratorFunction%': {
1561
+ // Properties of the AsyncGeneratorFunction Constructor
1562
+ '[[Proto]]': '%InertFunction%',
1563
+ prototype: '%AsyncGenerator%',
1564
+ },
1565
+
1566
+ '%AsyncGenerator%': {
1567
+ // Properties of the AsyncGeneratorFunction Prototype Object
1568
+ '[[Proto]]': '%FunctionPrototype%',
1569
+ constructor: '%InertAsyncGeneratorFunction%',
1570
+ prototype: '%AsyncGeneratorPrototype%',
1571
+ // length prop added here for React Native jsc-android
1572
+ // https://github.com/endojs/endo/issues/660
1573
+ // https://github.com/react-native-community/jsc-android-buildscripts/issues/181
1574
+ length: 'number',
1575
+ '@@toStringTag': 'string',
1576
+ },
1577
+
1578
+ '%GeneratorPrototype%': {
1579
+ // Properties of the Generator Prototype Object
1580
+ '[[Proto]]': '%IteratorPrototype%',
1581
+ constructor: '%Generator%',
1582
+ next: fn,
1583
+ return: fn,
1584
+ throw: fn,
1585
+ '@@toStringTag': 'string',
1586
+ },
1587
+
1588
+ '%AsyncGeneratorPrototype%': {
1589
+ // Properties of the AsyncGenerator Prototype Object
1590
+ '[[Proto]]': '%AsyncIteratorPrototype%',
1591
+ constructor: '%AsyncGenerator%',
1592
+ next: fn,
1593
+ return: fn,
1594
+ throw: fn,
1595
+ '@@toStringTag': 'string',
1596
+ },
1597
+
1598
+ // TODO: To be replaced with Promise.delegate
1599
+ //
1600
+ // The HandledPromise global variable shimmed by `@agoric/eventual-send/shim`
1601
+ // implements an initial version of the eventual send specification at:
1602
+ // https://github.com/tc39/proposal-eventual-send
1603
+ //
1604
+ // We will likely change this to add a property to Promise called
1605
+ // Promise.delegate and put static methods on it, which will necessitate
1606
+ // another permits change to update to the current proposed standard.
1607
+ HandledPromise: {
1608
+ '[[Proto]]': 'Promise',
1609
+ applyFunction: fn,
1610
+ applyFunctionSendOnly: fn,
1611
+ applyMethod: fn,
1612
+ applyMethodSendOnly: fn,
1613
+ get: fn,
1614
+ getSendOnly: fn,
1615
+ prototype: '%PromisePrototype%',
1616
+ resolve: fn,
1617
+ },
1618
+
1619
+ // https://github.com/tc39/proposal-source-phase-imports?tab=readme-ov-file#js-module-source
1620
+
1621
+ ModuleSource: {
1622
+ '[[Proto]]': '%AbstractModuleSource%',
1623
+ prototype: '%ModuleSourcePrototype%',
1624
+ },
1625
+
1626
+ '%ModuleSourcePrototype%': {
1627
+ '[[Proto]]': '%AbstractModuleSourcePrototype%',
1628
+ constructor: 'ModuleSource',
1629
+ '@@toStringTag': 'string',
1630
+ // https://github.com/tc39/proposal-compartments
1631
+ bindings: getter,
1632
+ needsImport: getter,
1633
+ needsImportMeta: getter,
1634
+ // @endo/module-source provides a legacy interface
1635
+ imports: getter,
1636
+ exports: getter,
1637
+ reexports: getter,
1638
+ },
1639
+
1640
+ '%AbstractModuleSource%': {
1641
+ '[[Proto]]': '%FunctionPrototype%',
1642
+ prototype: '%AbstractModuleSourcePrototype%',
1643
+ },
1644
+
1645
+ '%AbstractModuleSourcePrototype%': {
1646
+ constructor: '%AbstractModuleSource%',
1647
+ },
1648
+
1649
+ Promise: {
1650
+ // Properties of the Promise Constructor
1651
+ '[[Proto]]': '%FunctionPrototype%',
1652
+ all: fn,
1653
+ allSettled: fn,
1654
+ // https://github.com/Agoric/SES-shim/issues/550
1655
+ any: fn,
1656
+ prototype: '%PromisePrototype%',
1657
+ race: fn,
1658
+ reject: fn,
1659
+ resolve: fn,
1660
+ // https://github.com/tc39/proposal-promise-with-resolvers
1661
+ withResolvers: fn,
1662
+ '@@species': getter,
1663
+ // https://github.com/tc39/proposal-promise-try
1664
+ try: fn,
1665
+ },
1666
+
1667
+ '%PromisePrototype%': {
1668
+ // Properties of the Promise Prototype Object
1669
+ catch: fn,
1670
+ constructor: 'Promise',
1671
+ finally: fn,
1672
+ then: fn,
1673
+ '@@toStringTag': 'string',
1674
+ // Non-standard, used in node to prevent async_hooks from breaking
1675
+ 'UniqueSymbol(async_id_symbol)': accessor,
1676
+ 'UniqueSymbol(trigger_async_id_symbol)': accessor,
1677
+ 'UniqueSymbol(destroyed)': accessor,
1678
+ },
1679
+
1680
+ '%InertAsyncFunction%': {
1681
+ // Properties of the AsyncFunction Constructor
1682
+ '[[Proto]]': '%InertFunction%',
1683
+ prototype: '%AsyncFunctionPrototype%',
1684
+ },
1685
+
1686
+ '%AsyncFunctionPrototype%': {
1687
+ // Properties of the AsyncFunction Prototype Object
1688
+ '[[Proto]]': '%FunctionPrototype%',
1689
+ constructor: '%InertAsyncFunction%',
1690
+ // length prop added here for React Native jsc-android
1691
+ // https://github.com/endojs/endo/issues/660
1692
+ // https://github.com/react-native-community/jsc-android-buildscripts/issues/181
1693
+ length: 'number',
1694
+ '@@toStringTag': 'string',
1695
+ },
1696
+
1697
+ // Reflection
1698
+
1699
+ Reflect: {
1700
+ // The Reflect Object
1701
+ // Not a function object.
1702
+ apply: fn,
1703
+ construct: fn,
1704
+ defineProperty: fn,
1705
+ deleteProperty: fn,
1706
+ get: fn,
1707
+ getOwnPropertyDescriptor: fn,
1708
+ getPrototypeOf: fn,
1709
+ has: fn,
1710
+ isExtensible: fn,
1711
+ ownKeys: fn,
1712
+ preventExtensions: fn,
1713
+ set: fn,
1714
+ setPrototypeOf: fn,
1715
+ '@@toStringTag': 'string',
1716
+ },
1717
+
1718
+ Proxy: {
1719
+ // Properties of the Proxy Constructor
1720
+ '[[Proto]]': '%FunctionPrototype%',
1721
+ revocable: fn,
1722
+ },
1723
+
1724
+ // Appendix B
1725
+
1726
+ // Annex B: Additional Properties of the Global Object
1727
+
1728
+ escape: fn,
1729
+ unescape: fn,
1730
+
1731
+ // Proposed
1732
+
1733
+ '%UniqueCompartment%': {
1734
+ '[[Proto]]': '%FunctionPrototype%',
1735
+ prototype: '%CompartmentPrototype%',
1736
+ toString: fn,
1737
+ },
1738
+
1739
+ '%InertCompartment%': {
1740
+ '[[Proto]]': '%FunctionPrototype%',
1741
+ prototype: '%CompartmentPrototype%',
1742
+ toString: fn,
1743
+ },
1744
+
1745
+ '%CompartmentPrototype%': {
1746
+ constructor: '%InertCompartment%',
1747
+ evaluate: fn,
1748
+ globalThis: getter,
1749
+ name: getter,
1750
+ import: asyncFn,
1751
+ load: asyncFn,
1752
+ importNow: fn,
1753
+ module: fn,
1754
+ '@@toStringTag': 'string',
1755
+ },
1756
+
1757
+ lockdown: fn,
1758
+ harden: { ...fn, isFake: 'boolean' },
1759
+
1760
+ '%InitialGetStackString%': fn,
1761
+ };