Repro:
<script>
new MouseEvent("click", { view: window });
</script>
Error: Unhandled JavaScript exception: [TypeError] Not an object of type Window
Relevant generated code in MouseEventConstructor.cpp
:
JS::GCPtr<Window> view_value_23;
if (!view_property_value_23.is_nullish()) {
if (!view_property_value_23.is_object() || !is<Window>(view_property_value_23.as_object()))
return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "Window");
view_value_23 = &static_cast<Window&>(view_property_value_23.as_object());
}
event_init_dict.view = view_value_23;
If I manually edit this to be the following (+ a WindowProxy
include at the top of the file), it works as expected:
JS::GCPtr<Window> view_value_23;
if (!view_property_value_23.is_nullish()) {
if (!view_property_value_23.is_object() || !is<WindowProxy>(view_property_value_23.as_object()))
return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "Window");
view_value_23 = static_cast<WindowProxy&>(view_property_value_23.as_object()).window();
}
event_init_dict.view = view_value_23;
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too