Skip to content

Commit b083086

Browse files
soleboxevanlucas
authored andcommitted
vm: name anonymous functions
Name anonymous arrow function in vm module to improve readability PR-URL: #9388 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Ref: #8913
1 parent 6eb6816 commit b083086

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/vm.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,21 @@ const realRunInContext = Script.prototype.runInContext;
1818

1919
Script.prototype.runInThisContext = function(options) {
2020
if (options && options.breakOnSigint) {
21-
return sigintHandlersWrap(() => {
21+
const realRunInThisContextScript = () => {
2222
return realRunInThisContext.call(this, options);
23-
});
23+
};
24+
return sigintHandlersWrap(realRunInThisContextScript);
2425
} else {
2526
return realRunInThisContext.call(this, options);
2627
}
2728
};
2829

2930
Script.prototype.runInContext = function(contextifiedSandbox, options) {
3031
if (options && options.breakOnSigint) {
31-
return sigintHandlersWrap(() => {
32+
const realRunInContextScript = () => {
3233
return realRunInContext.call(this, contextifiedSandbox, options);
33-
});
34+
};
35+
return sigintHandlersWrap(realRunInContextScript);
3436
} else {
3537
return realRunInContext.call(this, contextifiedSandbox, options);
3638
}

0 commit comments

Comments
 (0)