> That's pretty neat code. But if I have an error in JavaScript then I
> prefer the code to break where the error is. If I was using a debugger
> to inspect the stack then I wouldn't be able to debug this because the
> error has passed.

That's not true, observe:
http://ejohn.org/files/handler-break.png

"I wouldn't be able to debug this" that's also not true - just pop
this open in Firebug and you'll see it point back to the correct line:
http://ejohn.org/files/handler-error.html

    [Break on this error]  throw new Error("test");
    handler-...rror.html (line 19)

> And mentioning performance is a red herring.

How so? The performance overhead of event handling of huge concern for
us - we're in the process of trying to reduce any overhead that might
exist, not increase it.

I tossed up a test:
http://ejohn.org/files/handler-ready.html

Dean Time: 174ms
Normal Time: 1ms
(in Firefox 3)

Dean Time: 12ms
Normal Time: 0ms
(in Safari 3)

Dean Time: 161ms
Normal Time: 3ms
(in Opera 9.6)

This means that doing an extra event dispatch is anywhere from 12 to
174x slower than normal execution.

--John

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to