Skip to content

Commit 0d433ed

Browse files
Update src/node_errors.cc
Co-authored-by: René <contact.9a5d6388@renegade334.me.uk>
1 parent 530447a commit 0d433ed

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

src/node_errors.cc

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,14 +1068,9 @@ void PerIsolateMessageListener(Local<Message> message, Local<Value> error) {
10681068
// defer the warning to the next event loop iteration when JS execution is
10691069
// allowed. This prevents crashes when V8 emits warnings during code
10701070
// evaluation with throwOnSideEffect.
1071-
if (!env->can_call_into_js()) {
1072-
std::string warning_str = warning;
1073-
env->SetImmediate([warning_str](Environment* env) {
1074-
ProcessEmitWarningGeneric(env, warning_str, "V8");
1075-
});
1076-
} else {
1077-
USE(ProcessEmitWarningGeneric(env, warning, "V8"));
1078-
}
1071+
env->SetImmediate([warning](Environment* env) {
1072+
ProcessEmitWarningGeneric(env, warning, "V8");
1073+
});
10791074
break;
10801075
}
10811076
case Isolate::MessageErrorLevel::kMessageError:

0 commit comments

Comments
 (0)