prototypejs / prototype

Prototype JavaScript framework
http://prototypejs.org/
Other
3.54k stars 639 forks source link

Element.setStyle bug #249

Closed jwestbrook closed 9 years ago

jwestbrook commented 10 years ago

previous lighthouse ticket #1276 by John McClure


Not sure why, but I get a NULL returned by styles.match, so the array reference threw an excp...

/* Prototype JavaScript framework, version 1.6.0.3 line 1922 was ...

element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;

line 1922 could be....

element.setOpacity( (m = styles.match(/opacity:\s*(\d?\.?\d*)/)) ? m[1] : element ) : element;

This code within Element.setStyle looks a bit like a classic hack.