jsperf.com
jsperf.com copied to clipboard
Doesn't work with modern JS?
This test fails with a cryptic error message:
https://jsperf.com/array-search-sets
ReferenceError: result is not defined.
Tests always seem to fail whenever I use modern keywords like const
?
Or is this because setup/teardown and test-code isn't all defined/running in the same scope? (if so, how is teardown useful without being able to access any of the results generated by the tests?)
(I'd assume every test runs in a new iframe with setup, test-code and teardown "pasted" after each other, or how else does it work? how else would you get reliable results?)
It would be helpful if you could console.error
after you catch
, as currently there's no way to see which line generated the error.
Also, the preparation code rendering is broken, with two weird nested containers and some <script>
tags showing up on the page - I have no idea if this is related.