Bug 12332
| Summary: | callWebScriptMethod:withArguments: provides no way to determine if an exception was thrown | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Mark Rowe (bdash) <mrowe> |
| Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Major | Keywords: | InRadar |
| Priority: | P2 | ||
| Version: | 420+ | ||
| Hardware: | Mac | ||
| OS: | OS X 10.4 | ||
| URL: | http://lists.apple.com/archives/webkitsdk-dev/2006/Apr/msg00016.html | ||
Mark Rowe (bdash)
As per the mailing list post in the specified URL, -[WebScriptObject callWebScriptMethod:withArguments:] translates an exception raised in the called method into a return value of WebUndefined. This makes it impossible to distinguish between a genuine return value of undefined and an exception being thrown.
-[WebScriptObject callWebScriptMethod:withArguments:] returns nil in other situations: if the given method doesn't exist on the object, or if it is not a callable. It may make more sense to handle exceptions in a similar way, though the compatibility impact of changing the return value in this case is unknown.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Mark Rowe (bdash)
<rdar://problem/4941072>