On May 14, 2011, at 6:06 PM, Rick Waldron wrote:
> Boris,
>
> Would you mind sharing a piece of working code (as in, runs in the latest
> Firefox Nightly) that demonstrates your example in a real world scenario?
> This would be greatly appreciated
javascript:k = {}; v = "hi"; w = WeakMap(); w.set(k, v); alert(w.get(k))
just alerted "hi" in my slightly out of date tracemonkey-repo nightly build.
There may be some javascript: URL stripping or blocking you have to get past,
in which case use the code after the javascript: in the Web Console.
/be
>
> Rick
>
> On Sat, May 14, 2011 at 8:55 PM, Boris Zbarsky <[email protected]> wrote:
> On 5/14/11 6:37 PM, Oliver Hunt wrote:
> Can you provide a use case where you have an object key as the usual
> programming idiom?
>
> Attaching metadata to object without polluting the objects themselves.
>
> For example, Firefox extensions want to do this all the time for various DOM
> objects (and especially Window).
>
> -Boris
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss