Closed michaelfig closed 5 years ago
Thanks for raising it. It's been in my head but not yet stated anywhere:
Make available, likely via imports from the SES module, makeMap
etc factory functions that wrap the corresponding constructors. These modules would be written in SES, not Jessie, but their exported factory functions are designed to be used from Jessie.
Besides working around Jessie's lack of new
, these functions would also freeze the instance, so that the instance can be shared without worry that someone will override one of the method names on the instance.
Separately, we're likely going to rename def
into harden
, so I'll use that below.
export const makeMap = harden((...args) => harden(new Map(...args)));
export const makeSet = harden((...args) => harden(new Set(...args)));
...
I am closing this issue in favour of #29.
Hi,
I was wondering how Jessie code is expected to use Maps/WeakMaps/Sets/WeakSets, given that there is no
new
operator?I would like to use these collections without freezing them. Is that possible in Jessie?
Thanks, Michael.