Avatar for Konkery

Konkery

Member since Dec 2017 • Last active Mar 2019
  • 3 conversations
  • 18 comments

Most recent activity

  • in JavaScript
    Avatar for Konkery
    ={
      "VERSION": "1v96.43",
      "GIT_COMMIT": "c975a9a",
      "BOARD": "ISKRAJS",
      "FLASH": 1048576, "RAM": 196608,
      "SERIAL": "3b004900-07513535-31393131",
      "CONSOLE": "USB",
      "MODULES": "Flash,Storage,fs," ... "t,crypto,neopixel",
      "EXPORTS": { "jsvLockAgainSafe": 105081, "jsvUnLock": 105055, "jsvSkipName": 111873, "jsvMathsOp": 91429,
        "jsvNewWithFlags": 105193, "jsvNewFromFloat": 105361, "jsvNewFromInteger": 105397, "jsvNewFromString": 110413, "jsvNewFromBool": 105381,
        "jsvGetFloat": 112097, "jsvGetInteger": 111285, "jsvGetBool": 112657, "jspReplaceWith": 29177, "jspeFunctionCall": 80681,
        "jspGetNamedVariable": 80505, "jspGetNamedField": 85101, "jspGetVarNamedField": 84825 },
      "EXPTR": 536871104 }
    
  • in JavaScript
    Avatar for Konkery

    Hi,
    The reason is clearly established, it is in firmware 1v96.43,
    it doesn't work in her.
    To change the firmware at the moment I can not, the Board is not original (Amperka). Checked it on the original Board version 2v01
    there the code is executed correctly.
    I will wait for the firmware update.
    Thanks everyone !

  • in JavaScript
    Avatar for Konkery

    It is similar that in version 1v96.43 it does not work...

  • in JavaScript
    Avatar for Konkery

    Console conclusion at implementation of your code:

        ____       __
       /  _/_____ / /__ _____ ____ _
       / / / ___// //_// ___// __ `/
     _/ / (__  )/ ,<  / /   / /_/ /
    /___//____//_/|_|/_/    \__,_/
    Based on Espruino 1v96.43
    (c) 2018 G.Williams, Amperka LLC
    Support the work of core developers:
    http://espruino.com/Donate
    >
    =undefined
    Uncaught Error: Function "asyncFuncA" not found!
     at line 1 col 7
    _this.asyncFuncA();
          ^
    in function called from system
    
  • in JavaScript
    Avatar for Konkery

    @allObjects Does not work:

    one is to define a local variable var _this = this; before the setInterval() and use it - _this in its function... (sometimes I just use var _ = this; to be short).
    another one is to pass this as variable by passing it as 2nd+ parameter when setting up the interval: setInterval(function(_){ _.xyz(); },1000,this);.

  • in JavaScript
    Avatar for Konkery

    I studied Gordon's article and found no contradictions in his code.
    Article - "How ES6 classes work"
    http://forum.espruino.com/conversations/­327037/

  • in JavaScript
    Avatar for Konkery

    I disagree with you

    1. This code works without modification under NodeJS;
    2. This code works if it is issued in the prototype style of ES5.

    It seems to me that the problem is in Espruino

  • in JavaScript
    Avatar for Konkery

    Hi !

    class A {
        constructor(x, y){
        //class field...
        }
    
        AsyncFuncA(){
        //code...
        }
    
        run(){
        //call async code
            setInterval(() => {
                this.AsyncFuncA();
            }, 1000)
        }
    }
    
    class B {
        constructor(x, y){
            super(x,y);
        }
    
        AsyncFuncB(){
           //code...
        }
    
        run(){
        //call async code
            super.run();
            setInterval(() => {
            // Todo...
                this.AsyncFuncB();
            }, 2000);
        }
    }
    /***************************************­*******/
    let ob = new B(x, y);
    ob.run();
    

    an error occurs when you call run() -> this.AsyncFuncA()
    Web IDE:

    "Uncaught Error: Function "AsyncFuncA" not found!
    at line 248 col 6
    this.AsyncFuncA();

      ^
    

    in function called from system"

    how can this be fought ?

Actions