Skip to content

Commit f934e52

Browse files
pranaygpclaude
andauthored
add closure comment in sleep test helper (#1071)
Per TooTallNate's review on #1055: the setupWorkflowContext helper has a circular reference where ctx.onWorkflowError is accessed via closure before it's defined on the object. Add a clarifying comment. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0edcccf commit f934e52

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

packages/core/src/workflow/sleep.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function setupWorkflowContext(events: Event[]): WorkflowOrchestratorContext {
1919
const workflowStartedAt = context.globalThis.Date.now();
2020
const ctx: WorkflowOrchestratorContext = {
2121
globalThis: context.globalThis,
22+
// ctx.onWorkflowError is accessed via closure — it's defined below on the same object
2223
eventsConsumer: new EventsConsumer(events, {
2324
onUnconsumedEvent: (event) => {
2425
ctx.onWorkflowError(

0 commit comments

Comments
 (0)