mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +00:00
LibWeb: Exclude [Global] interfaces from legacy platform object methods
Window and other global objects are not technically legacy platform objects, and have other ways to override their setters and getters. However, Window does need to share some code with the legacy platform object paths, and simply adding another bool check to the mix seems the shortest putt.
This commit is contained in:
parent
2b22402c6a
commit
2505cecc0f
3 changed files with 33 additions and 5 deletions
22
Tests/LibWeb/Text/input/HTML/Window-set-properties.html
Normal file
22
Tests/LibWeb/Text/input/HTML/Window-set-properties.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<script src="../include.js"></script>
|
||||
<script id="__NEXT_DATA__"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
"use strict";
|
||||
println(`window.__NEXT_DATA__ = ${window.__NEXT_DATA__}`);
|
||||
window.__NEXT_DATA__ = undefined;
|
||||
println(`window.__NEXT_DATA__ = ${window.__NEXT_DATA__}`);
|
||||
|
||||
println(`window[0] = ${window[0]}`);
|
||||
|
||||
// FIXME: Other browsers just swallow this error, but we throw an exception.
|
||||
try {
|
||||
window[0] = 42;
|
||||
} catch (e) {
|
||||
println(`e = ${e}`);
|
||||
}
|
||||
println(`window[0] = ${window[0]}`);
|
||||
window.__proto__[0] = 42;
|
||||
println(`window[0] = ${window[0]}`);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue