Object.seal, read references, and code reliability
alexkodat at gmail.com
Tue Aug 15 14:27:34 UTC 2017
Switching to my personal gmail account to reduce junk in the postings (sorry about that)...
My proposal was prompted by an internal discussion about using TypeScript. As you might guess I was opposed but the fact that there was no good way to catch typos in referencing properties on objects that had a well-defined set of properties was used against my position. Note that I'm not opposed to TypeScript, it’s just that adding an extra layer is not without its costs.
From: T.J. Crowder [mailto:tj.crowder at farsightsoftware.com]
Sent: Tuesday, August 15, 2017 1:12 AM
To: Alex Kodat <akodat at rocketsoftware.com>
Cc: es-discuss at mozilla.org
Subject: Re: Object.seal, read references, and code reliability
On Mon, Aug 14, 2017 at 5:32 PM, Alex Kodat <mailto:akodat at rocketsoftware.com> wrote:
> We’ve found Object.seal to be a huge aid in improving programmer
> productivity by catching coding errors early and preventing
> people from intentionally or unintentionally adding properties
> to objects outside the constructor.
Bob raised this but no one's actually said the name and you didn't mention it, so: If you haven't already, you might look into [TypeScript](http://typescriptlang.org), which does these things at compile time via type declarations (or with IDE support, even earlier). At least until/unless this idea goes somewhere. Your team seem to want the kind of constraints it puts on you.
-- T.J. Crowder
More information about the es-discuss