Closed stoivo closed 4 years ago
I will add a spec next time i have time to dedicate some time to this PR. Will be in touch.
Should I commit a minified version of jQuery?
We definitely don't want to include a version of jQuery inside Jasmine. It looks like your error message actually does say that the cause is a circular reference in the object being converted to JSON. The easiest "fix" (in the linked example above) is to just try
/catch
around the JSON.stringify
call and return a string that indicates the circular reference. This would also solve the issue for users using other Javascript frameworks, not just jQuery.
Sorry for taking so long. We use the patch for out system and it works do we did spend any more time on this. I took some time this weekend do fix this and hopyfully an other PR too.
I will do some more reseach so see If I can get it working with https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cyclic_object_value.
Are you fine with dropping support for rails4 since it reached end of life?
I will open a new PR when it is ready
Continues work on #301
JQuery objects could not be stringified. It would trow a exception: TypeError: Converting circular structure to JSON
The error example includes a Jquery element with DOM reference so it cant be stringyfied out of the box.
toArray()
on jquery elements is lossy but it works and I did need it to fix my errors.fix #306