Skip to content

Commit 2742d39

Browse files
committed
fixup! errors: add useOriginalName to internal/errors
1 parent dd18873 commit 2742d39

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

lib/internal/errors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,10 @@ module.exports = {
442442
getMessage,
443443
SystemError,
444444
codes,
445-
// These are exported only to facilitate testing.
445+
// This is exported only to facilitate testing.
446446
E,
447+
// This allows us to tell the type of the errors without using
448+
// instanceof, which is necessary in WPT harness.
447449
get useOriginalName() { return useOriginalName; },
448450
set useOriginalName(value) { useOriginalName = value; }
449451
};

test/parallel/test-internal-error-original-names.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
'use strict';
44

5+
// This tests `internal/errors.useOriginalName`
6+
// This testing feature is needed to allows us to assert the types of
7+
// errors without using instanceof, which is necessary in WPT harness.
8+
// Refs: https://github.com/nodejs/node/pull/22556
9+
510
require('../common');
611
const assert = require('assert');
712
const errors = require('internal/errors');

0 commit comments

Comments
 (0)