Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Fix flaky dump test "Circular reference with arrays"
There were two issues here: * The test relied on non-default maxDepth of null or > 10 since its example involves recurion 10 levels deep, and the default maxDepth is 5. * There is a bug in `QUnit.dump.parse()` where, if the input value cannot be mapped to a formatter function, it returns a function instead of a string. This bug was introduced nearly ten years ago in commit 818b2be, where `error` was replaced with a function that had a different purpose than what was there before, and this one use of it as fallback was not updated. Unfortunately, I am unable to say what value causes this to happen. I can consistently reproduce the issue in Safari 9.1 via BrowserStack, but only if I don't open the console, don't run a subset of the test, and don't modify any of the surrounding code. I have tried dozens upon dozens of clever ways to store values during the parse() function call in temporary variables and alert() them but as soon as I tried to capture anything that would help, the bug would stop happening. I can only conclude that there must be some kind of memory or JIT corruption in the JavaScript engine of Safari 9.1 that has some extremely specific conditions attached to it. Conditions that we did not meet before the last few commits, and are meeting now. ``` [OS X El Capitan, Safari 9.1] Error: "Circular reference with arrays" failed Died on test #1 @http://localhost:8899/test/main/dump.js:279:11: expected.indexOf is not a function. (In 'expected.indexOf("[object Array]")', 'expected.indexOf' is undefined) ```
- Loading branch information