Skip to content

Commit 00febd9

Browse files
committed
WIP to work around #3983
1 parent 17acdd3 commit 00febd9

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

js/eventloop/eventloop.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,16 @@ func (e *EventLoop) RegisterCallback() (enqueueCallback func(func() error)) {
124124
panic("RegisterCallback called twice")
125125
}
126126
callbackCalled = true
127-
e.queue = append(e.queue, f)
127+
wrapFunc := func() error {
128+
rt := e.vu.Runtime()
129+
callable, _ := sobek.AssertFunction(rt.ToValue(f))
130+
_, err := callable(nil)
131+
// if there is an exception the err will be nil either way
132+
133+
return err
134+
}
135+
136+
e.queue = append(e.queue, wrapFunc)
128137
e.registeredCallbacks--
129138
e.lock.Unlock()
130139
e.wakeup()

vendor/github.com/grafana/sobek/builtin_promise.go

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)