diff --git a/spec/abstract-jobs.html b/spec/abstract-jobs.html index 307aed4..4fd9356 100644 --- a/spec/abstract-jobs.html +++ b/spec/abstract-jobs.html @@ -130,25 +130,19 @@

Liveness

Execution

-

- At any time, an ECMAScript implementation may perform any of the three - following actions. They may be triggered interspersed with ECMAScript - code execution, or, e.g., from a separate parallel thread. -

- - + At any time, if an object _obj_ is not live, an ECMAScript implementation may perform the following steps atomically: + + + 1. For each WeakRef _ref_ such that _ref_.[[Target]] is _obj_, + 1. Set _ref_.[[Target]] to ~empty~. + 1. For each FinalizationGroup _fg_ such that _fg_.[[Cells]] contains _cell_, such that _cell_.[[Target]] is _obj_, + 1. Set _cell_.[[Target]] to ~empty~. + 1. Optionally, perform ! HostCleanupFinalizationGroup(_fg_). + 1. For each WeakMap _map_ such that _map_.[[WeakMapData]] contains a record _r_ such that _r_.[[Key]] is _obj_, + 1. Remove _r_ from _map_.[[WeakMapData]]. + 1. For each WeakSet _set_ such that _set_.[[WeakSetData]] contains _obj_, + 1. Remove _obj_ from _set_.[[WeakSetData]]. +
diff --git a/spec/weak-ref.html b/spec/weak-ref.html index cac9d31..786564d 100644 --- a/spec/weak-ref.html +++ b/spec/weak-ref.html @@ -158,11 +158,11 @@

Modifications to collection type definitions

WeakMap Objects

-

WeakMap objects are collections of key/value pairs where the keys are objects and values may be arbitrary ECMAScript language values. A WeakMap may be queried to see if it contains a key/value pair with a specific key, but no mechanism is provided for enumerating the objects it holds as keys. There is no way for ECMAScript programs to observe the presence of a key in a WeakMap without a reference to that key. This implies that, if an object is not live, and it is present as a WeakMap key, then the implementation may unobservably remove the key-value pair from the WeakMap. If an object that is being used as the key of a WeakMap key/value pair is only reachable by following a chain of references that start within that WeakMap, then that key/value pair is inaccessible and is automatically removed from the WeakMap. WeakMap implementations must detect and remove such key/value pairs and any associated resources.

+

WeakMap objects are collections of key/value pairs where the keys are objects and values may be arbitrary ECMAScript language values. A WeakMap may be queried to see if it contains a key/value pair with a specific key, but no mechanism is provided for enumerating the objects it holds as keys. In certain conditions, objects which are not live are removed as WeakMap keys, as described in . If an object that is being used as the key of a WeakMap key/value pair is only reachable by following a chain of references that start within that WeakMap, then that key/value pair is inaccessible and is automatically removed from the WeakMap. WeakMap implementations must detect and remove such key/value pairs and any associated resources.

WeakSet Objects

-

WeakSet objects are collections of objects. A distinct object may only occur once as an element of a WeakSet's collection. A WeakSet may be queried to see if it contains a specific object, but no mechanism is provided for enumerating the objects it holds. There is no way for ECMAScript programs to observe the presence of an object held in a WeakSet without a reference to that object. This implies that, if an object is not live, and it is held in a WeakSet, then the implementation may unobservably remove the object from the WeakSet. If an object that is contained by a WeakSet is only reachable by following a chain of references that start within that WeakSet, then that object is inaccessible and is automatically removed from the WeakSet. WeakSet implementations must detect and remove such objects and any associated resources.

+

WeakSet objects are collections of objects. A distinct object may only occur once as an element of a WeakSet's collection. A WeakSet may be queried to see if it contains a specific object, but no mechanism is provided for enumerating the objects it holds. In certain conditions, objects which are not live are removed as WeakSet elements, as described in . If an object that is contained by a WeakSet is only reachable by following a chain of references that start within that WeakSet, then that object is inaccessible and is automatically removed from the WeakSet. WeakSet implementations must detect and remove such objects and any associated resources.