Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
https://bugs.webkit.org/show_bug.cgi?id=176810 Reviewed by Saam Barati. JSTests: Add tests for the DontEnum filtering, and variations of other tests take the DontEnum-filtering path. * stress/proxy-own-keys.js: (i.catch): (set assert): (set add): (let.set new): (get let): Source/JavaScriptCore: This adds conditional logic following the invariant checks, to perform filtering in common uses of getOwnPropertyNames. While this would ideally only be done in JSPropertyNameEnumerator, adding the filtering to ProxyObject::performGetOwnPropertyNames maintains the invariant that the EnumerationMode is properly followed. * runtime/PropertyNameArray.h: (JSC::PropertyNameArray::reset): * runtime/ProxyObject.cpp: (JSC::ProxyObject::performGetOwnPropertyNames): Source/WebCore: Previously, there was a comment here indicating uncertainty of whether it was necessary to filter DontEnum properties explicitly or not. It turns out that it was necessary in the case of JSC ProxyObjects. This patch adds DontEnum filtering for ProxyObjects, however we continue to explicitly filter them in JSDOMConvertRecord, which needs to use the property descriptor after filtering. This change prevents observably fetching the property descriptor twice per property. * bindings/js/JSDOMConvertRecord.h: Canonical link: https://commits.webkit.org/210931@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
182 additions
and 12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -55,6 +55,12 @@ class PropertyNameArray { | ||
{ | ||
} | ||
|
||
void reset() | ||
{ | ||
m_set.clear(); | ||
m_data = PropertyNameArrayData::create(); | ||
} | ||
|
||
VM* vm() { return m_vm; } | ||
|
||
void add(uint32_t index) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters