rem: this.methodList.push('system.listMethods'); this.methodList.push('system.describe'); 
add: this.__methodList.push('system.listMethods'); this.__methodList.push('system.describe'); 
context: rpc.ServiceProxy = function(serviceURL, options){	//if(typeof Prototype == 'undefined')	//	throw Error("The RPC client currently requires the use of Prototype.");	this.serviceURL = serviceURL;		//Determine if accessing the server would violate the same origin policy	this.isCrossSite = false;	var urlParts = this.serviceURL.match(/^(\w+:)\/\/([^\/]+?)(?::(\d+))?(?:$|\/)/);	if(urlParts){		this.isCrossSite = (			location.protocol !=  urlParts[1] ||			document.domain   !=  urlParts[2] ||			location.port     != (urlParts[3] || "")		);	}		//Set other default options	var providedMethodList;	this.isAsynchronous = true;	this.isResponseSanitized = true;	this.authUsername = null;	this.authPassword = null;	this.callbackParamName = 'JSON-response-callback';	this.protocol = 'JSON-RPC';	this.dateEncoding = 'ISO8601'; //"@ticks@" || "classHinting" || "ASP.NET"	this.decodeISO8601 = true; //JSON only		//Get the provided options	if(options instanceof Object){		if(options.asynchronous !== undefined){			this.isAsynchronous = !!options.asynchronous;			if(!this.isAsynchronous && this.isCrossSite)				throw Error("It is not possible to establish a synchronous connection to a cross-site RPC service.");		}		if(options.sanitize != undefined)			this.isResponseSanitized = !!options.sanitize;		if(options.user != undefined)			this.authUsername = options.user;		if(options.password != undefined)			this.authPassword = options.password;		if(options.callbackParamName != undefined)			this.callbackParamName = options.callbackParamName;		if(String(options.protocol).toUpperCase() == 'XML-RPC')			this.protocol = 'XML-RPC';		if(options.dateEncoding != undefined)			this.dateEncoding = options.dateEncoding;		if(options.decodeISO8601 != undefined)			this.decodeISO8601 = !!options.decodeISO8601;		providedMethodList = options.methods;	}	if(this.isCrossSite && this.isResponseSanitized){		throw Error("You are attempting to access a service on another site, and the JSON data returned " +					"by cross-site requests cannot be sanitized. You must therefore explicitly set the " +					"'sanitize' option to false (it is true by default) in order to proceed with making " +					"potentially insecure cross-site rpc calls.");	}	if(this.isCrossSite && this.protocol == 'XML-RPC')		throw Error("Unable to use the XML-RPC protocol to access services on other domains.");		//Obtain the list of methods made available by the server	if(this.isCrossSite && !providedMethodList)		throw Error("You must manually supply the service's method names since auto-introspection is not permitted for cross-site services.");	if(providedMethodList)		this.methodList = providedMethodList;	else {		//Introspection must be performed synchronously		var async = this.isAsynchronous;		this.isAsynchronous = false;		this.methodList = this.callMethod("system.listMethods", []);		this.isAsynchronous = async;	}	this.methodList.push('system.listMethods');	this.methodList.push('system.describe');		//Create local "wrapper" functions which reference the methods obtained above	for(var methodName, i = 0; methodName = this.methodList[i]; i++){		//Make available the received methods in the form of chained property lists (eg. "parent.child.methodName")		var methodObject = this;		var propChain = methodName.split(/\./);		for(var j = 0; j+1 < propChain.length; j++){			if(!methodObject[propChain[j]])				methodObject[propChain[j]] = {};			methodObject = methodObject[propChain[j]];		}		//Create a wrapper to this.callMethod with this instance and this methodName bound		var wrapper = (function(instance, methodName){			var call = {instance:instance, methodName:methodName}; //Pass parameters into closure			return function(){				if(this.isAsynchronous){					if(arguments.length == 1 && arguments[0] instanceof Object){						call.instance.callMethod(call.methodName,												 arguments[0].params,												 arguments[0].onSuccess,												 arguments[0].onException,												 arguments[0].onComplete);					}					else {						call.instance.callMethod(call.methodName,												 arguments[0],												 arguments[1],												 arguments[2],												 arguments[3]);					}						return undefined;				}				else return call.instance.callMethod(call.methodName, rpc.toArray(arguments));			};		})(this, methodName);				methodObject[propChain[propChain.length-1]] = wrapper;	}};
meta: 8021	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8021/8583684aeb41bb178925a8dc54888426e5620b6b/rpc.js/buggy/rpc.js