mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:27:43 +00:00
LibWeb: Handle scenario when Window property setter is called on global
This commit fixes a regression introduced in
1528e9109c
.
Turns out that the type of `this_value` in the property setter of the
Window object depends on how the variable is accessed. If the property
is accessed as a global variable, then this_value is of type `Window`.
For example:
```js
performance = null
```
However, when it is accessed as a property of the window object,
`this_value` is of type `WindowProxy`. For example:
```js
window.performance = null
```
This commit updates the window property setters generator to handle
both scenarios.
With this change https://discord.com/login works again.
This commit is contained in:
parent
bc640b72b1
commit
8a829be25c
3 changed files with 27 additions and 6 deletions
9
Tests/LibWeb/Text/input/global-performance-property.html
Normal file
9
Tests/LibWeb/Text/input/global-performance-property.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
<script src="include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
// Test passes if this script does not throw an exception.
|
||||
performance;
|
||||
performance = null;
|
||||
println("PASS");
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue