toPx and curCss extract the unit using a regexp. However, when value is a number, this throws an exception since there is no match method on a Number object. I changed the below code from
unit = (value.match(runit)||[])[2];
to
unit = (String(value).match(runit)||[])[2];
And everything worked as expected. The code was trigger by calling window.Length(elem, '10em')
toPx and curCss extract the unit using a regexp. However, when
valueis a number, this throws an exception since there is nomatchmethod on aNumberobject. I changed the below code fromunit = (value.match(runit)||[])[2];to
unit = (String(value).match(runit)||[])[2];And everything worked as expected. The code was trigger by calling
window.Length(elem, '10em')