Object.seal, read references, and code reliability
ljharb at gmail.com
Tue Aug 15 17:21:48 UTC 2017
An alternative suggestion to catch mistyped properties is "automated
tests", which hopefully you have anyways.
On Tue, Aug 15, 2017 at 8:38 AM, T.J. Crowder <
tj.crowder at farsightsoftware.com> wrote:
> 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