-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JSC] Throw RangeError if Set methods are called on an object with ne…
…gative "size" property https://bugs.webkit.org/show_bug.cgi?id=267494 <rdar://problem/121310940> Reviewed by Justin Michaud and Yusuke Suzuki. This change implements steps 6-7 of GetSetRecord [1], ensuring a RangeError is thrown if result of ToIntegerOrInfinity is negative, and extracts always-inlineable @getSetSizeAsInt(). These methods are at stage 3 of ECMA-262 standardization process, meaning we shouldn't worry too much about performance impact. Aligns JSC with V8, preventing most of newly-added Set methods from returning wrong results when given an malformed Set-like object. [1]: https://tc39.es/proposal-set-methods/#sec-getsetrecord * JSTests/stress/set-prototype-difference.js: * JSTests/stress/set-prototype-intersection.js: * JSTests/stress/set-prototype-isDisjointfrom.js: * JSTests/stress/set-prototype-isSubsetOf.js: * JSTests/stress/set-prototype-isSupersetOf.js: * JSTests/stress/set-prototype-symmetricDifference.js: * JSTests/stress/set-prototype-union.js: * Source/JavaScriptCore/builtins/SetPrototype.js: (linkTimeConstant.alwaysInline.getSetSizeAsInt): (isSubsetOf): Canonical link: https://commits.webkit.org/274009@main
- Loading branch information
Alexey Shvayka
committed
Feb 2, 2024
1 parent
91c1a5e
commit eeda728
Showing
8 changed files
with
96 additions
and
63 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
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