Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo<Value>& args) {
result = module->Evaluate(context);
}

// Convert the termination exception into a regular exception.
if (timed_out || received_signal) {
env->isolate()->CancelTerminateExecution();
// It is possible that execution was terminated by another timeout in
// which this timeout is nested, so check whether one of the watchdogs
// from this invocation is responsible for termination.
Expand All @@ -288,7 +290,6 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo<Value>& args) {
} else if (received_signal) {
env->ThrowError("Script execution interrupted.");
}
env->isolate()->CancelTerminateExecution();
}

if (try_catch.HasCaught()) {
Expand Down
3 changes: 2 additions & 1 deletion src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,9 @@ class ContextifyScript : public BaseObject {
result = script->Run(env->context());
}

// Convert the termination exception into a regular exception.
if (timed_out || received_signal) {
env->isolate()->CancelTerminateExecution();
// It is possible that execution was terminated by another timeout in
// which this timeout is nested, so check whether one of the watchdogs
// from this invocation is responsible for termination.
Expand All @@ -861,7 +863,6 @@ class ContextifyScript : public BaseObject {
} else if (received_signal) {
env->ThrowError("Script execution interrupted.");
}
env->isolate()->CancelTerminateExecution();
}

if (try_catch.HasCaught()) {
Expand Down