An update on Object.observe

David Bruant bruant.d at
Tue Nov 3 13:58:17 UTC 2015


Le 03/11/2015 12:26, Alexander Jones a écrit :
> In my opinion, the fundamental record type we build our JS on should 
> be getting dumber, not smarter. It feels inappropriate to be piling 
> more difficult-to-reason-about mechanismson top before reeling in 
> exotic host objects.
JS objects were never only the record you're talking about. They were 
also used for OOP (used as dynamic this values if one property was a 
function and called after a dot).
And DOM objects also exposed things that did not have equivalent in ES 
objects (aside from the easy "host objects" escape), so the language 
needed to catch up (as it did in ES5) despite having to be more 
difficult to reason about.

Immutable data structures might be what you're looking for though

> With Proxy out of the bag, I'm not so hopeful for the humble Object 
> anymore.
This is a surprising statement. By exposing the low-level object API as 
userlang API (proxy traps + Reflect API), proxies make the low-level 
object API subject to the same backward-compat constraints as every 
other API.
If nothing else, the very existence of proxies puts an end to the 
evolution of the object model.


More information about the es-discuss mailing list