Skip to content

Commit

Permalink
assert: remove internal errorCache property
Browse files Browse the repository at this point in the history
The internal assert module exposed an errorCache property solely for
testing. It is no longer necessary. Remove it.

PR-URL: nodejs#23304
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
  • Loading branch information
Trott authored and sagitsofan committed Oct 12, 2018
1 parent 141cd23 commit e7b03d8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ if (process.argv[2] !== 'child') {
e.emit('hello', false);
} catch (err) {
const frames = err.stack.split('\n');
const [, filename, , ] = frames[1].match(/\((.+):(\d+):(\d+)\)/);
const [, filename, line, column] = frames[1].match(/\((.+):(\d+):(\d+)\)/);
// Spawn a child process to avoid the error having been cached in the assert
// module's `errorCache` Map.

const { output, status, error } =
spawnSync(process.execPath,
[process.argv[1], 'child', filename],
[process.argv[1], 'child', filename, line, column],
{ cwd: tmpdir.path, env: process.env });
assert.ifError(error);
assert.strictEqual(status, 0, `Exit code: ${status}\n${output}`);
Expand Down

0 comments on commit e7b03d8

Please sign in to comment.