After some (purely syntactical) experiments, I found that getters/setters within IIFEs seem to be the problem. When trying
let Y = {
_y:0,
get y () { return this._y }
};
print(Y.y);
(function () {
let X = {
_x:0,
get x () { return this._x }
};
print(X.x);
})();
(edited in the right section of the Espruino IDE, then uploaded to my Bangle.js) the Y-based constructs worked as foreseen (and even produced the intended output), but then the X-based stuff failed.
So, IIFEs seem to have their own (inner) capabilities?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
After some (purely syntactical) experiments, I found that getters/setters within IIFEs seem to be the problem. When trying
(edited in the right section of the Espruino IDE, then uploaded to my Bangle.js) the
Y
-based constructs worked as foreseen (and even produced the intended output), but then theX
-based stuff failed.So, IIFEs seem to have their own (inner) capabilities?