Object.seal, read references, and code reliability

T.J. Crowder tj.crowder at farsightsoftware.com
Tue Aug 15 15:38:55 UTC 2017


On Tue, Aug 15, 2017 at 4:10 PM, Alex Kodat <alexkodat at gmail.com> wrote:
>
> But, now that I think about it, we might Object.guard them as it
> would catch the occasional boo-boo where one forgets to put the
> () on a function call

How would `Object.guard` catch that? My understanding of your suggestion
was that reading a property from a "guarded" object that it didn't have
(`"propname" in obj` would be false) would throw. If you do `foo.bar` where
you meant `foo.bar()`, the `bar` property still exists on `foo`.

-- T.J. Crowder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170815/f0ea79ed/attachment.html>


More information about the es-discuss mailing list