Fix a regression in Style#fontSize.

Closes #432.
This commit is contained in:
Jürg Lehni 2014-03-26 16:58:43 +01:00
parent e453b90ad2
commit 8c45786759

View file

@ -288,11 +288,11 @@ var Style = Base.extend(new function() {
// To prevent an obscure iOS 7 crash, we have to convert the size to a
// string first before passing it to the regular expression.
// The following nonsensical statement would also prevent the bug,
// prooving that the issue is not the regular expression itself, but
// proving that the issue is not the regular expression itself, but
// something deeper down in the optimizer:
// `if (size === 0) size = 0;`
return this.getFontWeight()
+ ' ' + fontSize + (/\w/i.test(fontSize + '') ? ' ' : 'px ')
+ ' ' + fontSize + (/\[a-z]/i.test(fontSize + '') ? ' ' : 'px ')
+ this.getFontFamily();
},