incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse <purplecabb...@gmail.com>
Subject Re: JS->Native Bridge on iOS and the "Options" object
Date Thu, 12 Jul 2012 20:22:08 GMT
No reason, just legacy code.
For file transfer I recommend that the headers value is just a url encoded
string, as that is how it is transfered anyway.


On Thu, Jul 12, 2012 at 1:16 PM, Andrew Grieve <agrieve@google.com> wrote:

> The exec() method on iOS allows only a single js object to appear in the
> arguments, and it passes it onto the native side as the "options" object.
>
> Code snippet:
>     for (var i = 0; i < actionArgs.length; ++i) {
>         var arg = actionArgs[i];
>         if (arg === undefined || arg === null) { // nulls are pushed to the
> args now (becomes NSNull)
>             command["arguments"].push(arg);
>         } else if (typeof(arg) == 'object' && !(utils.isArray(arg))) {
>             command.options = arg;
>         } else {
>             command["arguments"].push(arg);
>         }
>     }
>
>
> For reworking how headers are sent in FileTransfer, I tried to pass the
> headers map as well as the upload params, and so got into trouble when the
> headers map clobbered the params map in the code snippet above.
>
> So, I'm wondering what the reason is for doing this?
>



-- 
@purplecabbage
risingj.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message