Modify ↓
Ticket #3139 (closed bug: wontfix)
qunit: calling serialArray( [ undefined ] ) throws TypeError
| Reported by: | mark | Owned by: | joern |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.3 |
| Component: | qunit | Version: | 1.2.6 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
When two arrays are compared with isSet() and they are not the same then serialArray is called to display the actual and expected arrays. If serialArray is called with an array that has an undefined or null item in it then testrunner.js line 289:
var str = a[i].nodeName;
Throws a Type Error. Modifying this to:
var str = a[i] != undefined ? a[i].nodeName : undefined;
Appears to fix the problem.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

serialArray is deprecated already, isSet will probably be removed as well. Use jsDump.parse() instead of serialArray, it'll handle undefined values.