You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Andrew Grieve <ag...@google.com> on 2012/10/25 16:28:30 UTC

Re: js commit: Need to coerce messags into a string on Android 2.2

Nice catch Simon! There's already similar fix in the exec() function, but I
dropped the ball on applying it to the retrieveJsMessages function.

I'm going put in another change to move this logic into the nativeApi
object so that the call sites don't need to worry about it.

Won't need a re-tag though, as it shouldn't change the logic at all.


On Wed, Oct 24, 2012 at 4:25 PM, <ma...@apache.org> wrote:

> Updated Branches:
>   refs/heads/master 884cb0e8f -> 6881d72b9
>
>
> Need to coerce messags into a string on Android 2.2
>
>
> Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
> Commit:
> http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/6881d72b
> Tree:
> http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/6881d72b
> Diff:
> http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/6881d72b
>
> Branch: refs/heads/master
> Commit: 6881d72b96f476a1e8cd6e03fe1465a0fb88b000
> Parents: 884cb0e
> Author: Simon MacDonald <si...@gmail.com>
> Authored: Wed Oct 24 15:53:20 2012 -0400
> Committer: Simon MacDonald <si...@gmail.com>
> Committed: Wed Oct 24 15:53:20 2012 -0400
>
> ----------------------------------------------------------------------
>  lib/android/exec.js |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/6881d72b/lib/android/exec.js
> ----------------------------------------------------------------------
> diff --git a/lib/android/exec.js b/lib/android/exec.js
> index dcc1617..bc9083a 100644
> --- a/lib/android/exec.js
> +++ b/lib/android/exec.js
> @@ -199,6 +199,8 @@ androidExec.processMessages = function(messages) {
>                  window.setTimeout(pollOnce, 0);
>                  break;
>              }
> +            // Needed for Android 2.2
> +            messages = "" + messages;
>              var spaceIdx = messages.indexOf(' ');
>              var msgLen = +messages.slice(0, spaceIdx);
>              var message = messages.substr(spaceIdx + 1, msgLen);
>
>