Skip to content

Commit 92abd77

Browse files
committed
fix: skip test_exceptions where proxy handler throws aren't reported
1 parent 0f09aed commit 92abd77

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎implementors/node/features.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,10 @@ globalThis.runtimeFeatures = {
3131
major > 25 ||
3232
(major === 25 && minor >= 4) ||
3333
(major === 24 && (minor > 13 || (minor === 13 && patch >= 1))),
34+
35+
// Object APIs report a throwing proxy handler as napi_pending_exception only
36+
// since Node.js v22.0.0 (nodejs/node@52fcf14258b). It was not backported to
37+
// v20.x, where the exception is left pending but the call reports another
38+
// status, so the throw escapes the addon instead.
39+
proxyHandlerExceptions: major >= 22,
3440
};

‎tests/js-native-api/test_object/test_exceptions.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
// A runtime whose object APIs don't surface a throwing proxy handler as a
2+
// pending exception leaves the throw to escape the addon entirely, so there is
3+
// nothing meaningful to assert there.
4+
if (!runtimeFeatures.proxyHandlerExceptions) {
5+
skipTest();
6+
}
7+
18
const { testExceptions } = loadAddon('test_exceptions');
29

310
function throws() {

0 commit comments

Comments
 (0)