Bug Tracker

Modify

Ticket #3139 (closed bug: wontfix)

Opened 5 years ago

Last modified 4 years ago

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

comment:1 Changed 4 years ago by joern

  • Status changed from new to closed
  • Resolution set to wontfix

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.