options.transforms: forward to Realm.makeRootRealm
MODIFY
realms-shim
realms-shim
-Subproject commit 59b8c1eaf9ddeb625838ae64d7ece556826a201e
+Subproject commit 025d975da12c8033022c271e5d99a3810066dfa4

MODIFY
src/bundle/createSES.js
src/bundle/createSES.js
@@ -32,6 +32,8 @@ export function createSESWithRealmConstructor(creatorStrings, Realm) {
const shims = [];
const wl = JSON.parse(JSON.stringify(whitelist));
+ const { transforms, shims: optionalShims } = options;
+
// "allow" enables real Date.now(), anything else gets NaN
// (it'd be nice to allow a fixed numeric value, but too hard to
// implement right now)
@@ -85,7 +87,12 @@ export function createSESWithRealmConstructor(creatorStrings, Realm) {
(${removeProperties})(this, ${JSON.stringify(wl)})`;
shims.push(removeProp);
- const r = Realm.makeRootRealm({ shims });
+ // Add options.shims.
+ if (optionalShims) {
+ shims.push(...optionalShims);
+ }
+
+ const r = Realm.makeRootRealm({ shims, transforms });
// Build a harden() with an empty fringe. It will be populated later when
// we call harden(allIntrinsics).
@@ -112,7 +119,6 @@ export function createSESWithRealmConstructor(creatorStrings, Realm) {
// build the makeRequire helper, glue it to the new Realm
r.makeRequire = harden(r.evaluate(`(${makeMakeRequire})`)(r, harden));
-
return r;
}
const SES = {

MODIFY
src/bundle/whitelist.js
src/bundle/whitelist.js
@@ -757,23 +757,26 @@ export default {
race: j,
reject: j,
resolve: j,
+ makeHandled: t, // eventual-send
prototype: {
catch: t,
then: j,
finally: t, // proposed ES-Harmony
- // nanoq.js
+ // eventual-send
+ delete: t,
get: t,
put: t,
- del: t,
post: t,
invoke: t,
fapply: t,
fcall: t,
+ // nanoq.js
+ del: t,
+
// Temporary compat with the old makeQ.js
send: t,
- delete: t,
end: t,
},
},

options.transforms: forward to Realm.makeRootRealm