strict mode worries the IDE

Posted on
  • code using the 'use strict' directive is identified by the editor, but
    brings up error message for built-in library functions (see attached image)

    function test_strict(){
      "use strict";
      
      var N=false;   // oops - typo...
      setInterval( function(){
        LED2.write( n);
        n = !n;
      },1000);
    }
    

    is there any libraray available to satisfy the editor's strict validator?

    ps: the esprima minifyer ignores the strict directive, and reports even bad code to be fine


    1 Attachment

    • strict.png
  • Thanks for the report - I should turn off that set of linter warnings. You might be able to use global.setInterval?

    However, Espruino doesn't pay any attention to use strict, so you'd only be using it in this case for the linter.

  • use global.setInterval

    does not help - now the global var itself gets accused by the linter ;)

    However, Espruino doesn't pay any attention to use strict

    imho that's ok - to get some hints in the editor is already great!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

strict mode worries the IDE

Posted by Avatar for andiy @andiy

Actions