Bug 17470 - throws are not properly recorded in the console in onreadystatechange
Summary: throws are not properly recorded in the console in onreadystatechange
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2008-02-21 03:16 PST by Francisco Tolmasky
Modified: 2008-07-20 05:47 PDT (History)
2 users (show)

See Also:


Attachments
test case (559 bytes, text/html)
2008-02-21 06:09 PST, Alexey Proskuryakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Francisco Tolmasky 2008-02-21 03:16:31 PST
myXMLHTTPRequestObject.onreadystatechange = function () { throw "hello". }

This will report "undefined" in the error console, whereas it reports "hello" from everywhere else it could be thrown.
Comment 1 Alexey Proskuryakov 2008-02-21 06:09:59 PST
Created attachment 19256 [details]
test case

I'm interested in which cases work though - XMLHttpRequest, XPathEvaluator and a plain timeout all seem to work in the same way.
Comment 2 Francisco Tolmasky 2008-02-21 13:02:49 PST
(In reply to comment #1)
> Created an attachment (id=19256) [edit]
> test case
> 
> I'm interested in which cases work though - XMLHttpRequest, XPathEvaluator and
> a plain timeout all seem to work in the same way.
> 
Just doing
<script>
throw "yikes"
</script>

works
Comment 3 Alexey Proskuryakov 2008-02-21 13:28:49 PST
Right - apparently, all callbacks are affected.

This looks like an easy fix, but I'd like to look into providing line numbers and getting rid of code duplication at the same time.
Comment 4 Alexey Proskuryakov 2008-03-31 22:58:12 PDT
See also: bug 18232, bug 18234.
Comment 5 Francisco Tolmasky 2008-04-19 01:04:50 PDT
This basically makes debugging in Safari impossible.  I really think that this should be a P1 given that any bug you have in any ajax code requires you to do alert debugging essentially.
Comment 6 David Kilzer (:ddkilzer) 2008-05-02 15:27:46 PDT
<rdar://problem/5908156>
Comment 7 Francisco Tolmasky 2008-05-02 15:51:35 PDT
thank you kilzer
Comment 8 Oliver Hunt 2008-07-20 05:47:39 PDT
Fixed in r35253