You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Greg Dove <gr...@gmail.com> on 2020/08/28 01:07:48 UTC

WeakRefs in the wild since July

I realize this is not supported across all our current browser targets
(and, as long as IE11 is part of that I can feel confident that it never
will be), but just in case anyone was not yet aware, real weak references
became available on Edge, Chrome and Firefox in the last month or two.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef
https://caniuse.com/#feat=mdn-javascript_builtins_weakref

This feature should be able to support things like emulating flash
Dictionary with weak keys that are iterable (that is not possible with
WeakMap alone, for example, but could be emulated I think with a regular
Map with 'WeakRef' keys, probably coupled with a WeakMap) or even adding
support for weak event listeners by enhancing/wrapping the goog EventTarget
code.

Just sharing in case others are not aware... I did not use this yet myself.

Re: WeakRefs in the wild since July

Posted by Carlos Rovira <ca...@apache.org>.
Hi Greg,

Thanks for the update. Was not aware of that.
Did you plan to bring this to Royale at some point?
would be good not only for backward compatibility with Flash and Flex, but
for Royale future as well.
We could support Dictionary and also add to AMF support a well too.

thanks



El vie., 28 ago. 2020 a las 3:08, Greg Dove (<gr...@gmail.com>)
escribió:

> I realize this is not supported across all our current browser targets
> (and, as long as IE11 is part of that I can feel confident that it never
> will be), but just in case anyone was not yet aware, real weak references
> became available on Edge, Chrome and Firefox in the last month or two.
>
>
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef
> https://caniuse.com/#feat=mdn-javascript_builtins_weakref
>
> This feature should be able to support things like emulating flash
> Dictionary with weak keys that are iterable (that is not possible with
> WeakMap alone, for example, but could be emulated I think with a regular
> Map with 'WeakRef' keys, probably coupled with a WeakMap) or even adding
> support for weak event listeners by enhancing/wrapping the goog EventTarget
> code.
>
> Just sharing in case others are not aware... I did not use this yet myself.
>


-- 
Carlos Rovira
http://about.me/carlosrovira