On 6/17/14, 8:47 PM, Allen Wirfs-Brock wrote:
You mean, the already initialized checks which fall out of objects having
distinct allocation and initialization functions. Those checks only occur in
functions that directly access private internal state of built-in oibjects.
I should note that for typical "DOM" (not just nodes; pretty much every
non-ES-builtin in the web platform) this is every single function. And
that the current separation of allocation and initialization means that
for these objects we have the following choices (probably on a
per-object-class basis):
1) Make the object not subclassable.
2) Make the object subclassable and have WebIDL this value handling
perform some sort of "is initialized" checks.
3) Make the object subclassable and have specification prose for all
its methods/properties perform "is initialized" checks.
#1 is generally undersirable, #3 requires a level of understanding of ES
guts on the part of web spec authors that I suspect is not present and
might be hard to achieve (and in particular requires them to explicitly
opt in to making things subclassable).
Even #2 is a bit of a pain in terms of requiring extra work on every
single thing you do, which is not all that great from a performance
standpoint.
If we _can_ have a world in which web platform objects don't exist in
constructed-but-not-initialized states, I personally would much prefer
that....
-Boris
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss