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

test,lib,benchmark: match function names #9113

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Buffer.prototype.htonl = function htonl() {
return this;
};

Buffer.prototype.htonll = function htonl() {
Buffer.prototype.htonll = function htonll() {
if (this.length % 8 !== 0)
throw new RangeError();
for (var i = 0; i < this.length; i += 8) {
Expand Down
4 changes: 2 additions & 2 deletions lib/_stream_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/_stream_writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions lib/_tls_legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using get() { ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find that confusing to read. I will probably change my opinion as it becomes more common and I get used to seeing it. If there's a strong preference for it among others, I'll use it. But if left to my own devices, I prefer the explicit key: value format instead.

return res.reading;
},
set: function readingSetter(value) {
set: function set(value) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

res.reading = value;
}
});
Expand Down
2 changes: 1 addition & 1 deletion lib/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
2 changes: 1 addition & 1 deletion lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () =>
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-child-process-spawn-typeerror.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ assert.throws(function() {
// Argument types for combinatorics
const a = [];
const o = {};
const c = function callback() {};
const c = function c() {};
const s = 'string';
const u = undefined;
const n = null;
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-http-client-readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ FakeAgent.prototype.createConnection = function createConnection() {
var s = new Duplex();
var once = false;

s._read = function read() {
s._read = function _read() {
if (once)
return this.push(null);
once = true;
Expand All @@ -27,7 +27,7 @@ FakeAgent.prototype.createConnection = function createConnection() {
};

// Blackhole
s._write = function write(data, enc, cb) {
s._write = function _write(data, enc, cb) {
cb();
};

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-repl-persistent-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const tests = [
expected: [prompt, replFailedRead, prompt, replDisabled, prompt]
},
{ // Make sure this is always the last test, since we change os.homedir()
before: function mockHomedirFailure() {
before: function before() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: shorthand syntax

// Mock os.homedir() failure
os.homedir = function() {
throw new Error('os.homedir() failure');
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-repl-tab-complete.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ const testCustomCompleterSyncMode = repl.start({
prompt: '',
input: putIn,
output: putIn,
completer: function completerSyncMode(line) {
completer: function completer(line) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here and on line 326.

const hits = customCompletions.filter((c) => {
return c.indexOf(line) === 0;
});
Expand Down Expand Up @@ -323,7 +323,7 @@ const testCustomCompleterAsyncMode = repl.start({
prompt: '',
input: putIn,
output: putIn,
completer: function completerAsyncMode(line, callback) {
completer: function completer(line, callback) {
const hits = customCompletions.filter((c) => {
return c.indexOf(line) === 0;
});
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-tls-server-large-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function Mediator() {
}
util.inherits(Mediator, stream.Writable);

Mediator.prototype._write = function write(data, enc, cb) {
Mediator.prototype._write = function _write(data, enc, cb) {
this.buf += data;
setTimeout(cb, 0);

Expand Down