Object.seal, read references, and code reliability
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...
More information about the es-discuss