rem: if (!batch.async) DWREngine._stateChange(batch); 
add: if (!batch.async) dwr.engine._stateChange(batch); 
context: DWREngine._sendData = function(batch) {  batch.map.batchId = DWREngine._nextBatchId++;  DWREngine._batches[batch.map.batchId] = batch;  DWREngine._batchesLength++;  batch.completed = false;  DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length);  for (var i = 0; i < batch.preHooks.length; i++) {    batch.preHooks[i]();  }  batch.preHooks = null;  // Set a timeout  if (batch.timeout && batch.timeout != 0) {    batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout);  }  // Get setup for XMLHttpRequest if possible  if (batch.rpcType == DWREngine.XMLHttpRequest) {    if (window.XMLHttpRequest) {      batch.req = new XMLHttpRequest();    }    // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used    else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) {      batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP);    }  }  var prop, request;  if (batch.req) {    // Proceed using XMLHttpRequest    if (batch.async) {      batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); };    }    // If we're polling, record this for monitoring    if (batch.isPoll) DWREngine._pollReq = batch.req;    // Workaround for Safari 1.x POST bug    var indexSafari = navigator.userAgent.indexOf("Safari/");    if (indexSafari >= 0) {      var version = navigator.userAgent.substring(indexSafari + 7);      if (parseInt(version, 10) < 400) batch.httpMethod = "GET";    }    batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall;    request = DWREngine._constructRequest(batch);    try {      batch.req.open(batch.httpMethod, request.url, batch.async);      try {        for (prop in batch.headers) {          var value = batch.headers[prop];          if (typeof value == "string") batch.req.setRequestHeader(prop, value);        }        if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain");      }      catch (ex) {        DWREngine._handleWarning(null, ex);      }      batch.req.send(request.body);      if (!batch.async) DWREngine._stateChange(batch);    }    catch (ex) {      DWREngine._handleError(batch, ex);    }  }  else if (batch.rpcType != DWREngine.ScriptTag) {    var idname = "dwr-if-" + batch.map["c0-id"];    // Proceed using iframe    batch.div = document.createElement("div");    batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>";    document.body.appendChild(batch.div);    batch.iframe = document.getElementById(idname);    batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;");    batch.iframe.batch = batch;    batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall;    if (batch.isPoll) {      // Settings that vary if we are polling      DWREngine._pollFrame = batch.iframe;      DWREngine._pollCometSize = 0;    }    request = DWREngine._constructRequest(batch);    if (batch.httpMethod == "GET") {      batch.iframe.setAttribute("src", request.url);      document.body.appendChild(batch.iframe);    }    else {      batch.form = document.createElement("form");      batch.form.setAttribute("id", "dwr-form");      batch.form.setAttribute("action", request.url);      batch.form.setAttribute("target", idname);      batch.form.target = idname;      batch.form.setAttribute("method", batch.httpMethod);      for (prop in batch.map) {        var value = batch.map[prop];        if (typeof value != "function") {          var formInput = document.createElement("input");          formInput.setAttribute("type", "hidden");          formInput.setAttribute("name", prop);          formInput.setAttribute("value", value);          batch.form.appendChild(formInput);        }      }      document.body.appendChild(batch.form);      batch.form.submit();    }  }  else {    batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST    batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall;    request = DWREngine._constructRequest(batch);    batch.script = document.createElement("script");    batch.script.id = "dwr-st-" + batch.map["c0-id"];    batch.script.src = request.url;    document.body.appendChild(batch.script);  }};
meta: 266	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/266/3edb5a1fd9763d1db91f61d8efca822206f14560/engine.js/clean/java/org/directwebremoting/engine.js