Experimental implementation of Object.observe & JS Utility library now available

Andrea Giammarchi andrea.giammarchi at gmail.com
Tue Aug 14 02:33:12 PDT 2012


just seen it, looks like an improved alternative to the good old, non
standard, Object.prototype.watch ... but

   1. records are not "struct like", properties might be or might not be
   there rather than being there with undefined values ... is this heading to
   not optimal performances in V8 and others?
   2. how is the memory consumption preserved with freshly new created
   record objects, rather than a single callback as entry point and simply
   oldValue, newValue passed as arguments?
   3. why the callback is not simply something like observer(type, object,
   property, oldValue, newValue) so that a single callback can be still
   recyclable and no object is created per each change, plus it's easier to
   retrieve the new value rather than passing through record.object[
   record.name] ?
   4. what is the context of each notify call? (this might be in specs
   already, so I'll check there too)

I know it's strawman already but if anyone can explain me these points that
would be great, cheers.

br

On Tue, Aug 14, 2012 at 10:08 AM, Brandon Benvie
<brandon at brandonbenvie.com>wrote:

> I love it.
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120814/863aea23/attachment.html>


More information about the es-discuss mailing list