-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
Closed
Labels
utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.
Description
- Version:
v10.14.1 - Platform:
Mac OS Darwin Kernel Version 18.6.0 - Subsystem:
const util = require('util');
const rx = /a/;
rx.lastIndex = 3;
util.isDeepStrictEqual(rx, /a/); // true
util.inspect(rx, {showHidden: true}); // '{ /a/ [lastIndex]: 3 }'
util.inspect(/a/, {showHidden: true}); // '{ /a/ [lastIndex]: 0 }'
My expectation would have been false. I see that areSimilarRegExps does not perform a check on lastIndex, and keyCheck performs a comparison of enumerable keys, and lastIndex is not enumerable. This may be considered correct, but it feels wrong to me.
Thankyou for your time and consideration.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.