Bug 33425
Summary: | 'invokeDefaultMethodWithArguments:' skipped if 'null' JS value passed as one of the arguments | ||
---|---|---|---|
Product: | WebKit | Reporter: | Alexander Mitin <Alexander.Mitin> |
Component: | WebCore JavaScript | Assignee: | Nobody <webkit-unassigned> |
Status: | UNCONFIRMED | ||
Severity: | Normal | Keywords: | InRadar |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | All |
Alexander Mitin
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Mark Rowe (bdash)
<rdar://problem/7526986>