Initial ECMA formated ES5 draft available

Jeff Walden jwalden+es at MIT.EDU
Tue Aug 25 12:31:33 PDT 2009


On 22.8.09 14:00 , Allen Wirfs-Brock wrote:
> 15.2.3.7 Object.defineProperties “atomic” processing clarified.

This still needs further clarification on how to address definition of properties on objects with custom [[DefineOwnProperty]] hooks, as earlier alluded to by David-Sarah Hopwood.  I think a restriction on what custom definitions of [[DefineOwnProperty]] may do is in order, so that atomicity can actually be implemented; I'm not sure what that restriction should be, precisely.  Simply saying [[DefineOwnProperty]] must not have side effects would directly contradict the JSClass.addProperty hook in SpiderMonkey by which property definitions may be "censored", such that the value that was set can be changed by the hook.  I don't know whether this is a problem inherent to any DOM properties, but I would be surprised if it isn't.  On the other hand, this hook supports arbitrary actions, which seem entirely out of the question as supportable.  (I'm considering an ex post facto restriction that the only immediately observable side effect must be a modification of the property's value

  
  as an immediate stopgap.  This would allow observable side effects after Object.defineProperties returns, but I care about this only insofar as it makes partial rollback impossible to implement, and this invalidates as little previously-permissible hook behavior as possible.)

In any case, featureful implementations which in one form or another support modification of the effective behavior of [[DefineOwnProperty]] can't really implement Object.defineProperties as currently written, not without violating the atomicity requirement or making assumptions about potential custom behaviors.

Jeff


More information about the es-discuss mailing list