mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
lib: use assignFunctionName util where it makes sense
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: https://github.com/nodejs/node/pull/64515 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Jordan Harband <ljharb@gmail.com>
This commit is contained in:
1 parent
c1bd1c4c7e
commit
5520388f3b
2 files changed
+5
-10
No files matched your search
@@ -3,7 +3,6 @@
|
||||
const {
|
||||
ArrayPrototypeMap,
|
||||
FunctionPrototypeCall,
|
||||
ObjectDefineProperty,
|
||||
Symbol,
|
||||
} = primordials;
|
||||
|
||||
@@ -33,6 +32,7 @@ const {
|
||||
startPerf,
|
||||
stopPerf,
|
||||
} = require('internal/perf/observe');
|
||||
const { assignFunctionName } = require('internal/util');
|
||||
|
||||
const kPerfHooksDnsLookupResolveContext = Symbol('kPerfHooksDnsLookupResolveContext');
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,7 +4,6 @@ const {
|
||||
ArrayPrototypePushApply,
|
||||
ArrayPrototypeSome,
|
||||
FunctionPrototypeBind,
|
||||
ObjectDefineProperty,
|
||||
ObjectKeys,
|
||||
ObjectPrototypeHasOwnProperty,
|
||||
RegExpPrototypeExec,
|
||||
@@ -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;
|
||||
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user