Skip to content

Commit 865e2eb

Browse files
committed
errors: fix the comments for hideStackFrame
Fix the comments for the no-overhead hideStackFrame Refs: nodejs#35644
1 parent abf684c commit 865e2eb

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

benchmark/misc/hidestackframes.js

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
const common = require('../common.js');
44

5-
/* there should be no significant performance differences
6-
* between the hideStackFrames version and the direct
7-
* call version
8-
*/
95
const bench = common.createBenchmark(main, {
106
type: ['hide-stackframes-throw', 'direct-call-throw',
117
'hide-stackframes-noerr', 'direct-call-noerr'],

lib/internal/errors.js

+2
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ function makeNodeErrorWithCode(Base, key) {
326326

327327
// This function removes unnecessary frames from Node.js core errors.
328328
function hideStackFrames(fn) {
329+
// We rename the functions that will be hidden to cut off the stacktrace
330+
// at the outermost one
329331
const hidden = '__node_internal_hidden_' + fn.name;
330332
ObjectDefineProperty(fn, 'name', { value: hidden });
331333
return fn;

0 commit comments

Comments
 (0)