apache/incubator-cordova-android — pull request #26 by will-quast (2012-05-30 00:15:15+00:00)
Title: Fix to help JS compressors not variable rename vars used in cordova.exec's eval.

A change to lib/android/exec.js has broken Google Closure Compiler's compressed version.

// If a result was returned
if (r.length > 0) {
var v;
eval("v="+r+";");

// If status is OK, then return value back to caller
if (v.status === cordova.callbackStatus.OK) {

is compressed to

if(h.length>0){eval("v="+h+";");if((void 0).status===g.callbackStatus.OK){

which does not work.

I would suggest using JSON.parse instead, but this requires a small change to PluginResult.java to return valid JSON.

I have made a pull request in both incubator-cordova-js and incubator-cordova-android.