GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — assert: remove internal errorCache property · nodejs/node@12ff395

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • assert.js
    • internal
      • assert.js
  • test/parallel
    • test-assert-builtins-not-read-from-filesystem.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/assert.js‎

Copy file name to clipboardExpand all lines: lib/assert.js
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ const { codes: {
2626
ERR_INVALID_ARG_TYPE,
2727
ERR_INVALID_RETURN_VALUE
2828
} } = require('internal/errors');
29-
const { AssertionError, errorCache } = require('internal/assert');
29+
const { AssertionError } = require('internal/assert');
3030
const { openSync, closeSync, readSync } = require('fs');
3131
const { inspect, types: { isPromise, isRegExp } } = require('util');
3232
const { EOL } = require('internal/constants');
3333
const { NativeModule } = require('internal/bootstrap/loaders');
3434

35+
const errorCache = new Map();
36+
3537
let isDeepEqual;
3638
let isDeepStrictEqual;
3739
let parseExpressionAt;
Collapse file

‎lib/internal/assert.js‎

Copy file name to clipboardExpand all lines: lib/internal/assert.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,5 @@ class AssertionError extends Error {
271271
}
272272

273273
module.exports = {
274-
AssertionError,
275-
errorCache: new Map()
274+
AssertionError
276275
};
Collapse file

‎test/parallel/test-assert-builtins-not-read-from-filesystem.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-assert-builtins-not-read-from-filesystem.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ if (process.argv[2] !== 'child') {
1919
e.emit('hello', false);
2020
} catch (err) {
2121
const frames = err.stack.split('\n');
22-
const [, filename, , ] = frames[1].match(/\((.+):(\d+):(\d+)\)/);
22+
const [, filename, line, column] = frames[1].match(/\((.+):(\d+):(\d+)\)/);
2323
// Spawn a child process to avoid the error having been cached in the assert
2424
// module's `errorCache` Map.
2525

2626
const { output, status, error } =
2727
spawnSync(process.execPath,
28-
[process.argv[1], 'child', filename],
28+
[process.argv[1], 'child', filename, line, column],
2929
{ cwd: tmpdir.path, env: process.env });
3030
assert.ifError(error);
3131
assert.strictEqual(status, 0, `Exit code: ${status}\n${output}`);

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.