You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any syntax errors inside callback functions will be silently ignored (calling invalid method, using == instead of ===, etc.) This makes troubleshooting difficult for the developer (and very difficult for people using AI to generate JavaScript).
Many JavaScript have the majority of the code inside of the eventLoop.subscribe handler (handling a user selection, periodic timer, etc.) so this is a fairly common issue to encounter when writing a complex script.
Reproduction
Repo
Save the below script to demo.js and copy the file onto Flipper Zero at SD Card/apps/Scripts/demo.js.
leteventLoop=require("event_loop");functionhi(_subscription,_item,event_loop){print("Hi after 1337 ms");// This should throw an errorevent_loop.bad_method_name();print("bad_method_name called");event_loop.stop();}// This correctly displays an error on line 6 when the next line is uncommented.// hi(1, 2, eventLoop); // BUG: This does NOT display error on line 6 & line 7 never executes.eventLoop.subscribe(eventLoop.timer("oneshot",1337),hi,eventLoop);eventLoop.run();print("finished");
On the Flipper run: Apps, Scripts, demo.js
Actual result from below script:
"Hi after 1337 ms"
Expected result from below script:
Hi after 1337 ms
--- ERROR ---
calling non-callable
at demo.js:5
see logs for full trace
Target
JavaScript
Logs
The log files also don't have any [E][JS] messages.
54892277 [I][Loader] Starting JS Runner
54892285 [I][AnimationManager] Unload animation 'L2_Secret_door_128x64'
54892330 [I][JS modules] Loading external module event_loop from /ext/apps_data/js_app/plugins/js_event_loop.fal
54892380 [I][Elf] Total size of loaded sections: 3772
54892381 [D][Fap] Library for js, API v. 1 loaded
54892382 [D][Fap] Library for js, API v. 1 loaded
54892382 [I][JS modules] Added module API to composite resolver: event_loop
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Describe the bug.
Any syntax errors inside callback functions will be silently ignored (calling invalid method, using == instead of ===, etc.) This makes troubleshooting difficult for the developer (and very difficult for people using AI to generate JavaScript).
Many JavaScript have the majority of the code inside of the eventLoop.subscribe handler (handling a user selection, periodic timer, etc.) so this is a fairly common issue to encounter when writing a complex script.
Reproduction
Repo
Save the below script to
demo.js
and copy the file onto Flipper Zero atSD Card/apps/Scripts/demo.js
.On the Flipper run: Apps, Scripts, demo.js
Actual result from below script:
"Hi after 1337 ms"
Expected result from below script:
Hi after 1337 ms
--- ERROR ---
calling non-callable
at demo.js:5
see logs for full trace
Target
JavaScript
Logs
Anything else?
No response
The text was updated successfully, but these errors were encountered: