File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ globalThis.experimentalFeatures = {
88 postFinalizer : true ,
99} ;
1010
11- globalThis . napiVersion = Number ( process . versions . napi ) ;
12-
1311globalThis . skipTest = ( ) => {
1412 process . exit ( 0 ) ;
1513} ;
Original file line number Diff line number Diff line change 1+ globalThis . napiVersion = Number ( process . versions . napi ) ;
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ const MUST_CALL_MODULE_PATH = path.join(
4040 "node" ,
4141 "must-call.js"
4242) ;
43+ const NAPI_VERSION_MODULE_PATH = path . join (
44+ ROOT_PATH ,
45+ "implementors" ,
46+ "node" ,
47+ "napi-version.js"
48+ ) ;
4349
4450export function listDirectoryEntries ( dir : string ) {
4551 const entries = fs . readdirSync ( dir , { withFileTypes : true } ) ;
@@ -80,6 +86,8 @@ export function runFileInSubprocess(
8086 "file://" + GC_MODULE_PATH ,
8187 "--import" ,
8288 "file://" + MUST_CALL_MODULE_PATH ,
89+ "--import" ,
90+ "file://" + NAPI_VERSION_MODULE_PATH ,
8391 filePath ,
8492 ] ,
8593 { cwd }
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ // napiVersion is a positive integer
4+ if ( typeof napiVersion !== 'number' || napiVersion < 1 || ! Number . isInteger ( napiVersion ) ) {
5+ throw new Error ( 'Expected a global napiVersion that is a positive integer' ) ;
6+ }
You can’t perform that action at this time.
0 commit comments