Bug 33425

Summary: 'invokeDefaultMethodWithArguments:' skipped if 'null' JS value passed as one of the arguments
Product: WebKit Reporter: Alexander Mitin <Alexander.Mitin>
Component: WebCore JavaScriptAssignee: Nobody <webkit-unassigned>
Status: UNCONFIRMED    
Severity: Normal Keywords: InRadar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: All   

Alexander Mitin
Reported 2010-01-09 11:20:09 PST
Consider the following JS code: function myfunc(arg) { return myWebScriptingInstance(arg); } where 'myWebScriptingInstance' is the embedded objc object instance which conforms to WebScripting protocol. In this case I expect 'invokeDefaultMethodWithArguments:' message to be send to my objc object. And all goes fine until 'arg' is JS-null. I've done some investigations on this and I've found: According to docs, JS-null should be translated into objc nil value. OK, it translated into nil, but this value can't be put into NSArray, so there's the exception thrown which then skipped silently! As the result, there is no message sent to my object (see WebCore/bridge/objc/objc_instance.mm). And no any chance to get the cause of what happened, just returned undefined value as the invocation result. Why not to just put [NSNull null] into the NSArray?
Attachments
Mark Rowe (bdash)
Comment 1 2010-01-09 16:01:49 PST
Note You need to log in before you can comment on or make changes to this bug.