You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Closure Compiler Discuss
I'm not sure if this is so much of a bug or not, but I was running the
Closure Compiler on the YUI library (as it is part of my core combined
JS file) and it gave me a 'divide by 0' error because of this line.
d=d>=0?d:1/0;
Which is obviously dividing by zero, but JavaScript handles this by
using the Infinity value. Is this something that is possible to fix?
Alan Leung
unread,
Nov 6, 2009, 2:11:33 PM11/6/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to closure-comp...@googlegroups.com
How about
d=d>=0?d:Infinity;
instead?
-Alan
Robert Bowdidge
unread,
Nov 6, 2009, 2:23:20 PM11/6/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to closure-comp...@googlegroups.com
On Nov 6, 2009, at 11:11 AM, Alan Leung wrote: > d=d>=0?d:Infinity;
That's 5 more characters! I see a compression opportunity. Perhaps Closure Compiler should insist on Infinity being a literal to validate intent, but convert it to 1<0 where possible (or to a shorter variable name if one's available.)
Robert
Ernie Turner
unread,
Nov 6, 2009, 2:28:00 PM11/6/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Closure Compiler Discuss
I definitely agree that just using Infinity instead is a great
workaround. The problem is just that this is in the core YUI code and
I really don't want to change it and have to deal with the maintenance
when upgrading. Seems like maybe just a poor choice on behalf of the
YUI team. But then again, Robert is right, it is 5 more characters :).
bolinfest
unread,
Nov 6, 2009, 4:55:15 PM11/6/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Closure Compiler Discuss
True, but is it 5 more characters after gzip :)
I haven't tried submitting a patch to YUI before, but it sounds like
this would be worth trying to submit to benefit everyone.
Ernie Turner
unread,
Nov 6, 2009, 5:27:32 PM11/6/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Closure Compiler Discuss
It turns out they've since fixed this in YUI 2.8 (I'm currently using
2.7). Still, it seems like maybe a minor gotcha.