Skip to content

Commit

Permalink
fixup! errors: add useOriginalName to internal/errors
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Sep 15, 2018
1 parent dd18873 commit 2742d39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,10 @@ module.exports = {
getMessage,
SystemError,
codes,
// These are exported only to facilitate testing.
// This is exported only to facilitate testing.
E,
// This allows us to tell the type of the errors without using
// instanceof, which is necessary in WPT harness.
get useOriginalName() { return useOriginalName; },
set useOriginalName(value) { useOriginalName = value; }
};
Expand Down
5 changes: 5 additions & 0 deletions test/parallel/test-internal-error-original-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

'use strict';

// This tests `internal/errors.useOriginalName`
// This testing feature is needed to allows us to assert the types of
// errors without using instanceof, which is necessary in WPT harness.
// Refs: https://github.com/nodejs/node/pull/22556

require('../common');
const assert = require('assert');
const errors = require('internal/errors');
Expand Down

0 comments on commit 2742d39

Please sign in to comment.