-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Closed
Labels
assertIssues and PRs related to the assert subsystem.Issues and PRs related to the assert subsystem.vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.
Description
- Version: v7.7.1
- Platform: Mac OSX X86_64
- Subsystem:
The following assertion fails when objects are property descriptors:
'use strict';
require('../common');
const assert = require('assert');
const x = {};
Object.defineProperty(x, 'prop', {
get() {
return 'foo';
}
});
const y = {};
Object.defineProperty(y, 'prop', {
get() {
return 'foo';
}
});
const descriptorx = Object.getOwnPropertyDescriptor(x, 'prop');
const descriptory = Object.getOwnPropertyDescriptor(y, 'prop');
assert.deepStrictEqual(x, y); // ok
assert.deepStrictEqual(descriptorx, descriptory); // throws an error
What seems to happen is that (in both cases) Object.getPrototypeOf(descriptor)
results in {}, which leads to the condition
https://github.com/nodejs/node/blob/master/lib/assert.js#L200
returning false. Same is true for assert.strictEqual()
Metadata
Metadata
Assignees
Labels
assertIssues and PRs related to the assert subsystem.Issues and PRs related to the assert subsystem.vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.