Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

[sensor] Not readonly properties for state and readvalue #595

Closed
@cuiyanx

Description

@cuiyanx

State and readvalue of sensor should be readonly properties, but actually it can be modified.

W3C Sensor APIs:

readonly attribute SensorState state;
readonly attribute SensorReading? reading;

code for test state:

middleState = sensor.state;
sensor.state = middleState + "love";
assert(sensor.state === middleState, "sensor: state is readonly property");

code for test reading(AmbientLight):

middleNum = event.reading.illuminance;
event.reading.illuminance = middleNum + 1;
assert(event.reading.illuminance === middleNum, "sensor: reading is readonly property");

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions