Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build 8.9.4 #320

Merged
merged 9 commits into from
Feb 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,8 @@ matrix:
env: TASK=test
- node_js: 8
env: TASK=test
- node_js: 6
env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest"
- node_js: 6
env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest"
- node_js: 6
env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="-3..latest"
- node_js: 6
env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="-3..latest"
- node_js: 6
env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest"
- node_js: 6
env: TASK=browser BROWSER_NAME=microsoftedge BROWSER_VERSION=latest
- node_js: 9
env: TASK=test
script: "npm run $TASK"
env:
global:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# readable-stream

***Node-core v8.1.3 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)
***Node-core v8.9.4 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)


[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)
Expand All @@ -18,7 +18,7 @@ npm install --save readable-stream
This package is a mirror of the Streams2 and Streams3 implementations in
Node-core.

Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.1.3/docs/api/stream.html).
Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/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
60 changes: 40 additions & 20 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,30 @@ function processFile (inputLoc, out, replacements) {
data = data.replace(regexp, arg2)
})
if (inputLoc.slice(-3) === '.js') {
const transformed = babel.transform(data, {
plugins: [
'transform-es2015-parameters',
'transform-es2015-arrow-functions',
'transform-es2015-block-scoping',
'transform-es2015-template-literals',
'transform-es2015-shorthand-properties',
'transform-es2015-for-of',
['transform-es2015-classes', { loose: true }],
'transform-es2015-destructuring',
'transform-es2015-computed-properties',
'transform-es2015-spread'
]
})
data = transformed.code
try {
const transformed = babel.transform(data, {
plugins: [
'transform-es2015-parameters',
'transform-es2015-arrow-functions',
'transform-es2015-block-scoping',
'transform-es2015-template-literals',
'transform-es2015-shorthand-properties',
'transform-es2015-for-of',
['transform-es2015-classes', { loose: true }],
'transform-es2015-destructuring',
'transform-es2015-computed-properties',
'transform-es2015-spread'
]
})
data = transformed.code
} catch (err) {
fs.writeFile(out + '.errored.js', data, encoding, function () {
console.log('Wrote errored', out)

throw err
})
return
}
}
fs.writeFile(out, data, encoding, function (err) {
if (err) throw err
Expand Down Expand Up @@ -140,6 +149,8 @@ pump(
file !== 'test-stream-base-no-abort.js' &&
file !== 'test-stream-preprocess.js' &&
file !== 'test-stream-inheritance.js' &&
file !== 'test-stream-base-prototype-accessors.js' &&
file !== 'test-stream-base-prototype-accessors-enumerability.js' &&
file !== 'test-stream-base-typechecking.js') {
processTestFile(file)
}
Expand All @@ -150,11 +161,20 @@ pump(
//--------------------------------------------------------------------
// Grab the nodejs/node test/common.js

processFile(
testsrcurl.replace(/parallel\/$/, 'common/index.js')
, path.join(testourroot, '../common.js')
, testReplace['common.js']
)
glob(path.join(src, 'test/common/*'), function (err, list) {
if (err) {
throw err
}

list.forEach(function (file) {
file = path.basename(file)
processFile(
path.join(testsrcurl.replace(/parallel\/$/, 'common/'), file)
, path.join(testourroot.replace('parallel', 'common'), file)
, testReplace['common.js']
)
})
})

//--------------------------------------------------------------------
// Update Node version in README
Expand Down
2 changes: 1 addition & 1 deletion build/common-replacements.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports.altForEachImplReplacement = [
]

module.exports.altForEachUseReplacement = [
/(\W)([\w\.\(\),\[\]]+)(\.forEach\()/gm
/(\W)([\w\.\(\),\[\] ']+)(\.forEach\()/gm
, '$1forEach($2, '
]

Expand Down
37 changes: 29 additions & 8 deletions build/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const headRegexp = /(^module.exports = \w+;?)/m
, `$1

/*<replacement>*/
var processNextTick = require(\'process-nextick-args\');
var processNextTick = require(\'process-nextick-args\').nextTick;
/*</replacement>*/
`
]
Expand Down Expand Up @@ -159,10 +159,11 @@ const headRegexp = /(^module.exports = \w+;?)/m
`
]
, safeBufferFix = [
/(?:var|const) Buffer = require\('buffer'\)\.Buffer;/,
/(?:var|const) (?:{ )Buffer(?: }) = require\('buffer'\)(?:\.Buffer)?;/,
`/*<replacement>*/
var Buffer = require('safe-buffer').Buffer
/*</replacement>*/`
var Buffer = require('safe-buffer').Buffer;
/*</replacement>*/
`
]
, internalDirectory = [
/require\('internal\/streams\/([a-zA-z]+)'\)/g,
Expand All @@ -177,8 +178,8 @@ const headRegexp = /(^module.exports = \w+;?)/m
, `function(er) { onwrite(stream, er); }`
]
, addUintStuff = [
/(?:var|const) Buffer = require\('buffer'\)\.Buffer;/
, `/*<replacement>*/
/(?:var|const) Buffer = require\('safe-buffer'\)\.Buffer;/
, `
const Buffer = require('safe-buffer').Buffer
const OurUint8Array = global.Uint8Array || function () {}
function _uint8ArrayToBuffer(chunk) {
Expand All @@ -187,7 +188,6 @@ function _uint8ArrayToBuffer(chunk) {
function _isUint8Array(obj) {
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
}
/*</replacement>*/
`
]
, addConstructors = [
Expand Down Expand Up @@ -276,6 +276,7 @@ module.exports['_stream_readable.js'] = [
, processNextTickReplacement
, eventEmittterListenerCountReplacement
, internalDirectory
, safeBufferFix
, fixUintStuff
, addUintStuff
]
Expand Down Expand Up @@ -310,16 +311,36 @@ module.exports['_stream_writable.js'] = [
, fixInstanceCheck
, removeOnWriteBind
, internalDirectory
, safeBufferFix
, fixUintStuff
, addUintStuff
, fixBufferCheck
, useWriteReq
, useCorkedRequest
, addConstructors
]

module.exports['internal/streams/BufferList.js'] = [
safeBufferFix
[
/(?:var|const) (?:{ )Buffer(?: }) = require\('buffer'\)(?:\.Buffer)?;/,
`
const Buffer = require('safe-buffer').Buffer
const util = require('util')
`
]
, fixCopyBuffer
, [
/$/,
`

if (util && util.inspect && util.inspect.custom) {
module.exports.prototype[util.inspect.custom] = function () {
const obj = util.inspect({ length: this.length });
return \`\${this.constructor.name} \${obj}\`;
}
}
`
]

]
module.exports['internal/streams/destroy.js'] = [
Expand Down
14 changes: 7 additions & 7 deletions build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"description": "",
"main": "build.js",
"dependencies": {
"babel-core": "^6.24.1",
"babel-core": "^6.26.0",
"babel-plugin-transform-es2015-arrow-functions": "^6.5.2",
"babel-plugin-transform-es2015-block-scoping": "^6.24.1",
"babel-plugin-transform-es2015-block-scoping": "^6.26.0",
"babel-plugin-transform-es2015-classes": "^6.24.1",
"babel-plugin-transform-es2015-computed-properties": "^6.24.1",
"babel-plugin-transform-es2015-destructuring": "^6.18.0",
Expand All @@ -17,10 +17,10 @@
"babel-plugin-transform-es2015-template-literals": "^6.8.0",
"bl": "^1.2.1",
"glob": "^7.1.2",
"gunzip-maybe": "^1.4.0",
"hyperquest": "^2.1.2",
"pump": "^1.0.2",
"rimraf": "^2.6.1",
"tar-fs": "^1.15.2"
"gunzip-maybe": "^1.4.1",
"hyperquest": "^2.1.3",
"pump": "^3.0.0",
"rimraf": "^2.6.2",
"tar-fs": "^1.16.0"
}
}
11 changes: 8 additions & 3 deletions build/test-replacements.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ module.exports['common.js'] = [
],
[
/require\(['"]stream['"]\)/g
, 'require(\'../\')'
, 'require(\'../../\')'
],
[
/^var util = require\('util'\);/m
Expand Down Expand Up @@ -194,8 +194,13 @@ module.exports['common.js'] = [
'}).enable();*/'
],
[
/const async_wrap = process.binding\('async_wrap'\);/,
'//const async_wrap = process.binding(\'async_wrap\');'
/(?:var|const) async_wrap = process\.binding\('async_wrap'\);\n.*(?:var|const) (?:{ )?kCheck(?: })? = async_wrap\.constants(?:\.kCheck)?;/gm,
'// const async_wrap = process.binding(\'async_wrap\');\n' +
' // const kCheck = async_wrap.constants.kCheck;'
],
[
/async_wrap\.async_hook_fields\[kCheck\] \+= 1;/,
'// async_wrap.async_hook_fields[kCheck] += 1;'
]
]

Expand Down
2 changes: 1 addition & 1 deletion lib/_stream_duplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

/*<replacement>*/

var processNextTick = require('process-nextick-args');
var processNextTick = require('process-nextick-args').nextTick;
/*</replacement>*/

/*<replacement>*/
Expand Down
Loading