forked from polarsignals/custom-labels
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode-flags.js
More file actions
16 lines (14 loc) · 703 Bytes
/
Copy pathnode-flags.js
File metadata and controls
16 lines (14 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict';
// Node flags needed to make AsyncContextFrame — the writer's discovery
// substrate — available on the running Node.
//
// Node 22/23 need the --experimental-async-context-frame opt-in. Node 24
// turned ACF on by default and *removed* the flag, so passing it there is a
// hard `node: bad option` failure rather than a no-op. Anything that spawns a
// Node process for these tests has to compute the list rather than hardcode
// it; that includes `npm test` itself (see run.js).
function acfFlags() {
const major = Number(process.versions.node.split('.')[0]);
return major >= 22 && major < 24 ? ['--experimental-async-context-frame'] : [];
}
module.exports = { acfFlags };