endojs / Jessie

Tiny subset of JavaScript for ocap-safe universal mobile code
Apache License 2.0
281 stars 16 forks source link

Allow object construction, maybe with `new` #22

Closed danfinlay closed 2 years ago

danfinlay commented 5 years ago

Per this twitter thread: https://twitter.com/marksammiller/status/1092866376006430720

I'm currently using Reflect.construct(class, arguments) as a workaround, but you mentioned this is also not valid Jessie, it merely happens to pass the Jessie linter.

dckc commented 5 years ago

To make this issue a bit more stand-alone without following the link: MarkM writes:

the original rationale is that new is only about prototype inheritance, classes, or class-like patterns. All of these are only meaningful with inherited methods that mention this. Thus, all of these are absent from Jessie.