On 6/5/2014 4:08 PM, Rick Waldron wrote:
* `Object.deepPreventExtensions()`, `Object.deepSeal()`,
`Object.deepFreeze()` - deep versions of
`Object.preventExtensions()`, et al.
Does "deep" mean that a Map instance's [[MapData]] is frozen if
deepFreeze is called on a ? eg. what happens here:
var m = Object.deepFreeze(new Map());
m.set(1, 1);
In your blog it mentions the silent failure in non-strict mode, I
suspect that would still have to apply to these additions for semantic
consistency.
I wouldn't expect this to apply to [[MapData]] since those are not
enumerable own properties of the map instance.
* `Object.preventUndeclaredGet()` - change an object's behavior to
throw an error if you try to read from a property that doesn't
exist (instead of returning `undefine`).
This can be achieved with Proxy right, or is that too cumbersome?
It can be done with Proxy, but that kind of sucks because I always need
to go through the extra step of creating the Proxy for each object and
passing around the Proxy instead. To me, this is similar to setting a
property to be readonly in strict mode, except its writeonly (or rather,
write-first).
--
___________________________
Nicholas C. Zakas
http://www.nczonline.net
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss