Yes, when load(filename) is used, the global variable __FILE__ is set to filename. (I couldn't find it anywhere in the docs except in the changelog: https://github.com/espruino/Espruino/blob/53108085800141bec24ba0164c7880678f573a43/ChangeLog#L172)
load(filename)
__FILE__
filename
@rigrig started
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.
Yes, when
load(filename)
is used, the global variable__FILE__
is set tofilename
.(I couldn't find it anywhere in the docs except in the changelog: https://github.com/espruino/Espruino/blob/53108085800141bec24ba0164c7880678f573a43/ChangeLog#L172)