Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#9575 closed bug (invalid)

animate function does't cast regex.exec() parameter to string before calling

Reported by: Ryan Owned by: Ryan
Priority: high Milestone: 1.next
Component: effects Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:


Occasionally an integer is passed to exec that causes the page to crash in IE when using XRegExp (the integer causes XRegExp's call of str.slice to produce an "Object doesn't support this property or method" error).

At first I thought it might be an XRegExp issue but the javascript docs clearly state that a string is expected. Converting the exec argument to a string prior to the call solves the problem.

Line 8159 is the culprit:

parts = rfxnum.exec( val );

should be changed to

parts = rfxnum.exec( val == null ? null : String(val) );

(Environment: 1.6.1 on IE 8 with Windows 7 using XRexExp 1.5)

Change History (6)

comment:1 Changed 9 years ago by Rick Waldron

Component: unfiledeffects
Owner: set to Rick Waldron
Priority: undecidedhigh
Status: newassigned

comment:2 Changed 9 years ago by timmywil

Is there a test case for this showing the error?

comment:3 Changed 9 years ago by Rick Waldron

Owner: Rick Waldron deleted
Status: assignedopen

comment:4 Changed 9 years ago by gnarf

Owner: set to Ryan
Status: openpending

Can you get a test case / jsfiddle of this issue please?

comment:5 Changed 9 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:6 Changed 9 years ago by anonymous

I get the same problem. Forcing string shoud resolve this issue: parts = rfxnum.exec( String(val) );

Note: See TracTickets for help on using tickets.