[Webkit-unassigned] [Bug 7012] Coerce javascript objects to appleScript compatible types prior to returning them to applescript

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Sat Feb 4 00:51:51 PST 2006


ap at nypop.com changed:

           What    |Removed                     |Added
Attachment #6223 is|0                           |1
           obsolete|                            |
   Attachment #6237|                            |review?
               Flag|                            |

------- Comment #6 from ap at nypop.com  2006-02-04 00:51 PDT -------
Created an attachment (id=6237)
 --> (http://bugzilla.opendarwin.org/attachment.cgi?id=6237&action=view)
proposed patch

(In reply to comment #5)
> I would fall back to always returning a string in the "default" case instead of
> the "Unknown JavaScript type: %d", jsValue->type()" error, unless this is never
> reached.

  Yes, it should be never reached - the switch has cases for all primitive
JavaScript types (I think).

> The WebView.h header can't be changed until we get the API approved. You will
> need to use WebViewPrivate.h for this interface.


> Coercing to list descriptors is easy to do using
> [NSAppleEventDescriptor listDescriptor] and insertDescriptor:atIndex:.

  Yes, that's easy - I just don't see how the end result should look like for
non-trivial JavaScript arrays. And adding a conversion that only works "most of
the time" is IMHO not a good idea...

  Still, one option to consider: only convert arrays that are not sparse, for
which element indices start with zero, and don't descend into them recursively
(to avoid circular references). What do you think?

Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list