Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Set entry.state to STATE_EXECUTION_COMPLETED on parse or run error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Feb 8, 2019
1 parent 4480fa8 commit 08c324f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/module/internal/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 08c324f

Please sign in to comment.