-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
lib,src: split up big builtin scripts #2714
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,16 @@ | |
module.exports = Readable; | ||
Readable.ReadableState = ReadableState; | ||
|
||
const EE = require('events').EventEmitter; | ||
const Stream = require('stream'); | ||
const Buffer = require('buffer').Buffer; | ||
const util = require('util'); | ||
const debug = util.debuglog('stream'); | ||
const EE = require('events').EventEmitter; | ||
const Stream = require('internal/stream'); | ||
const debug = require('internal/debuglog')('stream'); | ||
const inherits = require('internal/inherits'); | ||
|
||
var Duplex; // Break recursive dependency with _stream_duplex.js. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like it should be unnecessary, since |
||
var StringDecoder; | ||
|
||
util.inherits(Readable, Stream); | ||
inherits(Readable, Stream); | ||
|
||
function ReadableState(options, stream) { | ||
options = options || {}; | ||
|
@@ -19,7 +21,10 @@ function ReadableState(options, stream) { | |
// make all the buffer merging and length checks go away | ||
this.objectMode = !!options.objectMode; | ||
|
||
if (stream instanceof Stream.Duplex) | ||
if (Duplex === undefined) | ||
Duplex = require('_stream_duplex'); | ||
|
||
if (stream instanceof Duplex) | ||
this.objectMode = this.objectMode || !!options.readableObjectMode; | ||
|
||
// the point at which it stops calling _read() to fill the buffer | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
|
||
module.exports = function assert(expression, message) { | ||
if (!expression) | ||
throw new Error(`Internal assertion failed: ${message || 'no message'}`); | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
const debugs = {}; | ||
var debugEnviron; | ||
var format; | ||
|
||
module.exports = function(set) { | ||
if (debugEnviron === undefined) | ||
debugEnviron = process.env.NODE_DEBUG || ''; | ||
set = set.toUpperCase(); | ||
if (!debugs[set]) { | ||
if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { | ||
var pid = process.pid; | ||
debugs[set] = function() { | ||
if (format === undefined) | ||
format = require('internal/format'); | ||
const msg = format.apply(exports, arguments); | ||
console.error('%s %d: %s', set, pid, msg); | ||
}; | ||
} else { | ||
debugs[set] = function() {}; | ||
} | ||
} | ||
return debugs[set]; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; | ||
|
||
var uv; | ||
|
||
module.exports = function errnoException(err, syscall, original) { | ||
if (uv === undefined) | ||
uv = process.binding('uv'); | ||
var errname = uv.errname(err); | ||
var message = syscall + ' ' + errname; | ||
if (original) | ||
message += ' ' + original; | ||
var e = new Error(message); | ||
e.code = errname; | ||
e.errno = errname; | ||
e.syscall = syscall; | ||
return e; | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EventEmitter
at the end could be removed along with this change I guess.