diff --git a/ChangeLog b/ChangeLog index b5587cd094..6ccfab6a9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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) diff --git a/src/jsparse.c b/src/jsparse.c index 5799c0f3e9..9fef529c6c 100644 --- a/src/jsparse.c +++ b/src/jsparse.c @@ -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);