-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assert.deepEqual
loops forever with circular refs
#6416
Comments
Also affects |
Judging from the test, this is sort of by design. The original behavior was (apparently) to loop forever but now it throws an error instead. Should be fixable by keeping track of seen references. Not sure about the semver implications or if the Locked status of the API is an issue here or not. (I would consider this a bugfix myself, but others may disagree.) |
@Trott I’ve looked a bit at the original issue linked above, and I think Ryan Dahl actually just forgot to pull in the patch which does what you suggest (nodejs/node-v0.x-archive#207 (comment)). Would say it’s a bugfix, too. |
@addaleax Cool! I think I've got a fix almost ready to go, but if you're already working on it, I'm happy to drop it and go do something else. |
@Trott No, sorry, didn’t mean to imply that I was coding anything right now – go ahead! 😄 |
assert.deepEqual() and assert.deepStrictEqual() will no longer throw a RangeError if passed objects with circular references. Refs: strager/node@56dbd80 Fixes: nodejs#6416
assert.deepEqual() and assert.deepStrictEqual() will no longer throw a RangeError if passed objects with circular references. Fixes: nodejs#6416
assert.deepEqual() and assert.deepStrictEqual() will no longer throw a RangeError if passed objects with circular references. PR-URL: nodejs#6432 Fixes: nodejs#6416 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
assert.deepEqual() and assert.deepStrictEqual() will no longer throw a RangeError if passed objects with circular references. fix: twada#3 refs:nodejs/node#6416 nodejs/node#6432
assert.deepEqual() and assert.deepStrictEqual() will no longer throw a RangeError if passed objects with circular references. fix: twada#3 refs:nodejs/node#6416 nodejs/node#6432
Cleaned up as per comments in issue Ref: nodejs#6416
Fixes: #13314 Refs: #6416 This commit changes semantics of the memos cycles tracker. Before the change it was used to track all currently wisited nodes of an object tree, which is a bit shifted from its original intention of tracking cycles. The change brings intended semantics, by tracking only objects of the current branch of the object tree. PR-URL: #13318 Fixes: #13314 Ref: #6416 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Fixes: #13314 Refs: #6416 This commit changes semantics of the memos cycles tracker. Before the change it was used to track all currently wisited nodes of an object tree, which is a bit shifted from its original intention of tracking cycles. The change brings intended semantics, by tracking only objects of the current branch of the object tree. PR-URL: #13318 Fixes: #13314 Ref: #6416 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Version:
v4.4.3
Platform:
Linux 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Code:
Expected: no exceptions.
Actual:
RangeError: Maximum call stack size exceeded
See also:
The text was updated successfully, but these errors were encountered: