Re: [sensors] Use simple event dispatch mechanism instead of task source (queued)

> Could you point me to where in the spec this is fixed. I fail to see how anything in that PR fixes it (which doesn't mean it's not fixed, just I fail to see it).

Sure, [report latest reading updated](https://github.com/w3c/sensors/pull/210/files#diff-ec9cfa5f3f35ec1f84feb2e59686c34dR1248) algorithm and [update sensor reading](https://github.com/w3c/sensors/pull/210/files#diff-ec9cfa5f3f35ec1f84feb2e59686c34dR1279) that makes deep copy of latest reading to Sensor.reading, therefore, Sensor.reading is not pointing directly to internal shared buffer (latest reading), thus, modification of latest reading in the middle of script execution would not modify Sensor.reading.

- Sensor.reading === Sensor.reading during event handler execution
- SensorA with different frequency would not modify SensorB behavior
- Reporting frequency is respected, e.g., Sensor.reading is not updated faster than requested.

> Yeah—I know. The backstory is that I added @anssiko's work in there to meet a deadline, knowing very well we'd have to tackle the task issue heads on at some point. Hence the inline issue on the topic I added later. Technical debt.

Technical debt is fine, as long as we are taking care of it. Thanks for involving #whatwg and asking for hints!

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

Received on Friday, 26 May 2017 18:12:03 UTC