Re: [sensors] Garbage collection behavior unclear in Generic Sensor spec

(Trying to page in sensors API to my mind). https://w3c.github.io/sensors/#sensor-garbage-collection looks quite reasonable. If the backend of the sensor may cause new events to be dispatched and there are event listeners, the object must not be collected. And of course if JS has explicit (direct or indirect) references to the object, it can't be collected either.
Then it is up to the implementation to collect the object when it wants to, since the collection won't be exposed to the web page.

>From the initial comment:
> Following the specification, the sensor begins in the `idle` state. When `start` is called, the sensor progresses to the `activating` state. There are no Event Handlers installed, so the sensor is eligible to be garbage collected. Therefore, we run the deactivation steps which returns the state to `idle`.

No, it isn't eligible to gc, because normal "JS has access to the object" rules keep the object alive. 


-- 
GitHub Notification of comment by smaug----
Please view or discuss this issue at https://github.com/w3c/sensors/issues/372#issuecomment-423646877 using your GitHub account

Received on Friday, 21 September 2018 19:29:13 UTC