发表文章

[Java] 记录属性做作会产生副作用 Logging property affectation can have side effect[ThingML]

bricemorin 2017-10-9 30

例如:

analogPin0 = 'new '& mraa &'.I2c(1)'

将生产:

if(_this.debug) console.log(colors.magenta(_this.name + "(SensorJS): property analogPin0 changed from " + SensorJS_analogPin0__var + " to " + (new _this.SensorJS_mraa__var.I2c(1))));
_this.SensorJS_analogPin0__var = new _this.SensorJS_mraa__var.I2c(1);

我们调用 new _this.SensorJS_mraa__var.I2c(1) 两次, 这可能不是我们想要的东西..。

原文:

For example:

analogPin0 = 'new '& mraa &'.I2c(1)'

Will produce:

if(_this.debug) console.log(colors.magenta(_this.name + "(SensorJS): property analogPin0 changed from " + SensorJS_analogPin0__var + " to " + (new _this.SensorJS_mraa__var.I2c(1))));
_this.SensorJS_analogPin0__var = new _this.SensorJS_mraa__var.I2c(1);

We call new _this.SensorJS_mraa__var.I2c(1) twice, which is probably not something we want...

相关推荐
最新评论 (1)
bricemorin 2017-10-9
1

这应该是固定的

原文:

This should be fixed

返回
发表文章
bricemorin
文章数
9
评论数
58
注册排名
60870