File tree Expand file tree Collapse file tree
tests/js-native-api/test_dataview Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ export default defineConfig([
102102 gc : 'readonly' ,
103103 gcUntil : 'readonly' ,
104104 experimentalFeatures : 'readonly' ,
105+ runtimeFeatures : 'readonly' ,
105106 onUncaughtException : 'readonly' ,
106107 napiVersion : 'readonly' ,
107108 skipTest : 'readonly' ,
Original file line number Diff line number Diff line change 1- // Declares which experimental Node-API features this runtime supports.
2- // Each key corresponds to a NODE_API_EXPERIMENTAL_HAS_* compile-time macro.
1+ // Declares which Node-API features this runtime supports, for tests to gate on.
32// Other implementors should set unsupported features to false or omit them.
43
54const [ major , minor , patch ] = process . version . slice ( 1 ) . split ( '.' ) . map ( Number ) ;
65
6+ // Experimental features behind the NAPI_EXPERIMENTAL define. Each key
7+ // corresponds to a NODE_API_EXPERIMENTAL_HAS_* compile-time macro.
78globalThis . experimentalFeatures = {
89 // node_api_is_sharedarraybuffer and node_api_create_sharedarraybuffer were
910 // added in Node.js v24.9.0. Earlier versions do not export these symbols,
@@ -12,6 +13,10 @@ globalThis.experimentalFeatures = {
1213 createObjectWithProperties : true ,
1314 setPrototype : true ,
1415 postFinalizer : true ,
16+ } ;
17+
18+ // Version-dependent behaviors of stable (non-experimental) Node-API.
19+ globalThis . runtimeFeatures = {
1520 // napi_create_dataview accepts a SharedArrayBuffer-backed buffer only since
1621 // Node.js v24.13.1 and v25.4.0 (nodejs/node#60473). It was not backported to
1722 // v20.x or v22.x, where such calls fail with "invalid argument".
Original file line number Diff line number Diff line change 22
33// napi_create_dataview accepts a SharedArrayBuffer-backed buffer only on newer
44// Node.js releases (see implementors/node/features.js).
5- if ( ! experimentalFeatures . dataviewSharedArrayBuffer ) {
5+ if ( ! runtimeFeatures . dataviewSharedArrayBuffer ) {
66 skipTest ( ) ;
77}
88
You can’t perform that action at this time.
0 commit comments