Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: eed6352f9b2365ff23dac63c6969040d14d72a68
https://github.com/WebKit/WebKit/commit/eed6352f9b2365ff23dac63c6969040d14d72a68
Author: Keith Miller <[email protected]>
Date: 2024-08-21 (Wed, 21 Aug 2024)
Changed paths:
A JSTests/stress/static-property-table-reconfigure-non-enumerable.js
M Source/JavaScriptCore/runtime/JSObjectInlines.h
Log Message:
-----------
Object.keys(global) includes non-enumerable properties unless delete'd first
https://bugs.webkit.org/show_bug.cgi?id=277899
rdar://134121649
Reviewed by Yusuke Suzuki.
Right now when we reconfigure a static property we simply shadow it on the
structure
without reifying the static table. This works for normal property access but
getNonReifiedStaticPropertyNames wasn't checking if the property had been
shadowed.
So it was still adding the static property to the list. With this change
getNonReifiedStaticPropertyNames now checks if there's a shadowing property and
skips it when necessary.
I think there's still an issue with reconfigured properties being incorrectly
ordered when reified e.g.
```
print(Object.keys(objectWithStaticProperties)); // bar,baz,foo
makeNotEnum(objectWithStaticProperties, "foo");
delete objectWithStaticProperties.bar;
print(Object.keys(objectWithStaticProperties)); // foo,baz
```
But it seems like reifying static properties reorders all names anyway so it's
not clear how big of an issue this is.
* JSTests/stress/static-property-table-reconfigure-non-enumerable.js: Added.
* Source/JavaScriptCore/runtime/JSObjectInlines.h:
(JSC::JSObject::getNonReifiedStaticPropertyNames):
Canonical link: https://commits.webkit.org/282554@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes