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 Nov 21, 2019
1 parent 1b84175 commit 7e0f90e
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 @@ -327,7 +327,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 @@ -351,14 +351,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 @@ -373,7 +373,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 @@ -387,11 +387,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 @@ -415,7 +415,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 7e0f90e

Please sign in to comment.