mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
LibWeb: PlatformObject::DefineOwnProperty fix 'has own property' check
PlatformObjects with named properties does not qualify as 'has own property' just by virtue of a named property existing. This fixes at least one WPT test, which is imported.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
9585700876
commit
0378645c25
Notes:
github-actions[bot]
2024-12-20 14:11:20 +00:00
Author: https://github.com/tyzoid 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/0378645c25a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2725
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<body>
|
||||
<span id=test></span>
|
||||
</body>
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
var elements = document.getElementsByTagName("span");
|
||||
try {
|
||||
Object.defineProperty(elements, 'test', { value: 5 });
|
||||
println("[Fail] Object.defineProperty(HTMLCollection, key, value) succeeds");
|
||||
} catch (e) {
|
||||
println("[Pass] Object.defineProperty(HTMLCollection, key, value) throws");
|
||||
}
|
||||
|
||||
try {
|
||||
(function() { "use strict"; elements['test'] = 5; })();
|
||||
println("[Fail] \"use strict\"; HTMLCollection[key] setter succeeds");
|
||||
} catch (e) {
|
||||
println("[Pass] \"use strict\"; HTMLCollection[key] setter throws");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user