Bug in Socket.jsm

1 view
Skip to first unread message

Brett Zamir

unread,
Dec 29, 2009, 3:58:16 AM12/29/09
to same...@googlegroups.com
Hi,

In Socket.jsm, line 298 uses destructured assignment from a regular
expression.

var [match, code] = response.match(/^HTTP\/1.\d (\d{3})/);

However, if this returns null (as I did when the response was
"</stream:stream>" due to an error, the assignment causes an error (it
doesn't just assign to the first variable match). I believe you need to
either put this in a try-catch block or avoid destructured assignment,
as nice as it would be to do it that way...

best wishes,
Brett

Reply all
Reply to author
Forward
0 new messages