diff options
author | Rich Trott <rtrott@gmail.com> | 2016-10-15 15:02:43 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-10-19 22:20:27 -0700 |
commit | 68ba9aa0fb6693a1fb5dd114a3ddbe447517c0dd (patch) | |
tree | 9aa5e49fe6db669b58078dbbfcb2231b93e3b93d /lib | |
parent | 4b65a65e75f48ff447cabd5500ce115fb5ad4c57 (diff) | |
download | android-node-v8-68ba9aa0fb6693a1fb5dd114a3ddbe447517c0dd.tar.gz android-node-v8-68ba9aa0fb6693a1fb5dd114a3ddbe447517c0dd.tar.bz2 android-node-v8-68ba9aa0fb6693a1fb5dd114a3ddbe447517c0dd.zip |
test,lib,benchmark: match function names
In most cases, named functions match the variable or property to which
they are being assigned. That also seems to be the practice in a series
of PRs currently being evaluated that name currently-anonymous
functions.
This change applies that rule to instances in the code base that don't
comply with that practice.
This will be enforceable with a lint rule once we upgrade to ESLint
3.8.0.
PR-URL: https://github.com/nodejs/node/pull/9113
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_stream_wrap.js | 4 | ||||
-rw-r--r-- | lib/_stream_writable.js | 2 | ||||
-rw-r--r-- | lib/_tls_legacy.js | 6 | ||||
-rw-r--r-- | lib/_tls_wrap.js | 6 | ||||
-rw-r--r-- | lib/domain.js | 2 | ||||
-rw-r--r-- | lib/fs.js | 2 | ||||
-rw-r--r-- | lib/net.js | 2 | ||||
-rw-r--r-- | lib/repl.js | 2 |
8 files changed, 13 insertions, 13 deletions
diff --git a/lib/_stream_wrap.js b/lib/_stream_wrap.js index 7eb3008484..fbc3296598 100644 --- a/lib/_stream_wrap.js +++ b/lib/_stream_wrap.js @@ -159,7 +159,7 @@ function QueueItem(type, req) { this.next = this; } -StreamWrap.prototype._enqueue = function enqueue(type, req) { +StreamWrap.prototype._enqueue = function _enqueue(type, req) { const item = new QueueItem(type, req); if (this._list === null) { this._list = item; @@ -174,7 +174,7 @@ StreamWrap.prototype._enqueue = function enqueue(type, req) { return item; }; -StreamWrap.prototype._dequeue = function dequeue(item) { +StreamWrap.prototype._dequeue = function _dequeue(item) { assert(item instanceof QueueItem); var next = item.next; diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index 816810234d..524f6dcdb2 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -117,7 +117,7 @@ function WritableState(options, stream) { this.corkedRequestsFree = new CorkedRequest(this); } -WritableState.prototype.getBuffer = function writableStateGetBuffer() { +WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { diff --git a/lib/_tls_legacy.js b/lib/_tls_legacy.js index b064b245d6..f974b0cfc0 100644 --- a/lib/_tls_legacy.js +++ b/lib/_tls_legacy.js @@ -139,7 +139,7 @@ CryptoStream.prototype.init = function init() { }; -CryptoStream.prototype._write = function write(data, encoding, cb) { +CryptoStream.prototype._write = function _write(data, encoding, cb) { assert(this._pending === null); // Black-hole data @@ -220,7 +220,7 @@ CryptoStream.prototype._write = function write(data, encoding, cb) { }; -CryptoStream.prototype._writePending = function writePending() { +CryptoStream.prototype._writePending = function _writePending() { const data = this._pending; const encoding = this._pendingEncoding; const cb = this._pendingCallback; @@ -232,7 +232,7 @@ CryptoStream.prototype._writePending = function writePending() { }; -CryptoStream.prototype._read = function read(size) { +CryptoStream.prototype._read = function _read(size) { // XXX: EOF?! if (!this.pair.ssl) return this.push(null); diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index f3526c7033..c31ae76651 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -304,7 +304,7 @@ proxiedMethods.forEach(function(name) { }; }); -tls_wrap.TLSWrap.prototype.close = function closeProxy(cb) { +tls_wrap.TLSWrap.prototype.close = function close(cb) { if (this.owner) this.owner.ssl = null; @@ -340,10 +340,10 @@ TLSSocket.prototype._wrapHandle = function(wrap) { res._secureContext = context; res.reading = handle.reading; Object.defineProperty(handle, 'reading', { - get: function readingGetter() { + get: function get() { return res.reading; }, - set: function readingSetter(value) { + set: function set(value) { res.reading = value; } }); diff --git a/lib/domain.js b/lib/domain.js index 355c09c6e9..c86af75c86 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -58,7 +58,7 @@ Domain.prototype._disposed = undefined; // Called by process._fatalException in case an error was thrown. -Domain.prototype._errorHandler = function errorHandler(er) { +Domain.prototype._errorHandler = function _errorHandler(er) { var caught = false; // ignore errors on disposed domains. @@ -749,7 +749,7 @@ fs.truncate = function(path, len, callback) { fs.open(path, 'r+', function(er, fd) { if (er) return callback(er); var req = new FSReqWrap(); - req.oncomplete = function ftruncateCb(er) { + req.oncomplete = function oncomplete(er) { fs.close(fd, function(er2) { callback(er || er2); }); diff --git a/lib/net.js b/lib/net.js index 31f1c31bf3..628908614f 100644 --- a/lib/net.js +++ b/lib/net.js @@ -198,7 +198,7 @@ function Socket(options) { } util.inherits(Socket, stream.Duplex); -Socket.prototype._unrefTimer = function unrefTimer() { +Socket.prototype._unrefTimer = function _unrefTimer() { for (var s = this; s !== null; s = s._parent) timers._unrefActive(s); }; diff --git a/lib/repl.js b/lib/repl.js index 620addc5ef..470b42a0b7 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -664,7 +664,7 @@ exports.start = function(prompt, return repl; }; -REPLServer.prototype.close = function replClose() { +REPLServer.prototype.close = function close() { if (this.terminal && this._flushing && !this._closingOnFlush) { this._closingOnFlush = true; this.once('flushHistory', () => |