Bug 33425 - 'invokeDefaultMethodWithArguments:' skipped if 'null' JS value passed as one of the arguments
Summary: 'invokeDefaultMethodWithArguments:' skipped if 'null' JS value passed as one ...
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2010-01-09 11:20 PST by Alexander Mitin
Modified: 2010-01-09 16:01 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Mitin 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?
Comment 1 Mark Rowe (bdash) 2010-01-09 16:01:49 PST
<rdar://problem/7526986>