Skip to content

Commit

Permalink
fixup: bnoordhuis comment
Browse files Browse the repository at this point in the history
  • Loading branch information
apapirovski committed Jan 25, 2018
1 parent 753a081 commit b5fb9c1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,19 @@
const getBinding = process.binding;
process.binding = function binding(module) {
module = String(module);
if (typeof bindingObj[module] === 'object')
return bindingObj[module];
bindingObj[module] = getBinding(module);
return bindingObj[module];
let mod = bindingObj[module];
if (typeof mod !== 'object')
mod = bindingObj[module] = getBinding(module);
return mod;
};

const getLinkedBinding = process._linkedBinding;
process._linkedBinding = function _linkedBinding(module) {
module = String(module);
if (typeof bindingObj[module] === 'object')
return bindingObj[module];
bindingObj[module] = getLinkedBinding(module);
return bindingObj[module];
let mod = bindingObj[module];
if (typeof mod !== 'object')
mod = bindingObj[module] = getLinkedBinding(module);
return mod;
};
}

Expand All @@ -272,10 +272,10 @@
delete process._internalBinding;

internalBinding = function internalBinding(module) {
if (typeof bindingObj[module] === 'object')
return bindingObj[module];
bindingObj[module] = getInternalBinding(module);
return bindingObj[module];
let mod = bindingObj[module];
if (typeof mod !== 'object')
mod = bindingObj[module] = getInternalBinding(module);
return mod;
};
}

Expand Down

0 comments on commit b5fb9c1

Please sign in to comment.