Skip to content
Permalink
Browse files

domain: rename var to let and const

PR-URL: #30312
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <Michael_Dawson@ca.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
marystogova authored and MylesBorins committed Nov 6, 2019
1 parent 13f65d1 commit 574b0f2104329ee8c6482a46713c92cc067fefab
Showing with 10 additions and 10 deletions.
  1. +10 −10 lib/domain.js
@@ -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', {
@@ -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;
}
}
@@ -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);
@@ -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', {
@@ -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 {
@@ -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)

0 comments on commit 574b0f2

Please sign in to comment.
You can’t perform that action at this time.