Skip to content

Commit

Permalink
The main thread's script execution context has ID 1, not 2
Browse files Browse the repository at this point in the history
  • Loading branch information
heimskr committed Jan 10, 2025
1 parent e6fe3b6 commit 391a729
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bun.js/bindings/ScriptExecutionContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ bool ScriptExecutionContext::ensureOnMainThread(Function<void(ScriptExecutionCon
ScriptExecutionContext* ScriptExecutionContext::getMainThreadScriptExecutionContext()
{
Locker locker { allScriptExecutionContextsMapLock };
return allScriptExecutionContextsMap().get(2);
return allScriptExecutionContextsMap().get(1);
}

void ScriptExecutionContext::processMessageWithMessagePortsSoon(CompletionHandler<void()>&& completionHandler)
Expand Down

0 comments on commit 391a729

Please sign in to comment.