Skip to content

harness: Add a verifyCallableProperty helper#4468

Merged
gibson042 merged 4 commits intotc39:mainfrom
gibson042:2025-05-verifycallableproperty
May 14, 2025
Merged

harness: Add a verifyCallableProperty helper#4468
gibson042 merged 4 commits intotc39:mainfrom
gibson042:2025-05-verifycallableproperty

Conversation

@gibson042
Copy link
Member

ECMAScript Standard Built-in Objects specifies non-writable non-enumerable "length" and "name" properties for all built-in functions, but test262 coverage of this is a) incomplete, and b) noisy [in the form of length.js and name.js files for covered functions].

This PR addresses both issues by introducing a helper to be used in prop-desc.js files for relevant functions, covering their callability, property descriptor attributes, and length/name property descriptors (actually two helpers, with the one for primordial properties intended to be overridden in hardened environments with a version that requires non-configurability).

It is currently only used for global is{Finite,NaN} and parse{Int,Float} functions as a proof of concept (and to limit review burden), but should be capable of covering every function in the spec.

@gibson042 gibson042 requested a review from a team as a code owner May 5, 2025 22:33
Copy link
Contributor

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No opinion on redundant value so I'll defer to Ms2ger on that, but overall I love this helper

@anba
Copy link
Contributor

anba commented May 12, 2025

test262 coverage of this is a) incomplete

Did we regress coverage that much since #457 and #505?

@gibson042 gibson042 force-pushed the 2025-05-verifycallableproperty branch from 8dcb9c8 to 43243e7 Compare May 14, 2025 16:04
@gibson042 gibson042 merged commit 25278a1 into tc39:main May 14, 2025
11 checks passed
gibson042 added a commit to gibson042/test262 that referenced this pull request May 28, 2025
Ref tc39#4468

Match the data property defaults from
https://tc39.es/ecma262/multipage/ecmascript-standard-built-in-objects.html
(writable true, enumerable false, configurable true).
gibson042 added a commit to gibson042/test262 that referenced this pull request May 28, 2025
Ref tc39#4468

Match the data property defaults from
https://tc39.es/ecma262/multipage/ecmascript-standard-built-in-objects.html
(writable true, enumerable false, configurable true).
gibson042 added a commit to gibson042/test262 that referenced this pull request May 28, 2025
Ref tc39#4468

Match the data property defaults from
https://tc39.es/ecma262/multipage/ecmascript-standard-built-in-objects.html
(writable true, enumerable false, configurable true).
gibson042 added a commit that referenced this pull request May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants