• Good morning,

    Look at this code, it draws 2 horizontal lines on the Bangle screen

    
    function Test(){
      this.p1 = {x:0, y:80};
      this.p2 = {x:240, y:80};
    }
    
    Test.prototype.draw = _=> {
      g.clear();
      g.drawLine(0,80,240,80);
    };
    
    var t= new Test();
    t.draw();
    g.drawLine(0,160,240,160);
    
    

    When it is sent to the emulator, it works well.
    When it is sent to the Bangle, it does not work properly, only the second line is drawn.
    A dump to the console shows that the function draw() is not properly loaded

    dump()
    function Test() {this.p1={x:0,y:80},this.p2={x:240,y:80}­;}
    Test.prototype.draw = function (undefined) {return g.clear()};
    var t = Object.create(Test["prototype"]);
    t.p1 = { "x": 0, "y": 80 };
    t.p2 = { "x": 240, "y": 80 };
    E.setFlags({ "deepSleep": 0, "pretokenise": 1, "unsafeFlash": 0, "unsyncFiles": 0 });

    If I type this code in REPL mode with Bangle connected, it works well.

    Where's the error ?

About

Avatar for Ptitonio @Ptitonio started