Skip to content

Commit

Permalink
src: use supported API to get stalled TLA messages
Browse files Browse the repository at this point in the history
  • Loading branch information
targos authored and nodejs-github-bot committed Mar 17, 2024
1 parent 539e197 commit 0f070c9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,16 @@ v8::Maybe<bool> ModuleWrap::CheckUnsettledTopLevelAwait() {
if (!module->IsGraphAsync()) { // There is no TLA, no need to check.
return v8::Just(true);
}
auto stalled = module->GetStalledTopLevelAwaitMessage(isolate);
if (stalled.size() == 0) {

auto stalled_messages =
std::get<1>(module->GetStalledTopLevelAwaitMessages(isolate));
if (stalled_messages.size() == 0) {
return v8::Just(true);
}

if (env()->options()->warnings) {
for (auto pair : stalled) {
Local<v8::Message> message = std::get<1>(pair);
for (size_t i = 0; i < stalled_messages.size(); i++) {
Local<v8::Message> message = stalled_messages[i];

std::string reason = "Warning: Detected unsettled top-level await at ";
std::string info =
Expand Down

0 comments on commit 0f070c9

Please sign in to comment.