Skip to content

Commit 56c49cc

Browse files
committed
scope handling fix (wip)
1 parent e33f2f4 commit 56c49cc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/org/htmlunit/javascript/host/worker/DedicatedWorkerGlobalScope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ void executeEvent(final Context cx, final MessageEvent event) {
297297
final Object[] args = {event};
298298
for (final Scriptable scriptable : handlers) {
299299
if (scriptable instanceof Function handlerFunction) {
300-
handlerFunction.call(cx, this, this, args);
300+
handlerFunction.call(cx, ScriptableObject.getTopLevelScope(event), this, args);
301301
}
302302
}
303303
}

0 commit comments

Comments
 (0)