endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
804 stars 71 forks source link

feat(pass-style): Safe promises can override @@toStringTag with a string #1785

Closed erights closed 12 months ago

erights commented 1 year ago

https://github.com/endojs/endo/pull/1781 demonstrates that the current endo (and it just so happens, the already-released endo) enables a passable promise to carry the string that @FUDCo needs to support testing. However, its way of carrying a string was terribly obtuse.

This PR implements part of the plan explained at https://github.com/endojs/endo/pull/1781#issuecomment-1727080735 . Specifically, to have passable promises follow the precedent of passable far objects and exos, which also allow them to override the inherited @@toStringTag property with an own data property carrying a string value. However, agoric-sdk would not be able to use this more pleasant way of carrying a string until it is upgraded to depend on an endo containing this PR.