Skip to content

Commit c947273

Browse files
committed
errors: fix the comments for hideStackFrame
Fix the comments for the no-overhead hideStackFrame Refs: nodejs#35644
1 parent 2bee93e commit c947273

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
@@ -307,6 +307,8 @@ function makeNodeErrorWithCode(Base, key) {
307307

308308
// This function removes unnecessary frames from Node.js core errors.
309309
function hideStackFrames(fn) {
310+
// We rename the functions that will be hidden to cut off the stacktrace
311+
// at the outermost one
310312
const hidden = '__node_internal_hidden_' + fn.name;
311313
ObjectDefineProperty(fn, 'name', { value: hidden });
312314
return fn;

0 commit comments

Comments
 (0)