<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>33425</bug_id>
          
          <creation_ts>2010-01-09 11:20:09 -0800</creation_ts>
          <short_desc>&apos;invokeDefaultMethodWithArguments:&apos; skipped if &apos;null&apos; JS value passed as one of the arguments</short_desc>
          <delta_ts>2010-01-09 16:01:51 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Alexander Mitin">Alexander.Mitin</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>179024</commentid>
    <comment_count>0</comment_count>
    <who name="Alexander Mitin">Alexander.Mitin</who>
    <bug_when>2010-01-09 11:20:09 -0800</bug_when>
    <thetext>Consider the following JS code:

function myfunc(arg) {
  return myWebScriptingInstance(arg);
}

where &apos;myWebScriptingInstance&apos; is the embedded objc object instance which conforms to WebScripting protocol.
In this case I expect &apos;invokeDefaultMethodWithArguments:&apos; message to be send to my objc object. 
And all goes fine until &apos;arg&apos; is JS-null. 

I&apos;ve done some investigations on this and I&apos;ve found:
According to docs, JS-null should be translated into objc nil value.
OK, it translated into nil, but this value can&apos;t be put into NSArray, so there&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>179076</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2010-01-09 16:01:49 -0800</bug_when>
    <thetext>&lt;rdar://problem/7526986&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>