Skip to content

Commit 0a4fd13

Browse files
author
Raphael Kubo da Costa
authored
Sensor.timestamp: Account for "get value from latest reading" returning 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".
1 parent 1e40156 commit 0a4fd13

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.bs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,9 +1122,10 @@ with the internal slots described in the following table:
11221122
The {{Sensor/timestamp}} getter steps are:
11231123

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

11301131
### Sensor.start() ### {#sensor-start}

0 commit comments

Comments
 (0)