Skip to content

Commit

Permalink
Forward errors encountered while loading modules back into Espruino (fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Apr 17, 2024
1 parent 0fc1f3c commit 0918806
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
Jolt.js: Jolt.Q0/1/2/3 now available as global vars (Q0/1/2/3)
Storage.readJSON will now read numeric field names like "{1:1}" which can be produced by writeJSON (fix #2484)
Ensure `Bangle.load(".bootcde")` just calls `load()` if no uiRemove - fix error loading clock without widgets
Forward errors encountered while loading modules back into Espruino (fix #2485)

2v21 : nRF52: free up 800b more flash by removing vector table padding
Throw Exception when a Promise tries to resolve with another Promise (#2450)
Expand Down
2 changes: 2 additions & 0 deletions src/jsparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -3376,7 +3376,9 @@ JsVar *jspEvaluateModule(JsVar *moduleContents) {
assert(execInfo.blockCount==0);
assert(execInfo.blockScope==0);
#endif
JsExecFlags hasError = (execInfo.execute)&EXEC_ERROR_MASK;
execInfo = oldExecInfo; // make sure we fully restore state after parsing a module
execInfo.execute |= hasError; // pass on any errors the occurred

jsvUnLock2(moduleContents, scope);
return jsvSkipNameAndUnLock(exportsName);
Expand Down

0 comments on commit 0918806

Please sign in to comment.