Skip to content

Commit

Permalink
chore: use node version 18.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr committed Dec 31, 2024
1 parent 0e8174b commit 152d787
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 33 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
npm install readable-stream
```

This package is a mirror of the streams implementations in Node.js 18.20.5.
This package is a mirror of the streams implementations in Node.js 18.19.0.

Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v18.20.5/docs/api/stream.html).
Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v18.19.0/docs/api/stream.html).

If you want to guarantee a stable streams base, regardless of what version of
Node you, or the users of your libraries are using, use **readable-stream** _only_ and avoid the _"stream"_ module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
Expand Down
5 changes: 4 additions & 1 deletion lib/internal/streams/destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function constructNT(stream) {
} else if (err) {
errorOrDestroy(stream, err, true)
} else {
stream.emit(kConstruct)
process.nextTick(emitConstructNT, stream)
}
}
try {
Expand All @@ -236,6 +236,9 @@ function constructNT(stream) {
process.nextTick(onConstruct, err)
}
}
function emitConstructNT(stream) {
stream.emit(kConstruct)
}
function isRequest(stream) {
return (stream === null || stream === undefined ? undefined : stream.setHeader) && typeof stream.abort === 'function'
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"./lib/ours/index.js": "./lib/ours/browser.js"
},
"scripts": {
"build": "node build/build.mjs 18.20.5",
"build": "node build/build.mjs 18.19.0",
"postbuild": "prettier -w lib test",
"test": "tap --rcfile=./tap.yml test/parallel/test-*.js test/ours/test-*.js",
"test:prepare": "node test/browser/runner-prepare.mjs",
Expand Down
32 changes: 4 additions & 28 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,8 @@ const { atob, btoa } = require('buffer')
if (isMainThread) process.umask(0o022)
const noop = () => {}
const hasCrypto = Boolean(process.versions.openssl) && !process.env.NODE_SKIP_CRYPTO

// Synthesize OPENSSL_VERSION_NUMBER format with the layout 0xMNN00PPSL
const opensslVersionNumber = (major = 0, minor = 0, patch = 0) => {
assert(major >= 0 && major <= 0xf)
assert(minor >= 0 && minor <= 0xff)
assert(patch >= 0 && patch <= 0xff)
return (major << 28) | (minor << 20) | (patch << 4)
}
let OPENSSL_VERSION_NUMBER
const hasOpenSSL = (major = 0, minor = 0, patch = 0) => {
if (!hasCrypto) return false
if (OPENSSL_VERSION_NUMBER === undefined) {
const regexp = /(?<m>\d+)\.(?<n>\d+)\.(?<p>\d+)/
const { m, n, p } = process.versions.openssl.match(regexp).groups
OPENSSL_VERSION_NUMBER = opensslVersionNumber(m, n, p)
}
return OPENSSL_VERSION_NUMBER >= opensslVersionNumber(major, minor, patch)
}
const hasOpenSSL3 = hasCrypto && require('crypto').constants.OPENSSL_VERSION_NUMBER >= 0x30000000
const hasOpenSSL31 = hasCrypto && require('crypto').constants.OPENSSL_VERSION_NUMBER >= 0x30100000
const hasQuic = hasCrypto && !!process.config.variables.openssl_quic
function parseTestFlags(filename = process.argv[1]) {
// The copyright notice is relatively big and the flags could come afterwards.
Expand Down Expand Up @@ -842,7 +826,8 @@ const common = {
getTTYfd,
hasIntl,
hasCrypto,
hasOpenSSL,
hasOpenSSL3,
hasOpenSSL31,
hasQuic,
hasMultiLocalhost,
invalidArgTypeHelper,
Expand Down Expand Up @@ -898,15 +883,6 @@ const common = {
return re.test(name) && iFaces[name].some(({ family }) => family === 'IPv6')
})
},
get hasOpenSSL3() {
return hasOpenSSL(3)
},
get hasOpenSSL31() {
return hasOpenSSL(3, 1)
},
get hasOpenSSL32() {
return hasOpenSSL(3, 2)
},
get inFreeBSDJail() {
if (inFreeBSDJail !== null) return inFreeBSDJail
if (exports.isFreeBSD && execSync('sysctl -n security.jail.jailed').toString() === '1\n') {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/tz-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024a
2023c

0 comments on commit 152d787

Please sign in to comment.