Skip to content

assert: enforce type check in deepStrictEqual

For a write-up on this PR, see https://github.com/nodejs/node/pull/10282#issuecomment-274590846

The less-breaking part of this PR has been moved to https://github.com/nodejs/node/pull/11128

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

assert, test

Description of change

Add checks for the built-in tags and refactor _deepEqual, most user-land modules do this for a strict, deep comparison. https://github.com/nodejs/node-v0.x-archive/pull/7178 already added this check for argument objects, even in non-strict tests.

Fixes #10258 (closed). Docs updates are postponed due to https://github.com/nodejs/node/pull/7815.

See https://tc39.github.io/ecma262/#sec-object.prototype.tostring for a partial list of the tags.

Merge request reports

Loading