PHP Code:
this.on = core.setValue(this.on, (this.on = !this.on));
Firstly, I am not sure that
(this.on = !this.on) will work there; it is probably doing comparison instead of assignation.
Secondly, this is what your function is probably actually doing in this context:
PHP Code:
(@ true) = (@ false);
Finally, you haven't returned anything from
setValue() to set
this.on to, so it is probably overwriting it with NULL.