Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ses): Add HandledPromise to the whitelist #416

Merged
merged 4 commits into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/ses/NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ User-visible changes in SES:

## Next release

* No changes yet.
* Updates the whitelist to allow a `HandledPromise` global, which is provided
by `@agoric/eventual-send`, an early implementation of
https://github.com/tc39/proposal-eventual-send.

## Release 0.10.0 (8-August-2020)

Expand Down
22 changes: 22 additions & 0 deletions packages/ses/src/whitelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const universalPropertyNames = {

lockdown: 'lockdown',
harden: 'harden',
HandledPromise: 'HandledPromise', // TODO: Until Promise.delegate (see below).
StaticModuleRecord: 'StaticModuleRecord',
};

Expand Down Expand Up @@ -1644,6 +1645,27 @@ export const whitelist = {
'@@toStringTag': 'string',
},

// TODO: To be replaced with Promise.delegate
michaelfig marked this conversation as resolved.
Show resolved Hide resolved
//
// The HandledPromise global variable shimmed by `@agoric/eventual-send/shim`
// implements an initial version of the eventual send specification at:
// https://github.com/tc39/proposal-eventual-send
//
// We will likely change this to add a property to Promise called
// Promise.delegate and put static methods on it, which will necessitate
// another whitelist change to update to the current proposed standard.
HandledPromise: {
'[[Proto]]': 'Promise',
applyFunction: fn,
applyFunctionSendOnly: fn,
applyMethod: fn,
applyMethodSendOnly: fn,
get: fn,
getSendOnly: fn,
prototype: '%PromisePrototype%',
michaelfig marked this conversation as resolved.
Show resolved Hide resolved
resolve: fn,
},

Promise: {
// 25.6.4 Properties of the Promise Constructor
'[[Proto]]': '%FunctionPrototype%',
Expand Down