Error in obfuscated JavaScript : "c.Fb is not a function" (under FireFox)

22 views
Skip to first unread message

Sergey Grigorchuk

unread,
Feb 12, 2008, 3:46:53 PM2/12/08
to Google Web Toolkit
Hello all,

I compiled my GWT application with "-style obfuscated" key and now
FireFox throws error:
"c.Fb is not a function" (under FireFox 2.0.0.12)

It shows me the error line in cache.html file but of course it almost
impossible to understand what does it mean (obfuscated JavaScript).

It had been compiled with "-style pretty" key and everything was fine.

Any ideas how to recognize the error?

Thanks

Sergey Grigorchuk
http://math.welobox.com

Ian Petersen

unread,
Feb 12, 2008, 4:01:50 PM2/12/08
to Google-We...@googlegroups.com
Which version of GWT are you using?

Ian

--
Tired of pop-ups, security holes, and spyware?
Try Firefox: http://www.getfirefox.com

Ian Petersen

unread,
Feb 12, 2008, 4:11:02 PM2/12/08
to Google-We...@googlegroups.com
Sorry if this double posts, but I got a bounce message for the GWT
newsgroup, which seems like a mistake. Anyway, which version of GWT

Sergey Grigorchuk

unread,
Feb 12, 2008, 4:48:40 PM2/12/08
to Google Web Toolkit
> Anyway, which version of GWT are you using?

GWT 1.4.60
Do you think last version does not have this problem? I'm going to
test it right now...

Sergey Grigorchuk
http://math.welobox.com

Ian Petersen

unread,
Feb 12, 2008, 4:54:46 PM2/12/08
to Google-We...@googlegroups.com
On Feb 12, 2008 4:48 PM, Sergey Grigorchuk <sergey.g...@gmail.com> wrote:
> GWT 1.4.60
> Do you think last version does not have this problem? I'm going to
> test it right now...

Well, could be, but the differences between 1.4.60 and 1.4.61 are
pretty small. I just wanted to see if you were using trunk code,
which will be GWT 1.5 when it's released. The 1.5 compiler will be a
lot more aggressive in its optimizations, so it seems more likely to
produce invalid obfuscated code. On the other hand, perhaps it has
better testing, so who knows.

How do you trigger the error you're seeing? Do you have to create any
events or does it get triggered just by loading your app?

Sergey Grigorchuk

unread,
Feb 12, 2008, 6:24:09 PM2/12/08
to Google Web Toolkit
Wow, 1.4.61 works fine. Perfect!

Sergey Grigorchuk
http://math.welobox.com

Sergey Grigorchuk

unread,
Feb 14, 2008, 11:49:03 AM2/14/08
to Google Web Toolkit
Hm... Now I found similar error in other place... It happens when I
click submit button. I removed all listeners but exception is thrown
so I guess the problem is not in my code. The body of the method that
throws the exception:

function ug(b,a,c){Ef();var d;if(a===Eh){if(dh(b)==8192)
{Eh=null;}}d=tg;tg=b;try{c.uj(b);}finally{tg=d;}}

Error: c.uj is not a function
Источник: http://localhost:8080/math/F9C8F14DBEC7C878C40C9D2C9AD85A51.cache.html
Line: 280

