This feature allows developers to create weak references to JavaScript objects. 
 Finalizers are also provided that allow developers to perform actions when an 
object is garbage collected, without keeping that object alive.

This is an advanced feature that is not expected to be widely used but is 
necessary for some use important use cases such as exposing WebAssembly memory 
to JavaScript.



JS spec changes:
HTML spec changes:

The proposal is at stage 3.

Platform coverage:

This is a new JavaScript language feature and will be available in all contexts.


This feature will be controlled by the javascript.options.weakrefs pref, which 
will be off by default.

DevTools bug:

Other browsers:

  Chrome: implemented behind a flag
  Safari: believed to have an implementation


There are test262 tests covering this feature:

Web platform tests will be added in the following bug:

Secure contexts: 

This is a JS language feature and is thus present in all contexts where scripts 
are executed.

Is this feature enabled by default in sandboxed iframes? If not, is there a 
proposed sandbox flag to enable it? If allowed, does it preserve the current 
invariants in terms of what sandboxed iframes can do?

Where enabled, this feature will be allowed by default in sandboxed iframes. It 
does not change the invariants in terms of what sandboxed iframes can do.
dev-platform mailing list

Reply via email to