[Webkit-unassigned] [Bug 85669] New: Javascript returns object instead of null

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 4 14:22:10 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=85669

           Summary: Javascript returns object instead of null
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Android
        OS/Version: Android
            Status: UNCONFIRMED
          Severity: Major
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jakeoil at bellsouth.net


Created an attachment (id=140327)
 --> (https://bugs.webkit.org/attachment.cgi?id=140327&action=review)
Demonstrates problem on emulator

This is a problem using a WebView with a javascript interface.  It is sometimes called a Java Bridge.

The occurs only on some android platforms.

A Javascript call is made to a function which returns null.
On some systems the interface returns an object instead of null.

This is a pretty basic problem, but I haven't seen it specifically written up anywhere.

In other words,
  var obj = api.thisReturnsNull();
  if (obj) and if (obj != null) evaluate to true instead of the expected false 

Also, in the above case
  obj.toString() evaluates to: [object Object]

Incidentally, a proper object will look something like
  com.test.JsActivity$NonTrivialClass at 4137f418

I have seen this on an HTC Rezound (ICS) and the emulator (ICS 4.0 and 4.0.2)

I have an application which demonstrates this.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list