Skip to content

add error stack accessor tests#5045

Merged
ljharb merged 7 commits into
mainfrom
error-stack-accessor
May 21, 2026
Merged

add error stack accessor tests#5045
ljharb merged 7 commits into
mainfrom
error-stack-accessor

Conversation

@ljharb

@ljharb ljharb commented May 7, 2026

Copy link
Copy Markdown
Member

@ljharb ljharb requested review from a team as code owners May 7, 2026 20:47

@gibson042 gibson042 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is good (and very thorough), but I'd like to see the files refactored for better accessibility (e.g., my review time could have been cut in half if there were fewer files that pretty much only differ in features).

Comment thread test/built-ins/Error/prototype/stack/prop-desc.js Outdated
Comment on lines +21 to +29
var nativeErrors = [
Error,
EvalError,
RangeError,
ReferenceError,
SyntaxError,
TypeError,
URIError
];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm surprised not to see this already defined in a harness file; consider adding it.

Comment thread test/built-ins/Error/prototype/stack/getter-error-prototype.js Outdated
Comment thread test/built-ins/Error/prototype/stack/getter-no-error-data-arraybuffer.js Outdated
Comment thread test/built-ins/Error/prototype/stack/getter-no-error-data.js
Comment thread test/built-ins/Error/prototype/stack/getter-this-not-object.js
Comment thread test/built-ins/Error/prototype/stack/setter-aggregate-error.js Outdated
Comment thread test/built-ins/Error/prototype/stack/getter-null-proto-receiver.js Outdated
Comment thread test/built-ins/Error/prototype/stack/setter-receiver-is-proxy.js
ljharb added 3 commits May 21, 2026 15:04
Address review feedback on #5045:

- prop-desc.js now uses verifyPrimordialAccessorProperty, subsuming the separate getter-/setter-length.js and getter-/setter-name.js files.
- Merge the per-type no-error-data files (ArrayBuffer, Map, Set, WeakMap, WeakSet, Promise, TypedArray) and getter-null-proto-receiver into getter-no-error-data.js using dynamic filtering.
- Merge getter-this-not-object-{bigint,symbol}.js into getter-this-not-object.js; same for the setter and for setter-non-string-value.
- Merge getter-aggregate-error.js, getter-suppressed-error.js, and their *-prototype counterparts into getter-error-instance.js and getter-error-prototype.js with dynamic filtering. Same shape on the setter side via setter-creates-own-property.js and setter-receiver-is-other-prototype.js.
- Use allowProxyTraps (proxyTrapsHelper.js) for the proxy receiver tests so unrelated traps fail loudly.
- Rename {getter,setter}-null-proto-receiver.js to {getter,setter}-receiver-is-null-proto.js and {getter,setter}-proxy-receiver.js to {getter,setter}-receiver-is-proxy.js.
A test that wires several proxies through allowProxyTraps has no way to distinguish which one triggered an unexpected trap call.
Add an optional second-positional label argument; when present it is prefixed onto each Test262Error message.

Backward compatible: existing callers pass at most one argument and continue to receive unprefixed messages.
@ljharb ljharb force-pushed the error-stack-accessor branch from 786fb8b to 26218d2 Compare May 21, 2026 13:12

@gibson042 gibson042 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

Comment thread harness/proxyTrapsHelper.js Outdated
Comment thread test/built-ins/Error/prototype/stack/getter-error-instance.js Outdated
Comment thread test/built-ins/Error/prototype/stack/getter-error-prototype.js Outdated
Comment thread test/built-ins/Error/prototype/stack/setter-creates-own-property.js Outdated
Comment thread test/built-ins/Error/prototype/stack/setter-receiver-is-other-prototype.js Outdated
@ljharb

ljharb commented May 21, 2026

Copy link
Copy Markdown
Member Author

all done. i'll merge this, and i'll happily make any further changes in a followup.

@ljharb ljharb merged commit 227d905 into main May 21, 2026
21 checks passed
@ljharb ljharb deleted the error-stack-accessor branch May 21, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants