Skip to content

Commit

Permalink
Sensor.timestamp: Account for "get value from latest reading" returni…
Browse files Browse the repository at this point in the history
…ng null (#480)

This addresses a regression introduced by #469. The current algorithm
assumes that "get value from latest reading" never returns null, which is
not the case.

Return null when it does instead of passing an invalid value to "relative
high resolution time".
  • Loading branch information
Raphael Kubo da Costa authored Feb 17, 2024
1 parent 1e40156 commit 0a4fd13
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1122,9 +1122,10 @@ with the internal slots described in the following table:
The {{Sensor/timestamp}} getter steps are:

1. Let |global| be [=this=]'s [=relevant global object=].
2. Let |unsafeTimestamp| be the result of invoking [=get value from latest reading=] with
1. Let |unsafeTimestamp| be the result of invoking [=get value from latest reading=] with
[=this=] and "timestamp" as arguments.
3. Return [=relative high resolution time=] with |unsafeTimestamp| and |global|.
1. If |unsafeTimestamp| is null, return null.
1. Otherwise, return [=relative high resolution time=] with |unsafeTimestamp| and |global|.
</div>

### Sensor.start() ### {#sensor-start}
Expand Down

0 comments on commit 0a4fd13

Please sign in to comment.