Skip to content

Commit

Permalink
domain: rename var to let and const
Browse files Browse the repository at this point in the history
PR-URL: #30312
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
marystogova authored and MylesBorins committed Dec 17, 2019
1 parent 13f65d1 commit 574b0f2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Domain.prototype.members = undefined;

// Called by process._fatalException in case an error was thrown.
Domain.prototype._errorHandler = function(er) {
var caught = false;
let caught = false;

if ((typeof er === 'object' && er !== null) || typeof er === 'function') {
Object.defineProperty(er, 'domain', {
Expand Down Expand Up @@ -324,7 +324,7 @@ Domain.prototype.add = function(ee) {
// e.add(d);
// e.emit('error', er); // RangeError, stack overflow!
if (this.domain && (ee instanceof Domain)) {
for (var d = this.domain; d; d = d.domain) {
for (let d = this.domain; d; d = d.domain) {
if (ee === d) return;
}
}
Expand All @@ -348,14 +348,14 @@ Domain.prototype.remove = function(ee) {


Domain.prototype.run = function(fn) {
var ret;
let ret;

this.enter();
if (arguments.length >= 2) {
var len = arguments.length;
var args = new Array(len - 1);
const len = arguments.length;
const args = new Array(len - 1);

for (var i = 1; i < len; i++)
for (let i = 1; i < len; i++)
args[i - 1] = arguments[i];

ret = fn.apply(this, args);
Expand All @@ -370,7 +370,7 @@ Domain.prototype.run = function(fn) {

function intercepted(_this, self, cb, fnargs) {
if (fnargs[0] && fnargs[0] instanceof Error) {
var er = fnargs[0];
const er = fnargs[0];
er.domainBound = cb;
er.domainThrown = false;
Object.defineProperty(er, 'domain', {
Expand All @@ -384,11 +384,11 @@ function intercepted(_this, self, cb, fnargs) {
}

const args = [];
var i, ret;
let ret;

self.enter();
if (fnargs.length > 1) {
for (i = 1; i < fnargs.length; i++)
for (let i = 1; i < fnargs.length; i++)
args.push(fnargs[i]);
ret = cb.apply(_this, args);
} else {
Expand All @@ -412,7 +412,7 @@ Domain.prototype.intercept = function(cb) {


function bound(_this, self, cb, fnargs) {
var ret;
let ret;

self.enter();
if (fnargs.length > 0)
Expand Down

0 comments on commit 574b0f2

Please sign in to comment.