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.

[I2C] bus and speed are not a readonly properties #477

Closed
@haoxli

Description

@haoxli
dictionary I2CInit {
    octet bus;
    I2CBusSpeed speed;
};

interface I2CBus {
    // has all the properties of I2CInit as read-only attributes
};

bus and speed should be readonly properties, but actually it can be modified.

var i2cDevice = i2c.open({ bus: 0, speed: 100 });
var busValue = i2cDevice.bus;
var speedValue = i2cDevice.speed;
i2cDevice.bus = busValue + 1;
i2cDevice.speed = speedValue + 1;
console.log(i2cDevice.bus);
console.log(i2cDevice.speed);

The expected result are 0 and 100, but print 1 and 101.

Branch Build ID Date Result
master commit 2a9bbc7 Nov 25, 2016 Fail
zjs-0.1 commit dcb06fb Nov 25, 2016 Fail

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions