mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
lib: replace 'assert' with 'internal/assert' for many built-ins
Replace large 'assert' module with tiny 'internal/assert' module for many built-in uses. PR-URL: https://github.com/nodejs/node/pull/25956 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
This commit is contained in:
@@ -5,7 +5,7 @@ process.emitWarning(
|
||||
'internal/test/heap');
|
||||
|
||||
const { createHeapDump, buildEmbedderGraph } = internalBinding('heap_utils');
|
||||
const assert = require('assert');
|
||||
const assert = require('internal/assert');
|
||||
|
||||
// This is not suitable for production code. It creates a full V8 heap dump,
|
||||
// parses it as JSON, and then creates complex objects from it, leading
|
||||
@@ -44,9 +44,10 @@ function createJSHeapDump() {
|
||||
edgeIndex++;
|
||||
}
|
||||
|
||||
for (const node of nodes)
|
||||
assert.strictEqual(node.edge_count, node.outgoingEdges.length);
|
||||
|
||||
for (const node of nodes) {
|
||||
assert(node.edge_count === node.outgoingEdges.length,
|
||||
`${node.edge_count} !== ${node.outgoingEdges.length}`);
|
||||
}
|
||||
return nodes;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user