From 08c324f5b55d4c6e1cb8633f33aa91e3e7db29ac Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 7 Feb 2019 17:14:01 -0800 Subject: [PATCH] Set entry.state to STATE_EXECUTION_COMPLETED on parse or run error. --- src/module/internal/compile.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/module/internal/compile.js b/src/module/internal/compile.js index 3f05b45fe..52a255403 100644 --- a/src/module/internal/compile.js +++ b/src/module/internal/compile.js @@ -93,7 +93,7 @@ function compile(caller, entry, content, filename, fallback) { ? compileData.scriptData : null - compileData = tryCompile(caller, content, { + compileData = tryCompile(caller, entry, content, { cacheName, cachePath: pkg.cachePath, cjsVars: cjs.vars, @@ -221,7 +221,7 @@ function isDescendant(entry, parentEntry, seen) { return false } -function tryCompile(caller, content, options) { +function tryCompile(caller, entry, content, options) { let error try { @@ -230,6 +230,8 @@ function tryCompile(caller, content, options) { error = e } + entry.state = STATE_EXECUTION_COMPLETED + if (Loader.state.package.default.options.debug || ! isStackTraceMaskable(error)) { toExternalError(error) @@ -387,6 +389,8 @@ function tryRun(entry, filename) { return result } + entry.state = STATE_EXECUTION_COMPLETED + if (Loader.state.package.default.options.debug || ! isStackTraceMaskable(error)) { throw error