| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7cb3099 commit 9ce72fd
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,6 @@ | |||
| 3 | 3 | const { | |
| 4 | 4 | ArrayPrototypeMap, | |
| 5 | 5 | FunctionPrototypeCall, | |
| 6 | - ObjectDefineProperty, | ||
| 7 | 6 | Symbol, | |
| 8 | 7 | } = primordials; | |
| 9 | 8 | ||
@@ -33,6 +32,7 @@ const { | |||
| 33 | 32 | startPerf, | |
| 34 | 33 | stopPerf, | |
| 35 | 34 | } = require('internal/perf/observe'); | |
| 35 | + const { assignFunctionName } = require('internal/util'); | ||
| 36 | 36 | ||
| 37 | 37 | const kPerfHooksDnsLookupResolveContext = Symbol('kPerfHooksDnsLookupResolveContext'); | |
| 38 | 38 | ||
@@ -82,8 +82,7 @@ function resolver(bindingName) { | |||
| 82 | 82 | } | |
| 83 | 83 | return req; | |
| 84 | 84 | } | |
| 85 | - ObjectDefineProperty(query, 'name', { __proto__: null, value: bindingName }); | ||
| 86 | - return query; | ||
| 85 | + return assignFunctionName(bindingName, query); | ||
| 87 | 86 | } | |
| 88 | 87 | ||
| 89 | 88 | // This is the callback-based resolver. There is another similar | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,6 @@ const { | |||
| 4 | 4 | ArrayPrototypePushApply, | |
| 5 | 5 | ArrayPrototypeSome, | |
| 6 | 6 | FunctionPrototypeBind, | |
| 7 | - ObjectDefineProperty, | ||
| 8 | 7 | ObjectKeys, | |
| 9 | 8 | ObjectPrototypeHasOwnProperty, | |
| 10 | 9 | RegExpPrototypeExec, | |
@@ -13,6 +12,7 @@ const { | |||
| 13 | 12 | ||
| 14 | 13 | const { validatePort } = require('internal/validators'); | |
| 15 | 14 | const permission = require('internal/process/permission'); | |
| 15 | + const { assignFunctionName } = require('internal/util'); | ||
| 16 | 16 | ||
| 17 | 17 | const kMinPort = 1024; | |
| 18 | 18 | const kMaxPort = 65535; | |
@@ -88,16 +88,12 @@ function wrapConsole(consoleFromNode) { | |||
| 88 | 88 | // then wrap these two methods into one. Native wrapper will preserve | |
| 89 | 89 | // the original stack. | |
| 90 | 90 | if (ObjectPrototypeHasOwnProperty(consoleFromNode, key)) { | |
| 91 | - consoleFromNode[key] = FunctionPrototypeBind( | ||
| 91 | + consoleFromNode[key] = assignFunctionName(key, FunctionPrototypeBind( | ||
| 92 | 92 | consoleCall, | |
| 93 | 93 | consoleFromNode, | |
| 94 | 94 | consoleFromVM[key], | |
| 95 | 95 | consoleFromNode[key], | |
| 96 | - ); | ||
| 97 | - ObjectDefineProperty(consoleFromNode[key], 'name', { | ||
| 98 | - __proto__: null, | ||
| 99 | - value: key, | ||
| 100 | - }); | ||
| 96 | + )); | ||
| 101 | 97 | } else { | |
| 102 | 98 | // Add additional console APIs from the inspector | |
| 103 | 99 | consoleFromNode[key] = consoleFromVM[key]; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments