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

Commit a1f5ee267fc74f84aadf5603d4ff86339fffea41 made a change to lib/android/exec.js which 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.