Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/internal/dns/callback_resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const {
ArrayPrototypeMap,
FunctionPrototypeCall,
ObjectDefineProperty,
Symbol,
} = primordials;

Expand Down Expand Up @@ -33,6 +32,7 @@ const {
startPerf,
stopPerf,
} = require('internal/perf/observe');
const { assignFunctionName } = require('internal/util');

const kPerfHooksDnsLookupResolveContext = Symbol('kPerfHooksDnsLookupResolveContext');

Expand Down Expand Up @@ -82,8 +82,7 @@ function resolver(bindingName) {
}
return req;
}
ObjectDefineProperty(query, 'name', { __proto__: null, value: bindingName });
return query;
return assignFunctionName(bindingName, query);
}

// This is the callback-based resolver. There is another similar
Expand Down
10 changes: 3 additions & 7 deletions lib/internal/util/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const {
ArrayPrototypePushApply,
ArrayPrototypeSome,
FunctionPrototypeBind,
ObjectDefineProperty,
ObjectKeys,
ObjectPrototypeHasOwnProperty,
RegExpPrototypeExec,
Expand All @@ -13,6 +12,7 @@ const {

const { validatePort } = require('internal/validators');
const permission = require('internal/process/permission');
const { assignFunctionName } = require('internal/util');

const kMinPort = 1024;
const kMaxPort = 65535;
Expand Down Expand Up @@ -88,16 +88,12 @@ function wrapConsole(consoleFromNode) {
// then wrap these two methods into one. Native wrapper will preserve
// the original stack.
if (ObjectPrototypeHasOwnProperty(consoleFromNode, key)) {
consoleFromNode[key] = FunctionPrototypeBind(
consoleFromNode[key] = assignFunctionName(key, FunctionPrototypeBind(
consoleCall,
consoleFromNode,
consoleFromVM[key],
consoleFromNode[key],
);
ObjectDefineProperty(consoleFromNode[key], 'name', {
__proto__: null,
value: key,
});
));
} else {
// Add additional console APIs from the inspector
consoleFromNode[key] = consoleFromVM[key];
Expand Down
Loading