I think the error is in GWT :(

Sergey Grigorchuk
http://math.welobox.com

Ian Petersen

unread,
Feb 14, 2008, 2:41:23 PM2/14/08
to Google-We...@googlegroups.com
I'm not sure how you debug that. Have you tried poking around with a
debugger like Venkman or Firebug? Maybe, if you can see what values
some of the variables have, you could get a better idea of what the
function is doing. It kind of looks to me like an event handler
because of the comparison to 8192, but I'm not sure. It's also
curious that "tg" seems to be saved in a local variable, set to one of
the function parameters for the duration of the call to c.uj, and then
set back to its original value in a finally block. Perhaps you could
look for that pattern in the GWT source to track down the Java source
for this function?

Anyway, I'm not sure where to go next. Maybe you should file an issue
and see if the GWT people can be of any help. If you do that, make
sure to include as much information as possible: GWT version, browser,
any extra modules you're using, the details of what it takes to
trigger the error, etc. This will be hard to track down so the more
information the better.

Good luck,

Isaac Truett

unread,
Feb 14, 2008, 3:11:50 PM2/14/08
to Google-We...@googlegroups.com
I believe this is the source of the error, compiled with "-style
pretty" from a simple test app:

function dispatchEventImpl(evt, elem, listener){
$clinit_8();
var prevCurrentEvent;
if (elem === sCaptureElem) {
if (eventGetType(evt) == 8192) {
sCaptureElem = null;
}
}
prevCurrentEvent = currentEvent;
currentEvent = evt;
try {
listener.onBrowserEvent(evt);
}
finally {
currentEvent = prevCurrentEvent;

Ian Petersen

unread,
Feb 14, 2008, 3:17:19 PM2/14/08
to Google-We...@googlegroups.com
On Thu, Feb 14, 2008 at 3:11 PM, Isaac Truett <itr...@gmail.com> wrote:
> I believe this is the source of the error, compiled with "-style
> pretty" from a simple test app:
>
> function dispatchEventImpl(evt, elem, listener){
> $clinit_8();
> var prevCurrentEvent;
> if (elem === sCaptureElem) {
> if (eventGetType(evt) == 8192) {
> sCaptureElem = null;
> }
> }
> prevCurrentEvent = currentEvent;
> currentEvent = evt;
> try {
> listener.onBrowserEvent(evt);
> }
> finally {
> currentEvent = prevCurrentEvent;
>
>
> }
> }

I agree, and that means "c.uj()" is "listener.onBrowserEvent()", which
I think means you've broken something, Sergey. Every widget has an
onBrowserEvent method, so there's either an enormous problem with the
GWT compiler that no one's ever seen before, or there's something
unusual in your setup that has created a button with no
onBrowserEvent. It could be a problem with GWT, but it seems more
likely that you're in a quirky environment. Are you using any
non-standard modules? Perhaps you could post the code you've written
that creates the problematic button?

Sergey Grigorchuk

unread,
Feb 15, 2008, 9:49:28 AM2/15/08
to Google Web Toolkit
Thank you for your help, I agree with Isaac as well.

I recognized that the error in this method because FireFox displays
error line. I did not try debug it.

I use usual com.google.gwt.user.client.ui.Button, I don't have any
libraries or modules in my project. Project is quite big and the
button used to be ok but when projects got bigger than 700k for 1
cache.html file some widgets got buggy with the same error (E.g. some
Labels threw the error when onMouseOver).

So it seems to me it's compiler problem.

If you have any more ideas how to beat the error, please let me
know...

Ian Petersen

unread,
Feb 15, 2008, 10:26:04 AM2/15/08
to Google-We...@googlegroups.com
On Fri, Feb 15, 2008 at 9:49 AM, Sergey Grigorchuk
<sergey.g...@gmail.com> wrote:
> I use usual com.google.gwt.user.client.ui.Button, I don't have any
> libraries or modules in my project. Project is quite big and the
> button used to be ok but when projects got bigger than 700k for 1
> cache.html file some widgets got buggy with the same error (E.g. some
> Labels threw the error when onMouseOver).
>
> So it seems to me it's compiler problem.

Sounds likely. I suggest you file an issue and see what the Google
people say. If it's only a problem for very large projects, you may
have to work together with them by either sending them your code, or
doing a lot of debugging on their behalf.

Good luck,

Sergey Grigorchuk

unread,
Feb 15, 2008, 10:55:56 AM2/15/08
to Google Web Toolkit
I just found out the problem disappeared after separating modules. I
used to include two modules on the same html page

<meta name="gwt:module" content="Module1">
<meta name="gwt:module" content="Module2">

Now I separated modules on different html pages. So they work fine
separately but don't work together on the same page.

Any ideas?

Sergey Grigorchuk
http://math.welobox.com

Ian Petersen

unread,
Feb 15, 2008, 11:00:16 AM2/15/08
to Google-We...@googlegroups.com
On Fri, Feb 15, 2008 at 10:55 AM, Sergey Grigorchuk
<sergey.g...@gmail.com> wrote:
> Any ideas?

Unfortunately, no. I think I've seen issues in the tracker or
postings on the forum that suggest a multi-module configuration
doesn't work in GWT 1.4, but I think it might be fixed in GWT 1.5.
I'm not sure, though, because I'm only using one module so it hasn't
directly affected me.

Ben Vitale

unread,
Mar 12, 2008, 5:45:11 PM3/12/08
to Google Web Toolkit
I can confirm the same behavior in the same block of code. My
application also uses multiple modules in the same page.
Interestingly enough I'm seeing it in IE6, but not in Firefox.

Isaac, were you able to isolate the behavior in a simple test app? If
so can you attach it?

Did anyone post a GWT issue for this?

-Ben

Sergey Grigorchuk

unread,
Mar 12, 2008, 6:18:35 PM3/12/08
to Google Web Toolkit

> Did anyone post a GWT issue for this?
Yes I did it, but no response yet.

Isaac Truett

unread,
Mar 13, 2008, 11:39:43 AM3/13/08
to Google-We...@googlegroups.com
Ben,

No, I haven't reproduced the error. All I did was find the error's
origin point in unobfuscated code.

Reply all
Reply to author
Forward
0 new messages