Debugging: Listing the "hidden" variables

Posted on
  • I believe that there is the concept of a symbol table for variables that are flagged as hidden. These (I believe) can then be used by Espruino internals to cache away data. Is there a way to debug/dump the content of these variables?

  • Use use trace() - if you want to dig down into something specific then use trace(your_variable).

    trace(global["\xFF"]) is probably the stuff you really care about.

  • Just to add - once you've found the hidden variables you can print them normally, so:

    setInterval("",1000);
    console.log(global["\xFF"].timers);
    

    will give you a much cleaner dump of (for instance) active timers.

  • Perfect. Exactly what I was looking for.

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

Debugging: Listing the "hidden" variables

Posted by Avatar for Kolban @Kolban

Actions