mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
domain: show falsy names as anonymous for DEP0097
Many anonymous functions use the empty string as their name. Since the DEP0097 logic was using nullish coalescing, these functions were not being displayed as anonymous. This commit updates the logic to use || instead of ??. PR-URL: https://github.com/nodejs/node/pull/37550 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
2 files changed
+18
-1
No files matched your search
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
|
||||
common.skipIfInspectorDisabled();
|
||||
|
||||
const assert = require('assert');
|
||||
const domain = require('domain');
|
||||
const inspector = require('inspector');
|
||||
|
||||
process.on('warning', common.mustCall((warning) => {
|
||||
assert.strictEqual(warning.code, 'DEP0097');
|
||||
assert.match(warning.message, /Triggered by calling <anonymous> on process/);
|
||||
}));
|
||||
|
||||
domain.create().run(() => {
|
||||
inspector.open();
|
||||
});
|
||||
Reference in new issue
Block a user