/socketTests/bin/main.js
JavaScript | 2649 lines | 2646 code | 1 blank | 2 comment | 620 complexity | a449031d7d88e3397f5fb60f53a8c915 MD5 | raw file
Possible License(s): MIT
Large files files are truncated, but you can click here to view the full file
- // Generated by Haxe
- (function (console, $global) { "use strict";
- var $estr = function() { return js_Boot.__string_rec(this,''); };
- function $extend(from, fields) {
- function Inherit() {} Inherit.prototype = from; var proto = new Inherit();
- for (var name in fields) proto[name] = fields[name];
- if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString;
- return proto;
- }
- var EReg = function(r,opt) {
- opt = opt.split("u").join("");
- this.r = new RegExp(r,opt);
- };
- EReg.__name__ = ["EReg"];
- EReg.prototype = {
- r: null
- ,match: function(s) {
- if(this.r.global) this.r.lastIndex = 0;
- this.r.m = this.r.exec(s);
- this.r.s = s;
- return this.r.m != null;
- }
- ,matched: function(n) {
- var tmp;
- if(this.r.m != null && n >= 0 && n < this.r.m.length) tmp = this.r.m[n]; else throw new js__$Boot_HaxeError("EReg::matched");
- return tmp;
- }
- ,__class__: EReg
- };
- var HxOverrides = function() { };
- HxOverrides.__name__ = ["HxOverrides"];
- HxOverrides.cca = function(s,index) {
- var x = s.charCodeAt(index);
- if(x != x) return undefined;
- return x;
- };
- HxOverrides.substr = function(s,pos,len) {
- if(len == null) len = s.length; else if(len < 0) {
- if(pos == 0) len = s.length + len; else return "";
- }
- if(pos < 0) {
- pos = s.length + pos;
- if(pos < 0) pos = 0;
- }
- return s.substr(pos,len);
- };
- HxOverrides.indexOf = function(a,obj,i) {
- var len = a.length;
- if(i < 0) {
- i += len;
- if(i < 0) i = 0;
- }
- while(i < len) {
- if(a[i] === obj) return i;
- i++;
- }
- return -1;
- };
- HxOverrides.remove = function(a,obj) {
- var i = HxOverrides.indexOf(a,obj,0);
- if(i == -1) return false;
- a.splice(i,1);
- return true;
- };
- HxOverrides.iter = function(a) {
- return { cur : 0, arr : a, hasNext : function() {
- return this.cur < this.arr.length;
- }, next : function() {
- return this.arr[this.cur++];
- }};
- };
- var IntIterator = function(min,max) {
- this.min = min;
- this.max = max;
- };
- IntIterator.__name__ = ["IntIterator"];
- IntIterator.prototype = {
- min: null
- ,max: null
- ,__class__: IntIterator
- };
- var Lambda = function() { };
- Lambda.__name__ = ["Lambda"];
- Lambda.exists = function(it,f) {
- var $it0 = $iterator(it)();
- while( $it0.hasNext() ) {
- var x = $it0.next();
- if(f(x)) return true;
- }
- return false;
- };
- var List = function() {
- this.length = 0;
- };
- List.__name__ = ["List"];
- List.prototype = {
- h: null
- ,q: null
- ,length: null
- ,add: function(item) {
- var x = [item];
- if(this.h == null) this.h = x; else this.q[1] = x;
- this.q = x;
- this.length++;
- }
- ,push: function(item) {
- var x = [item,this.h];
- this.h = x;
- if(this.q == null) this.q = x;
- this.length++;
- }
- ,pop: function() {
- if(this.h == null) return null;
- var x = this.h[0];
- this.h = this.h[1];
- if(this.h == null) this.q = null;
- this.length--;
- return x;
- }
- ,remove: function(v) {
- var prev = null;
- var l = this.h;
- while(l != null) {
- if(l[0] == v) {
- if(prev == null) this.h = l[1]; else prev[1] = l[1];
- if(this.q == l) this.q = prev;
- this.length--;
- return true;
- }
- prev = l;
- l = l[1];
- }
- return false;
- }
- ,iterator: function() {
- return new _$List_ListIterator(this.h);
- }
- ,__class__: List
- };
- var _$List_ListIterator = function(head) {
- this.head = head;
- this.val = null;
- };
- _$List_ListIterator.__name__ = ["_List","ListIterator"];
- _$List_ListIterator.prototype = {
- head: null
- ,val: null
- ,hasNext: function() {
- return this.head != null;
- }
- ,next: function() {
- this.val = this.head[0];
- this.head = this.head[1];
- return this.val;
- }
- ,__class__: _$List_ListIterator
- };
- var Main = function() { };
- Main.__name__ = ["Main"];
- Main.main = function() {
- js_Node.require("source-map-support").install();
- haxe_Log.trace("Zero part",{ fileName : "Main.hx", lineNumber : 38, className : "Main", methodName : "main"});
- var serv = null;
- var cl = new pony_net_SocketClient(null,13579,100);
- var tmp;
- if(cl.eLog == null) {
- var tmp1;
- var this2;
- this2 = new pony_Priority(null,false,true);
- this2.compare = pony_events__$Event2_Event2_$Impl_$.compare;
- tmp1 = this2;
- tmp = cl.eLog = tmp1;
- } else tmp = cl.eLog;
- var this1 = tmp;
- var listener = { once : false, listener : pony_events_Listener2Type.LFunction2(haxe_Log.trace)};
- this1.add(listener);
- var tmp2;
- if(cl.eError == null) {
- var tmp3;
- var this4;
- this4 = new pony_Priority(null,false,true);
- this4.compare = pony_events__$Event2_Event2_$Impl_$.compare;
- tmp3 = this4;
- tmp2 = cl.eError = tmp3;
- } else tmp2 = cl.eError;
- var this3 = tmp2;
- var listener1 = { once : false, listener : pony_events_Listener2Type.LFunction2(haxe_Log.trace)};
- this3.add(listener1);
- var tmp4;
- if(cl.eConnect == null) {
- var tmp5;
- var this6;
- this6 = new pony_Priority(null,false,true);
- this6.compare = pony_events__$Event1_Event1_$Impl_$.compare;
- tmp5 = this6;
- tmp4 = cl.eConnect = tmp5;
- } else tmp4 = cl.eConnect;
- var this5 = tmp4;
- var listener2 = { once : false, listener : pony_events_Listener1Type.LFunction0(function() {
- haxe_Log.trace("Connected",{ fileName : "Main.hx", lineNumber : 45, className : "Main", methodName : "main"});
- cl.destroy();
- serv.destroy();
- if(Main.testCount % 4 != 0) throw new js__$Boot_HaxeError("Wrong test count");
- pony_tests_AsyncTests.init(Main.testCount);
- Main.firstTest();
- })};
- this5.add(listener2);
- haxe_Timer.delay(function() {
- serv = new pony_net_SocketServer(13579);
- },100);
- };
- Main.firstTest = function() {
- haxe_Log.trace("First part",{ fileName : "Main.hx", lineNumber : 63, className : "Main", methodName : "firstTest"});
- var server = Main.createServer(6001);
- var _g1 = 0;
- var _g = Main.partCount;
- while(_g1 < _g) {
- var i = _g1++;
- var tmp;
- var i1 = [i];
- tmp = (function(i1) {
- return function() {
- return Main.createClient(i1[0]);
- };
- })(i1);
- haxe_Timer.delay(tmp,Main.delay + Main.delay * i);
- }
- pony_tests_AsyncTests.wait(new IntIterator(0,Main.blockCount),function() {
- haxe_Log.trace("Second part",{ fileName : "Main.hx", lineNumber : 68, className : "Main", methodName : "firstTest"});
- server.destroy();
- var server1 = Main.createServer(6002);
- var _g11 = Main.blockCount;
- var _g2 = Main.blockCount + Main.partCount;
- while(_g11 < _g2) {
- var i2 = _g11++;
- var tmp1;
- var i3 = [i2];
- tmp1 = (function(i3) {
- return function() {
- return Main.createClient(i3[0]);
- };
- })(i3);
- haxe_Timer.delay(tmp1,Main.delay + Main.delay * (i2 - Main.blockCount));
- }
- pony_tests_AsyncTests.wait(new IntIterator(Main.blockCount,Main.testCount),function() {
- server1.destroy();
- Main.finish = true;
- });
- });
- };
- Main.createServer = function(aPort) {
- Main.port = aPort;
- var server = new pony_net_SocketServer(aPort);
- var listener = { once : false, listener : pony_events_Listener1Type.LFunction1(function(cl) {
- var bo = new haxe_io_BytesOutput();
- bo.writeString("hi world");
- cl.send(bo);
- })};
- server.eConnect.add(listener);
- var listener1 = { once : false, listener : pony_events_Listener2Type.LFunction1(function(bi) {
- var i = bi.readInt32();
- var b = pony_Tools.readStr(bi);
- pony_tests_AsyncTests.assertList.push({ a : "hello user", b : b, pos : { fileName : "Main.hx", lineNumber : 92, className : "Main", methodName : "createServer"}});
- pony_tests_AsyncTests.setFlag(Main.partCount + i,{ fileName : "Main.hx", lineNumber : 93, className : "Main", methodName : "createServer"});
- })};
- server.eData.add(listener1);
- return server;
- };
- Main.createClient = function(i) {
- var client = new pony_net_SocketClient(null,Main.port);
- var listener = { once : false, listener : pony_events_Listener2Type.LFunction1(function(s) {
- pony_tests_AsyncTests.assertList.push({ a : s, b : "hi world", pos : { fileName : "Main.hx", lineNumber : 102, className : "Main", methodName : "createClient"}});
- var bo = new haxe_io_BytesOutput();
- bo.writeInt32(i);
- bo.writeInt32("hello user".length);
- bo.writeString("hello user");
- client.send(bo);
- pony_tests_AsyncTests.setFlag(i,{ fileName : "Main.hx", lineNumber : 107, className : "Main", methodName : "createClient"});
- client.destroy();
- client = null;
- })};
- listener.once = true;
- client.eString.add(listener,0);
- return client;
- };
- Math.__name__ = ["Math"];
- var Reflect = function() { };
- Reflect.__name__ = ["Reflect"];
- Reflect.field = function(o,field) {
- try {
- return o[field];
- } catch( e ) {
- haxe_CallStack.lastException = e;
- if (e instanceof js__$Boot_HaxeError) e = e.val;
- return null;
- }
- };
- Reflect.isFunction = function(f) {
- return typeof(f) == "function" && !(f.__name__ || f.__ename__);
- };
- Reflect.makeVarArgs = function(f) {
- return function() {
- var a = Array.prototype.slice.call(arguments);
- return f(a);
- };
- };
- var Std = function() { };
- Std.__name__ = ["Std"];
- Std.string = function(s) {
- return js_Boot.__string_rec(s,"");
- };
- Std.parseInt = function(x) {
- var v = parseInt(x,10);
- if(v == 0 && (HxOverrides.cca(x,1) == 120 || HxOverrides.cca(x,1) == 88)) v = parseInt(x);
- if(isNaN(v)) return null;
- return v;
- };
- var StringBuf = function() {
- this.b = "";
- };
- StringBuf.__name__ = ["StringBuf"];
- StringBuf.prototype = {
- b: null
- ,__class__: StringBuf
- };
- var StringTools = function() { };
- StringTools.__name__ = ["StringTools"];
- StringTools.htmlEscape = function(s,quotes) {
- s = s.split("&").join("&").split("<").join("<").split(">").join(">");
- return quotes?s.split("\"").join(""").split("'").join("'"):s;
- };
- StringTools.startsWith = function(s,start) {
- return s.length >= start.length && HxOverrides.substr(s,0,start.length) == start;
- };
- StringTools.isSpace = function(s,pos) {
- var c = HxOverrides.cca(s,pos);
- return c > 8 && c < 14 || c == 32;
- };
- StringTools.ltrim = function(s) {
- var l = s.length;
- var r = 0;
- while(r < l && StringTools.isSpace(s,r)) r++;
- if(r > 0) return HxOverrides.substr(s,r,l - r); else return s;
- };
- StringTools.rtrim = function(s) {
- var l = s.length;
- var r = 0;
- while(r < l && StringTools.isSpace(s,l - r - 1)) r++;
- if(r > 0) return HxOverrides.substr(s,0,l - r); else return s;
- };
- StringTools.trim = function(s) {
- return StringTools.ltrim(StringTools.rtrim(s));
- };
- var Type = function() { };
- Type.__name__ = ["Type"];
- Type.getClassName = function(c) {
- var a = c.__name__;
- if(a == null) return null;
- return a.join(".");
- };
- Type.createEmptyInstance = function(cl) {
- function empty() {}; empty.prototype = cl.prototype;
- return new empty();
- };
- Type.getInstanceFields = function(c) {
- var a = [];
- for(var i in c.prototype) a.push(i);
- HxOverrides.remove(a,"__class__");
- HxOverrides.remove(a,"__properties__");
- return a;
- };
- var _$UInt_UInt_$Impl_$ = {};
- _$UInt_UInt_$Impl_$.__name__ = ["_UInt","UInt_Impl_"];
- _$UInt_UInt_$Impl_$.gt = function(a,b) {
- var aNeg = a < 0;
- var bNeg = b < 0;
- return aNeg != bNeg?aNeg:a > b;
- };
- _$UInt_UInt_$Impl_$.gte = function(a,b) {
- var aNeg = a < 0;
- var bNeg = b < 0;
- return aNeg != bNeg?aNeg:a >= b;
- };
- var haxe_StackItem = { __ename__ : true, __constructs__ : ["CFunction","Module","FilePos","Method","LocalFunction"] };
- haxe_StackItem.CFunction = ["CFunction",0];
- haxe_StackItem.CFunction.toString = $estr;
- haxe_StackItem.CFunction.__enum__ = haxe_StackItem;
- haxe_StackItem.Module = function(m) { var $x = ["Module",1,m]; $x.__enum__ = haxe_StackItem; $x.toString = $estr; return $x; };
- haxe_StackItem.FilePos = function(s,file,line) { var $x = ["FilePos",2,s,file,line]; $x.__enum__ = haxe_StackItem; $x.toString = $estr; return $x; };
- haxe_StackItem.Method = function(classname,method) { var $x = ["Method",3,classname,method]; $x.__enum__ = haxe_StackItem; $x.toString = $estr; return $x; };
- haxe_StackItem.LocalFunction = function(v) { var $x = ["LocalFunction",4,v]; $x.__enum__ = haxe_StackItem; $x.toString = $estr; return $x; };
- var haxe_CallStack = function() { };
- haxe_CallStack.__name__ = ["haxe","CallStack"];
- haxe_CallStack.getStack = function(e) {
- if(e == null) return [];
- var oldValue = Error.prepareStackTrace;
- Error.prepareStackTrace = function(error,callsites) {
- var stack = [];
- var _g = 0;
- while(_g < callsites.length) {
- var site = callsites[_g];
- ++_g;
- if(haxe_CallStack.wrapCallSite != null) site = haxe_CallStack.wrapCallSite(site);
- var method = null;
- var fullName = site.getFunctionName();
- if(fullName != null) {
- var idx = fullName.lastIndexOf(".");
- if(idx >= 0) {
- var className = HxOverrides.substr(fullName,0,idx);
- var methodName = HxOverrides.substr(fullName,idx + 1,null);
- method = haxe_StackItem.Method(className,methodName);
- }
- }
- stack.push(haxe_StackItem.FilePos(method,site.getFileName(),site.getLineNumber()));
- }
- return stack;
- };
- var a = haxe_CallStack.makeStack(e.stack);
- Error.prepareStackTrace = oldValue;
- return a;
- };
- haxe_CallStack.exceptionStack = function() {
- return haxe_CallStack.getStack(haxe_CallStack.lastException);
- };
- haxe_CallStack.toString = function(stack) {
- var b = new StringBuf();
- var _g = 0;
- while(_g < stack.length) {
- var s = stack[_g];
- ++_g;
- b.b += "\nCalled from ";
- haxe_CallStack.itemToString(b,s);
- }
- return b.b;
- };
- haxe_CallStack.itemToString = function(b,s) {
- switch(s[1]) {
- case 0:
- b.b += "a C function";
- break;
- case 1:
- var m = s[2];
- b.b += "module ";
- b.b += m == null?"null":"" + m;
- break;
- case 2:
- var line = s[4];
- var file = s[3];
- var s1 = s[2];
- if(s1 != null) {
- haxe_CallStack.itemToString(b,s1);
- b.b += " (";
- }
- b.b += file == null?"null":"" + file;
- b.b += " line ";
- b.b += line == null?"null":"" + line;
- if(s1 != null) b.b += ")";
- break;
- case 3:
- var meth = s[3];
- var cname = s[2];
- b.b += cname == null?"null":"" + cname;
- b.b += ".";
- b.b += meth == null?"null":"" + meth;
- break;
- case 4:
- var n = s[2];
- b.b += "local function #";
- b.b += n == null?"null":"" + n;
- break;
- }
- };
- haxe_CallStack.makeStack = function(s) {
- if(s == null) return []; else if(typeof(s) == "string") {
- var stack = s.split("\n");
- if(stack[0] == "Error") stack.shift();
- var m = [];
- var rie10 = new EReg("^ at ([A-Za-z0-9_. ]+) \\(([^)]+):([0-9]+):([0-9]+)\\)$","");
- var _g = 0;
- while(_g < stack.length) {
- var line = stack[_g];
- ++_g;
- if(rie10.match(line)) {
- var path = rie10.matched(1).split(".");
- var meth = path.pop();
- var file = rie10.matched(2);
- var line1 = Std.parseInt(rie10.matched(3));
- m.push(haxe_StackItem.FilePos(meth == "Anonymous function"?haxe_StackItem.LocalFunction():meth == "Global code"?null:haxe_StackItem.Method(path.join("."),meth),file,line1));
- } else m.push(haxe_StackItem.Module(StringTools.trim(line)));
- }
- return m;
- } else return s;
- };
- var haxe_IMap = function() { };
- haxe_IMap.__name__ = ["haxe","IMap"];
- var haxe_Log = function() { };
- haxe_Log.__name__ = ["haxe","Log"];
- haxe_Log.trace = function(v,infos) {
- js_Boot.__trace(v,infos);
- };
- var haxe_Timer = function(time_ms) {
- var me = this;
- this.id = setInterval(function() {
- me.run();
- },time_ms);
- };
- haxe_Timer.__name__ = ["haxe","Timer"];
- haxe_Timer.delay = function(f,time_ms) {
- var t = new haxe_Timer(time_ms);
- t.run = function() {
- t.stop();
- f();
- };
- return t;
- };
- haxe_Timer.prototype = {
- id: null
- ,stop: function() {
- if(this.id == null) return;
- clearInterval(this.id);
- this.id = null;
- }
- ,run: function() {
- }
- ,__class__: haxe_Timer
- };
- var haxe_ds_IntMap = function() {
- this.h = { };
- };
- haxe_ds_IntMap.__name__ = ["haxe","ds","IntMap"];
- haxe_ds_IntMap.__interfaces__ = [haxe_IMap];
- haxe_ds_IntMap.prototype = {
- h: null
- ,remove: function(key) {
- if(!this.h.hasOwnProperty(key)) return false;
- delete(this.h[key]);
- return true;
- }
- ,keys: function() {
- var a = [];
- for( var key in this.h ) {
- if(this.h.hasOwnProperty(key)) a.push(key | 0);
- }
- return HxOverrides.iter(a);
- }
- ,iterator: function() {
- return { ref : this.h, it : this.keys(), hasNext : function() {
- return this.it.hasNext();
- }, next : function() {
- var i = this.it.next();
- return this.ref[i];
- }};
- }
- ,__class__: haxe_ds_IntMap
- };
- var haxe_io_Bytes = function(length,b) {
- this.length = length;
- this.b = b;
- };
- haxe_io_Bytes.__name__ = ["haxe","io","Bytes"];
- haxe_io_Bytes.alloc = function(length) {
- return new haxe_io_Bytes(length,new Buffer(length));
- };
- haxe_io_Bytes.ofString = function(s) {
- var nb = new Buffer(s,"utf8");
- return new haxe_io_Bytes(nb.length,nb);
- };
- haxe_io_Bytes.ofData = function(b) {
- return new haxe_io_Bytes(b.length,b);
- };
- haxe_io_Bytes.prototype = {
- length: null
- ,b: null
- ,getString: function(pos,len) {
- if(pos < 0 || len < 0 || pos + len > this.length) throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds);
- var s = "";
- var b = this.b;
- var fcc = String.fromCharCode;
- var i = pos;
- var max = pos + len;
- while(i < max) {
- var c = b[i++];
- if(c < 128) {
- if(c == 0) break;
- s += fcc(c);
- } else if(c < 224) s += fcc((c & 63) << 6 | b[i++] & 127); else if(c < 240) {
- var c2 = b[i++];
- s += fcc((c & 31) << 12 | (c2 & 127) << 6 | b[i++] & 127);
- } else {
- var c21 = b[i++];
- var c3 = b[i++];
- s += fcc((c & 15) << 18 | (c21 & 127) << 12 | c3 << 6 & 127 | b[i++] & 127);
- }
- }
- return s;
- }
- ,toString: function() {
- return this.getString(0,this.length);
- }
- ,__class__: haxe_io_Bytes
- };
- var haxe_io_BytesBuffer = function() {
- this.b = [];
- };
- haxe_io_BytesBuffer.__name__ = ["haxe","io","BytesBuffer"];
- haxe_io_BytesBuffer.prototype = {
- b: null
- ,getBytes: function() {
- var nb = new Buffer(this.b);
- var bytes = new haxe_io_Bytes(nb.length,nb);
- this.b = null;
- return bytes;
- }
- ,__class__: haxe_io_BytesBuffer
- };
- var haxe_io_Input = function() { };
- haxe_io_Input.__name__ = ["haxe","io","Input"];
- haxe_io_Input.prototype = {
- bigEndian: null
- ,readByte: function() {
- throw new js__$Boot_HaxeError("Not implemented");
- }
- ,readBytes: function(s,pos,len) {
- var k = len;
- var b = s.b;
- if(pos < 0 || len < 0 || pos + len > s.length) throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds);
- while(k > 0) {
- b[pos] = this.readByte();
- pos++;
- k--;
- }
- return len;
- }
- ,readFullBytes: function(s,pos,len) {
- while(len > 0) {
- var k = this.readBytes(s,pos,len);
- pos += k;
- len -= k;
- }
- }
- ,read: function(nbytes) {
- var s = haxe_io_Bytes.alloc(nbytes);
- var p = 0;
- while(nbytes > 0) {
- var k = this.readBytes(s,p,nbytes);
- if(k == 0) throw new js__$Boot_HaxeError(haxe_io_Error.Blocked);
- p += k;
- nbytes -= k;
- }
- return s;
- }
- ,readInt32: function() {
- var ch1 = this.readByte();
- var ch2 = this.readByte();
- var ch3 = this.readByte();
- var ch4 = this.readByte();
- return this.bigEndian?ch4 | ch3 << 8 | ch2 << 16 | ch1 << 24:ch1 | ch2 << 8 | ch3 << 16 | ch4 << 24;
- }
- ,readString: function(len) {
- var b = haxe_io_Bytes.alloc(len);
- this.readFullBytes(b,0,len);
- return b.toString();
- }
- ,__class__: haxe_io_Input
- };
- var haxe_io_BytesInput = function(b,pos,len) {
- if(pos == null) pos = 0;
- if(len == null) len = b.length - pos;
- if(pos < 0 || len < 0 || pos + len > b.length) throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds);
- this.b = b.b;
- this.pos = pos;
- this.len = len;
- this.totlen = len;
- };
- haxe_io_BytesInput.__name__ = ["haxe","io","BytesInput"];
- haxe_io_BytesInput.__super__ = haxe_io_Input;
- haxe_io_BytesInput.prototype = $extend(haxe_io_Input.prototype,{
- b: null
- ,pos: null
- ,len: null
- ,totlen: null
- ,readByte: function() {
- if(this.len == 0) throw new js__$Boot_HaxeError(new haxe_io_Eof());
- this.len--;
- return this.b[this.pos++];
- }
- ,readBytes: function(buf,pos,len) {
- if(pos < 0 || len < 0 || pos + len > buf.length) throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds);
- if(this.len == 0 && len > 0) throw new js__$Boot_HaxeError(new haxe_io_Eof());
- if(this.len < len) len = this.len;
- var b1 = this.b;
- var b2 = buf.b;
- var _g = 0;
- while(_g < len) {
- var i = _g++;
- b2[pos + i] = b1[this.pos + i];
- }
- this.pos += len;
- this.len -= len;
- return len;
- }
- ,__class__: haxe_io_BytesInput
- });
- var haxe_io_Output = function() { };
- haxe_io_Output.__name__ = ["haxe","io","Output"];
- haxe_io_Output.prototype = {
- bigEndian: null
- ,writeByte: function(c) {
- throw new js__$Boot_HaxeError("Not implemented");
- }
- ,writeBytes: function(s,pos,len) {
- var k = len;
- var b = s.b;
- if(pos < 0 || len < 0 || pos + len > s.length) throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds);
- while(k > 0) {
- this.writeByte(b[pos]);
- pos++;
- k--;
- }
- return len;
- }
- ,write: function(s) {
- var l = s.length;
- var p = 0;
- while(l > 0) {
- var k = this.writeBytes(s,p,l);
- if(k == 0) throw new js__$Boot_HaxeError(haxe_io_Error.Blocked);
- p += k;
- l -= k;
- }
- }
- ,writeFullBytes: function(s,pos,len) {
- while(len > 0) {
- var k = this.writeBytes(s,pos,len);
- pos += k;
- len -= k;
- }
- }
- ,writeInt32: function(x) {
- if(this.bigEndian) {
- this.writeByte(x >>> 24);
- this.writeByte(x >> 16 & 255);
- this.writeByte(x >> 8 & 255);
- this.writeByte(x & 255);
- } else {
- this.writeByte(x & 255);
- this.writeByte(x >> 8 & 255);
- this.writeByte(x >> 16 & 255);
- this.writeByte(x >>> 24);
- }
- }
- ,writeString: function(s) {
- var b = haxe_io_Bytes.ofString(s);
- this.writeFullBytes(b,0,b.length);
- }
- ,__class__: haxe_io_Output
- };
- var haxe_io_BytesOutput = function() {
- this.b = new haxe_io_BytesBuffer();
- };
- haxe_io_BytesOutput.__name__ = ["haxe","io","BytesOutput"];
- haxe_io_BytesOutput.__super__ = haxe_io_Output;
- haxe_io_BytesOutput.prototype = $extend(haxe_io_Output.prototype,{
- b: null
- ,writeByte: function(c) {
- this.b.b.push(c);
- }
- ,writeBytes: function(buf,pos,len) {
- var _this = this.b;
- if(pos < 0 || len < 0 || pos + len > buf.length) throw new js__$Boot_HaxeError(haxe_io_Error.OutsideBounds);
- var b2 = buf.b;
- var _g1 = pos;
- var _g = pos + len;
- while(_g1 < _g) {
- var i = _g1++;
- _this.b.push(b2[i]);
- }
- return len;
- }
- ,getBytes: function() {
- return this.b.getBytes();
- }
- ,__class__: haxe_io_BytesOutput
- });
- var haxe_io_Eof = function() {
- };
- haxe_io_Eof.__name__ = ["haxe","io","Eof"];
- haxe_io_Eof.prototype = {
- toString: function() {
- return "Eof";
- }
- ,__class__: haxe_io_Eof
- };
- var haxe_io_Error = { __ename__ : true, __constructs__ : ["Blocked","Overflow","OutsideBounds","Custom"] };
- haxe_io_Error.Blocked = ["Blocked",0];
- haxe_io_Error.Blocked.toString = $estr;
- haxe_io_Error.Blocked.__enum__ = haxe_io_Error;
- haxe_io_Error.Overflow = ["Overflow",1];
- haxe_io_Error.Overflow.toString = $estr;
- haxe_io_Error.Overflow.__enum__ = haxe_io_Error;
- haxe_io_Error.OutsideBounds = ["OutsideBounds",2];
- haxe_io_Error.OutsideBounds.toString = $estr;
- haxe_io_Error.OutsideBounds.__enum__ = haxe_io_Error;
- haxe_io_Error.Custom = function(e) { var $x = ["Custom",3,e]; $x.__enum__ = haxe_io_Error; $x.toString = $estr; return $x; };
- var haxe_unit_TestCase = function() {
- };
- haxe_unit_TestCase.__name__ = ["haxe","unit","TestCase"];
- haxe_unit_TestCase.prototype = {
- currentTest: null
- ,setup: function() {
- }
- ,tearDown: function() {
- }
- ,print: function(v) {
- haxe_unit_TestRunner.print(v);
- }
- ,assertTrue: function(b,c) {
- this.currentTest.done = true;
- if(b != true) {
- this.currentTest.success = false;
- this.currentTest.error = "expected true but was false";
- this.currentTest.posInfos = c;
- throw new js__$Boot_HaxeError(this.currentTest);
- }
- }
- ,assertFalse: function(b,c) {
- this.currentTest.done = true;
- if(b == true) {
- this.currentTest.success = false;
- this.currentTest.error = "expected false but was true";
- this.currentTest.posInfos = c;
- throw new js__$Boot_HaxeError(this.currentTest);
- }
- }
- ,assertEquals: function(expected,actual,c) {
- this.currentTest.done = true;
- if(actual != expected) {
- this.currentTest.success = false;
- this.currentTest.error = "expected '" + Std.string(expected) + "' but was '" + Std.string(actual) + "'";
- this.currentTest.posInfos = c;
- throw new js__$Boot_HaxeError(this.currentTest);
- }
- }
- ,__class__: haxe_unit_TestCase
- };
- var haxe_unit_TestResult = function() {
- this.m_tests = new List();
- this.success = true;
- };
- haxe_unit_TestResult.__name__ = ["haxe","unit","TestResult"];
- haxe_unit_TestResult.prototype = {
- m_tests: null
- ,success: null
- ,add: function(t) {
- this.m_tests.add(t);
- if(!t.success) this.success = false;
- }
- ,toString: function() {
- var buf_b = "";
- var failures = 0;
- var _g_head = this.m_tests.h;
- var _g_val = null;
- while(_g_head != null) {
- var tmp;
- _g_val = _g_head[0];
- _g_head = _g_head[1];
- tmp = _g_val;
- var test = tmp;
- if(test.success == false) {
- buf_b += "* ";
- buf_b += test.classname == null?"null":"" + test.classname;
- buf_b += "::";
- buf_b += test.method == null?"null":"" + test.method;
- buf_b += "()";
- buf_b += "\n";
- buf_b += "ERR: ";
- if(test.posInfos != null) {
- buf_b += Std.string(test.posInfos.fileName);
- buf_b += ":";
- buf_b += Std.string(test.posInfos.lineNumber);
- buf_b += "(";
- buf_b += Std.string(test.posInfos.className);
- buf_b += ".";
- buf_b += Std.string(test.posInfos.methodName);
- buf_b += ") - ";
- }
- buf_b += test.error == null?"null":"" + test.error;
- buf_b += "\n";
- if(test.backtrace != null) {
- buf_b += test.backtrace == null?"null":"" + test.backtrace;
- buf_b += "\n";
- }
- buf_b += "\n";
- failures++;
- }
- }
- buf_b += "\n";
- if(failures == 0) buf_b += "OK "; else buf_b += "FAILED ";
- buf_b += Std.string(this.m_tests.length);
- buf_b += " tests, ";
- buf_b += failures == null?"null":"" + failures;
- buf_b += " failed, ";
- buf_b += Std.string(this.m_tests.length - failures);
- buf_b += " success";
- buf_b += "\n";
- return buf_b;
- }
- ,__class__: haxe_unit_TestResult
- };
- var haxe_unit_TestRunner = function() {
- this.result = new haxe_unit_TestResult();
- this.cases = new List();
- };
- haxe_unit_TestRunner.__name__ = ["haxe","unit","TestRunner"];
- haxe_unit_TestRunner.print = function(v) {
- var msg = js_Boot.__string_rec(v,"");
- var d;
- if(typeof(document) != "undefined" && (d = document.getElementById("haxe:trace")) != null) {
- msg = StringTools.htmlEscape(msg).split("\n").join("<br/>");
- d.innerHTML += msg + "<br/>";
- } else if(typeof process != "undefined" && process.stdout != null && process.stdout.write != null) process.stdout.write(msg); else if(typeof console != "undefined" && console.log != null) console.log(msg);
- };
- haxe_unit_TestRunner.customTrace = function(v,p) {
- haxe_unit_TestRunner.print(p.fileName + ":" + p.lineNumber + ": " + Std.string(v) + "\n");
- };
- haxe_unit_TestRunner.prototype = {
- result: null
- ,cases: null
- ,add: function(c) {
- this.cases.add(c);
- }
- ,run: function() {
- this.result = new haxe_unit_TestResult();
- var _g_head = this.cases.h;
- var _g_val = null;
- while(_g_head != null) {
- var tmp;
- _g_val = _g_head[0];
- _g_head = _g_head[1];
- tmp = _g_val;
- var c = tmp;
- this.runCase(c);
- }
- haxe_unit_TestRunner.print(this.result.toString());
- return this.result.success;
- }
- ,runCase: function(t) {
- var old = haxe_Log.trace;
- haxe_Log.trace = haxe_unit_TestRunner.customTrace;
- var cl = t == null?null:js_Boot.getClass(t);
- var fields = Type.getInstanceFields(cl);
- haxe_unit_TestRunner.print("Class: " + Type.getClassName(cl) + " ");
- var _g = 0;
- while(_g < fields.length) {
- var f = fields[_g];
- ++_g;
- var field = Reflect.field(t,f);
- if(StringTools.startsWith(f,"test") && Reflect.isFunction(field)) {
- t.currentTest = new haxe_unit_TestStatus();
- t.currentTest.classname = Type.getClassName(cl);
- t.currentTest.method = f;
- t.setup();
- try {
- var args = [];
- field.apply(t,args);
- if(t.currentTest.done) {
- t.currentTest.success = true;
- haxe_unit_TestRunner.print(".");
- } else {
- t.currentTest.success = false;
- t.currentTest.error = "(warning) no assert";
- haxe_unit_TestRunner.print("W");
- }
- } catch( $e0 ) {
- haxe_CallStack.lastException = $e0;
- if ($e0 instanceof js__$Boot_HaxeError) $e0 = $e0.val;
- if( js_Boot.__instanceof($e0,haxe_unit_TestStatus) ) {
- var e = $e0;
- haxe_unit_TestRunner.print("F");
- t.currentTest.backtrace = haxe_CallStack.toString(haxe_CallStack.exceptionStack());
- } else {
- var e1 = $e0;
- haxe_unit_TestRunner.print("E");
- if(e1.message != null) t.currentTest.error = "exception thrown : " + Std.string(e1) + " [" + Std.string(e1.message) + "]"; else t.currentTest.error = "exception thrown : " + Std.string(e1);
- t.currentTest.backtrace = haxe_CallStack.toString(haxe_CallStack.exceptionStack());
- }
- }
- this.result.add(t.currentTest);
- t.tearDown();
- }
- }
- haxe_unit_TestRunner.print("\n");
- haxe_Log.trace = old;
- }
- ,__class__: haxe_unit_TestRunner
- };
- var haxe_unit_TestStatus = function() {
- this.done = false;
- this.success = false;
- };
- haxe_unit_TestStatus.__name__ = ["haxe","unit","TestStatus"];
- haxe_unit_TestStatus.prototype = {
- done: null
- ,success: null
- ,error: null
- ,method: null
- ,classname: null
- ,posInfos: null
- ,backtrace: null
- ,__class__: haxe_unit_TestStatus
- };
- var js__$Boot_HaxeError = function(val) {
- Error.call(this);
- this.val = val;
- this.message = String(val);
- if(Error.captureStackTrace) Error.captureStackTrace(this,js__$Boot_HaxeError);
- };
- js__$Boot_HaxeError.__name__ = ["js","_Boot","HaxeError"];
- js__$Boot_HaxeError.__super__ = Error;
- js__$Boot_HaxeError.prototype = $extend(Error.prototype,{
- val: null
- ,__class__: js__$Boot_HaxeError
- });
- var js_Boot = function() { };
- js_Boot.__name__ = ["js","Boot"];
- js_Boot.__unhtml = function(s) {
- return s.split("&").join("&").split("<").join("<").split(">").join(">");
- };
- js_Boot.__trace = function(v,i) {
- var msg = i != null?i.fileName + ":" + i.lineNumber + ": ":"";
- msg += js_Boot.__string_rec(v,"");
- if(i != null && i.customParams != null) {
- var _g = 0;
- var _g1 = i.customParams;
- while(_g < _g1.length) {
- var v1 = _g1[_g];
- ++_g;
- msg += "," + js_Boot.__string_rec(v1,"");
- }
- }
- var d;
- if(typeof(document) != "undefined" && (d = document.getElementById("haxe:trace")) != null) d.innerHTML += js_Boot.__unhtml(msg) + "<br/>"; else if(typeof console != "undefined" && console.log != null) console.log(msg);
- };
- js_Boot.getClass = function(o) {
- if((o instanceof Array) && o.__enum__ == null) return Array; else {
- var cl = o.__class__;
- if(cl != null) return cl;
- var name = js_Boot.__nativeClassName(o);
- if(name != null) return js_Boot.__resolveNativeClass(name);
- return null;
- }
- };
- js_Boot.__string_rec = function(o,s) {
- if(o == null) return "null";
- if(s.length >= 5) return "<...>";
- var t = typeof(o);
- if(t == "function" && (o.__name__ || o.__ename__)) t = "object";
- switch(t) {
- case "object":
- if(o instanceof Array) {
- if(o.__enum__) {
- if(o.length == 2) return o[0];
- var str2 = o[0] + "(";
- s += "\t";
- var _g1 = 2;
- var _g = o.length;
- while(_g1 < _g) {
- var i1 = _g1++;
- if(i1 != 2) str2 += "," + js_Boot.__string_rec(o[i1],s); else str2 += js_Boot.__string_rec(o[i1],s);
- }
- return str2 + ")";
- }
- var l = o.length;
- var i;
- var str1 = "[";
- s += "\t";
- var _g2 = 0;
- while(_g2 < l) {
- var i2 = _g2++;
- str1 += (i2 > 0?",":"") + js_Boot.__string_rec(o[i2],s);
- }
- str1 += "]";
- return str1;
- }
- var tostr;
- try {
- tostr = o.toString;
- } catch( e ) {
- haxe_CallStack.lastException = e;
- if (e instanceof js__$Boot_HaxeError) e = e.val;
- return "???";
- }
- if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") {
- var s2 = o.toString();
- if(s2 != "[object Object]") return s2;
- }
- var k = null;
- var str = "{\n";
- s += "\t";
- var hasp = o.hasOwnProperty != null;
- for( var k in o ) {
- if(hasp && !o.hasOwnProperty(k)) {
- continue;
- }
- if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
- continue;
- }
- if(str.length != 2) str += ", \n";
- str += s + k + " : " + js_Boot.__string_rec(o[k],s);
- }
- s = s.substring(1);
- str += "\n" + s + "}";
- return str;
- case "function":
- return "<function>";
- case "string":
- return o;
- default:
- return String(o);
- }
- };
- js_Boot.__interfLoop = function(cc,cl) {
- if(cc == null) return false;
- if(cc == cl) return true;
- var intf = cc.__interfaces__;
- if(intf != null) {
- var _g1 = 0;
- var _g = intf.length;
- while(_g1 < _g) {
- var i = _g1++;
- var i1 = intf[i];
- if(i1 == cl || js_Boot.__interfLoop(i1,cl)) return true;
- }
- }
- return js_Boot.__interfLoop(cc.__super__,cl);
- };
- js_Boot.__instanceof = function(o,cl) {
- if(cl == null) return false;
- switch(cl) {
- case Int:
- return (o|0) === o;
- case Float:
- return typeof(o) == "number";
- case Bool:
- return typeof(o) == "boolean";
- case String:
- return typeof(o) == "string";
- case Array:
- return (o instanceof Array) && o.__enum__ == null;
- case Dynamic:
- return true;
- default:
- if(o != null) {
- if(typeof(cl) == "function") {
- if(o instanceof cl) return true;
- if(js_Boot.__interfLoop(js_Boot.getClass(o),cl)) return true;
- } else if(typeof(cl) == "object" && js_Boot.__isNativeObj(cl)) {
- if(o instanceof cl) return true;
- }
- } else return false;
- if(cl == Class && o.__name__ != null) return true;
- if(cl == Enum && o.__ename__ != null) return true;
- return o.__enum__ == cl;
- }
- };
- js_Boot.__nativeClassName = function(o) {
- var name = js_Boot.__toStr.call(o).slice(8,-1);
- if(name == "Object" || name == "Function" || name == "Math" || name == "JSON") return null;
- return name;
- };
- js_Boot.__isNativeObj = function(o) {
- return js_Boot.__nativeClassName(o) != null;
- };
- js_Boot.__resolveNativeClass = function(name) {
- return $global[name];
- };
- var js_Node = function() { };
- js_Node.__name__ = ["js","Node"];
- var pony_ILogable = function() { };
- pony_ILogable.__name__ = ["pony","ILogable"];
- pony_ILogable.prototype = {
- __class__: pony_ILogable
- };
- var pony_magic_HasSignal = function() { };
- pony_magic_HasSignal.__name__ = ["pony","magic","HasSignal"];
- var pony_Logable = function() {
- };
- pony_Logable.__name__ = ["pony","Logable"];
- pony_Logable.__interfaces__ = [pony_magic_HasSignal,pony_ILogable];
- pony_Logable.prototype = {
- error: function(s,p) {
- pony_events__$Event2_Event2_$Impl_$.dispatch(this.eError,s,p);
- }
- ,eLog: null
- ,eError: null
- ,__class__: pony_Logable
- };
- var pony_Priority = function(data,$double,addAfter) {
- if(addAfter == null) addAfter = false;
- if($double == null) $double = false;
- this.addAfter = addAfter;
- this.hash = new haxe_ds_IntMap();
- this.data = [];
- this.counters = [0];
- this["double"] = $double;
- if(data != null) {
- this.data = data;
- this.hash = new haxe_ds_IntMap();
- this.hash.h[0] = this.data.length;
- }
- };
- pony_Priority.__name__ = ["pony","Priority"];
- pony_Priority.__interfaces__ = [pony_magic_HasSignal];
- pony_Priority.prototype = {
- 'double': null
- ,data: null
- ,hash: null
- ,counters: null
- ,addAfter: null
- ,add: function(e,priority) {
- if(priority == null) priority = 0;
- var tmp;
- if(!this["double"]) {
- var tmp1;
- var f = $bind(this,this.compare);
- var a = e;
- tmp1 = function(b) {
- return f(a,b);
- };
- tmp = Lambda.exists(this.data,tmp1);
- } else tmp = false;
- if(tmp) return this;
- var needOnTake = this.data.length == 0;
- var s = this.hash.h.hasOwnProperty(priority)?this.hash.h[priority]:0;
- var c = 0;
- var $it0 = this.hash.keys();
- while( $it0.hasNext() ) {
- var k = $it0.next();
- if(k < priority) c += this.hash.h[k];
- }
- c += s;
- this.data.splice(c,0,e);
- var _g1 = 0;
- var _g = this.counters.length;
- while(_g1 < _g) {
- var k1 = _g1++;
- if(this.addAfter || c < this.counters[k1]) this.counters[k1]++;
- }
- this.hash.h[priority] = s + 1;
- if(needOnTake) pony_events__$Event0_Event0_$Impl_$.dispatch(this.eTake);
- return this;
- }
- ,iterator: function() {
- var _g = this;
- var n = this.counters.push(0) - 1;
- var i = 0;
- return { hasNext : function() {
- if(_g.counters == null) return false;
- if(_g.counters.length < n) _g.counters.push(i);
- if(_g.data.length > _g.counters[n]) return true; else {
- _g.counters.splice(n,1);
- return false;
- }
- }, next : function() {
- return _g.data[_g.counters[n]++];
- }};
- }
- ,compare: function(a,b) {
- return a == b;
- }
- ,asort: function(x,y) {
- return x - y;
- }
- ,remove: function(e) {
- var tmp;
- var f = $bind(this,this.compare);
- var a1 = e;
- tmp = function(b) {
- return f(a1,b);
- };
- var i = pony_ArrayTools.fIndexOf(this.data,tmp);
- if(i == -1) return false;
- var needOnLost = !(this.data.length == 0);
- var _g1 = 0;
- var _g = this.counters.length;
- while(_g1 < _g) {
- var k = _g1++;
- if(i < this.counters[k]) this.counters[k]--;
- }
- this.data.splice(i,1);
- var tmp1;
- var _g2 = [];
- var $it0 = this.hash.keys();
- while( $it0.hasNext() ) {
- var k1 = $it0.next();
- _g2.push(k1);
- }
- tmp1 = _g2;
- var a = tmp1;
- a.sort($bind(this,this.asort));
- var _g11 = 0;
- while(_g11 < a.length) {
- var k2 = a[_g11];
- ++_g11;
- var n = this.hash.h[k2];
- if(i > 0) i -= n; else {
- if(n > 1) this.hash.h[k2] = n - 1; else this.hash.remove(k2);
- break;
- }
- }
- if(needOnLost && this.data.length == 0) pony_events__$Event0_Event0_$Impl_$.dispatch(this.eLost);
- if(this["double"]) this.remove(e);
- return true;
- }
- ,eTake: null
- ,eLost: null
- ,__class__: pony_Priority
- };
- var pony_Queue = function(method) {
- this.busy = false;
- this.method = method;
- this.list = new List();
- this.call = Reflect.makeVarArgs($bind(this,this._call));
- };
- pony_Queue.__name__ = ["pony","Queue"];
- pony_Queue.prototype = {
- list: null
- ,busy: null
- ,call: null
- ,method: null
- ,_call: function(a) {
- if(!this.busy) {
- this.busy = true;
- this.method.apply(null,a);
- } else this.list.add(a);
- }
- ,next: function() {
- if(this.list.length > 0) {
- var args = this.list.pop();
- this.method.apply(null,args);
- } else this.busy = false;
- }
- ,__class__: pony_Queue
- };
- var pony_Tools = function() { };
- pony_Tools.__name__ = ["pony","Tools"];
- pony_Tools.readStr = function(b) {
- try {
- return b.readString(b.readInt32());
- } catch( _ ) {
- haxe_CallStack.lastException = _;
- if (_ instanceof js__$Boot_HaxeError) _ = _.val;
- return null;
- }
- };
- var pony_ArrayTools = function() { };
- pony_ArrayTools.__name__ = ["pony","ArrayTools"];
- pony_ArrayTools.fIndexOf = function(a,f) {
- var i = 0;
- var _g = 0;
- while(_g < a.length) {
- var e = a[_g];
- ++_g;
- if(f(e)) return i;
- i++;
- }
- return -1;
- };
- var pony_events__$Event0_Event0_$Impl_$ = {};
- pony_events__$Event0_Event0_$Impl_$.__name__ = ["pony","events","_Event0","Event0_Impl_"];
- pony_events__$Event0_Event0_$Impl_$.compare = function(a,b) {
- var tmp;
- var _g = a.listener;
- var _g1 = b.listener;
- switch(_g[1]) {
- case 0:
- switch(_g1[1]) {
- case 0:
- tmp = _g[2] == _g1[2];
- break;
- default:
- tmp = false;
- }
- break;
- case 1:
- switch(_g1[1]) {
- case 1:
- tmp = _g[2] == _g1[2];
- break;
- default:
- tmp = false;
- }
- break;
- }
- return tmp;
- };
- pony_events__$Event0_Event0_$Impl_$.dispatch = function(this1,safe) {
- if(safe == null) safe = false;
- if(this1 == null || this1.data == null || safe && this1.counters.length > 1) return false;
- var $it0 = this1.iterator();
- while( $it0.hasNext() ) {
- var e = $it0.next();
- var tmp;
- var _g = e.listener;
- switch(_g[1]) {
- case 0:
- tmp = _g[2]();
- break;
- case 1:
- tmp = pony_events__$Event0_Event0_$Impl_$.dispatch(_g[2],_g[3] || safe);
- break;
- }
- if(tmp) {
- if(this1.counters != null) this1.counters.splice(1,this1.counters.length);
- return true;
- }
- if(!(this1.data == null) && e.once) this1.remove(e);
- }
- return false;
- };
- var pony_events__$Event1_Event1_$Impl_$ = {};
- pony_events__$Event1_Event1_$Impl_$.__name__ = ["pony","events","_Event1","Event1_Impl_"];
- pony_events__$Event1_Event1_$Impl_$.compare = function(a,b) {
- var tmp;
- var _g = a.listener;
- var _g1 = b.listener;
- switch(_g[1]) {
- case 0:
- switch(_g1[1]) {
- case 0:
- tmp = _g[2] == _g1[2];
- break;
- default:
- tmp = false;
- }
- break;
- case 1:
- switch(_g1[1]) {
- case 1:
- tmp = _g[2] == _g1[2];
- break;
- default:
- tmp = false;
- }
- break;
- case 2:
- switch(_g1[1]) {
- case 2:
- tmp = _g[2] == _g1[2];
- break;
- default:
- tmp = false;
- }
- break;
- case 3:
- switch(_g1[1]) {
- case 3:
- tmp = _g[2] == _g1[2];
- break;
- default:
- tmp = false;
- }
- break;
- case 4:
- switch(_g1[1]) {
- case 4:
- tmp = _g[3] == _g1[3];
- break;
- default:
- tmp = false;
- }
- break;
- case 5:
- switch(_g1[1]) {
- case 5:
- tmp = _g[3] == _g1[3];
- break;
- default:
- tmp = false;
- }
- break;
- }
- return tmp;
- };
- pony_events__$Event1_Event1_$Impl_$.dispatch = function(this1,a1,safe) {
- if(safe == null) safe = false;
- if(this1 == null || this1.data == null || safe && this1.counters.length > 1) return false;
- var $it0 = this1.iterator();
- while( $it0.hasNext() ) {
- var e = $it0.next();
- var tmp;
- var _g = e.listener;
- switch(_g[1]) {
- case 0:
- tmp = _g[2]();
- break;
- case 1:
- tmp = _g[2](a1);
- break;
- case 2:
- tmp = pony_events__$Event0_Event0_$Impl_$.dispatch(_g[2],_g[3] || safe);
- break;
- case 3:
- tmp = pony_events__$Event1_Event1_$Impl_$.dispatch(_g[2],a1,_g[3] || safe);
- break;
- case 4:
- if(_g[3] == a1) tmp = pony_events__$Event0_Event0_$Impl_$.dispatch(_g[2],safe); else tmp = false;
- break;
- case 5:
- if(_g[3] != a1) tmp = pony_events__$Event1_Event1_$Impl_$.dispatch(_g[2],a1,safe); else tmp = false;
- break;
- default:
- tmp = false;
- }
- if(tmp) {
- if(this1.counters != null) this1.counters.splice(1,this1.counters.length);
- return true;
- }
- if(!(this1.data == null) && e.once) this1.remove(e);
- }
- return false;
- };
- var pony_events__$Event2_Event2_$Impl_$ = {};
- pony_events__$Event2_Event2_$Impl_$.__name__ = ["pony","events","_Event2","Event2_Impl_"];
- pony_events__$Event2_Event2_$Impl_$.compare = function(a,b) {
- var tmp;
- var _g = a.listener;
- var _g1 = b.listener;
- switch(_g[1]) {
- case 0:
- switch(_g1[1]) {
- case 0:
- tmp = _g[2] == _g1[2];
- break;
- default:
- tmp = false;
- }
- break;
- case 1:
- switch(_g1[1]) {
- case 1:
- tmp = _g[2] == _g1[2];
- break;
- default:
- tmp = false;
- }
- break;
- case 2:
- switch(_g1[1]) {
- case 2:
- tmp = _g[2] == _g1[2];
- break;
- default:
- tmp = false;
- }
- break;
- case 3:
- switch(_g1[1]) {
- case 3:
- tmp = _g[2] == _g1[2];
- break;
- default:
- tmp = false;
- }
- break;
- case 4:
- switch(_g1[1]) {
- case 4:
- tmp = _g[2] == _g1[2];
- break;
- default:
- tmp = false;
- }
- break;
- case 5:
- switch(_g1[1]) {
- case 5:
- tmp = _g[2] == _g1[2];
- break;
- default:
- tmp = false;
- }
- break;
- case 6:
- switch(_g1[1]) {
- case 6:
- if(_g[3] == _g1[3]) tmp = _g[4] == _g1[4]; else tmp = false;
- break;
- default:
- tmp = false;
- }
- break;
- case 7:
- switch(_g1[1]) {
- case 7:
- tmp = _g[3] == _g1[3];
- break;
- default:
- tmp = false;
- }
- break;
- case 8:
- switch(_g1[1]) {
- case 8:
- tmp = _g[3] == _g1[3];
- break;
- default:
- tmp = false;
- }
- break;
- case 9:
- switch(_g1[1]) {
- case 9:
- if(_g[3] == _g1[3]) tmp = _g[4] == _g1[4]; else tmp = false;
- break;
- default:
- tmp = false;
- }
- break;
- case 10:
- switch(_g1[1]) {
- case 10:
- tmp = _g[3] == _g1[3];
- break;
- default:
- tmp = false;
- }
- break;
- case 11:
- switch(_g1[1]) {
- case 11:
- tmp = _g[3] == _g1[3];
- break;
- default:
- tmp = false;
- }
- break;
- }
- return tmp;
- };
- pony_events__$Event2_Event2_$Impl_$.dispatch = function(this1,a1,a2,safe) {
- if(safe == null) safe = false;
- if(this1 == null || this1.data == null || safe && this1.counters.length > 1) return false;
- var $it0 = this1.iterator();
- while( $it0.hasNext() ) {
- var e = $it0.next();
- var tmp;
- var _g = e.listener;
- switch(_g[1]) {
- case 0:
- tmp = _g[2]();
- break;
- case 1:
- tmp = _g[2](a1);
- break;
- case 2:
- tmp = _g[2](a1,a2);
- break;
- case 3:
- tmp = pony_events__$Event0_Event0_$Impl_$.dispatch(_g[2],_g[3] || safe);
- break;
- case 4:
- tmp = pony_events__$Event1_Event1_$Impl_$.dispatch(_g[2],a1,_g[3] || safe);
- break;
- case 5:
- tmp = pony_events__$Event2_Event2_$Impl_$.dispatch(_g[2],a1,a2,_g[3] || safe);
- break;
- case 6:
- if(_g[3] == a1 && _g[4] == a2) tmp = pony_events__$Event0_Event0_$Impl_$.dispatch(_g[2],safe); else tmp = false;
- break;
- case 7:
- if(_g[3] == a1) tmp = pony_events__$Event1_Event1_$Impl_$.dispatch(_g[2],a2,safe); else tmp = false;
- break;
- case 8:
- if(_g[3] == a2) tmp = pony_events__$Event1_Event1_$Impl_$.dispatch(_g[2],a1,safe); else tmp = false;
- break;
- case 9:
- if(_g[3] != a1 && _g[4] != a2) tmp = pony_events__$Event2_Event2_$Impl_$.dispatch(_g[2],a1,a2,safe); else tmp = false;
- break;
- case 10:
- if(_g[3] != a1) tmp = pony_events__$Event2_Event2_$Impl_$.dispatch(_g[2],a1,a2,safe); else tmp = false;
- break;
- case 11:
- if(_g[3] != a2) tmp = pony_events__$Event2_Event2_$Impl_$.dispatch(_g[2],a1,a2,safe); else tmp = false;
- break;
- default:
- tmp = false;
- }
- if(tmp) {
- if(this1.counters != null) this1.counters.splice(1,this1.counters.length);
- return true;
- }
- if(!(this1.data == null) && e.once) this1.remove(e);
- }
- return false;
- };
- var pony_events_Listener0Type = { __ename__ : true, __constructs__ : ["LFunction0","LEvent0"] };
- pony_events_Listener0Type.LFunction0 = function(f) { var $x = ["LFunction0",0,f]; $x.__enum__ = pony_events_Listener0Type; $x.toString = $estr; return $x; };
- pony_events_Listener0Type.LEvent0 = function(s,safe) { var $x = ["LEvent0",1,s,safe]; $x.__enum__ = pony_events_Listener0Type; $x.toString = $estr; return $x; };
- var pony_events_Listener1Type = { __ename__ : true, __constructs__ : ["LFunction0","LFunction1","LEvent0","LEvent1","LSub","LNot"] };
- pony_events_Listener1Type.LFunction0 = function(f) { var $x = ["LFunction0",0,f]; $x.__enum__ = pony_events_Listener1Type; $x.toString = $estr; return $x; };
- pony_events_Listener1Type.LFunction1 = function(f) { var $x = ["LFunction1",1,f]; $x.__enum__ = pony_events_Listener1Type; $x.toString = $estr; return $x; };
- pony_events_Listener1Type.LEvent0 = function(s,safe) { var $x = ["LEvent0",2,s,safe]; $x.__enum__ = pony_events_Listener1Type; $x.toString = $estr; return $x; };
- pony_events_Listener1Type.LEvent1 = function(s,safe) { var $x = ["LEvent1",3,s,safe]; $x.__enum__ = pony_events_Listener1Type; $x.toString = $estr; return $x; };
- pony_events_Listener1Type.LSub = function(s,v) { var $x = ["LSub",4,s,v]; $x.__enum__ = pony_events_Listener1Type; $x.toString = $estr; return $x; };
- pony_events_Listener1Type.LNot = function(s,v) { var $x = ["LNot",5,s,v]; $x.__enum__ = pony_events_Listener1Type; $x.toString = $estr; return $x; };
- var pony_events_Listener2Type = { __ename__ : true, __constructs__ : ["LFunction0","LFunction1","LFunction2","LEvent0","LEvent1","LEvent2","LSub","LSub1","LSub2","LNot","LNot1","LNot2"] };
- pony_events_Listener2Type.LFunction0 = function(f) { var $x = ["LFunction0",0,f]; $x.__enum__ = pony_events_Listener2Type; $x.toString = $estr; return $x; };
- pony_events_Listener2Type.LFunction1 = function(f) { var $x = ["LFunction1",1,f]; $x.__enum__ = pony_events_Listener2Type; $x.toString = $estr; return $x; };
- pony_events_Listener2Type.LFunction2 = function(f) { var $x = ["LFunction2",2,f]; $x.__enum__ = pony_events_Listener2Type; $x.toString = $estr; return $x; };
- pony_events_Listener2Type.LEvent0 = function(s,safe) { var $x = ["LEvent0",3,s,safe]; $x.__enum__ = pony_events_Listener2Type; $x.toString = $estr; return $x; };
- pony_events_Listener2Type.LEvent1 = function(s,safe) { var $x = ["LEvent1",4,s,safe]; $x.__enum__ = pony_events_Listener2Type; $x.toString = $estr; return $x; };
- pony_events_Listener2Type.LEvent2 = function(s,safe) { var $x = ["LEvent2",5,s,safe]; $x.__enum__ = pony_events_Listener2Type; $x.toString = $estr; return $x; };
- pony_events_Listener2Type.LSub = function(s,v1,v2) { var $x = ["LSub",6,s,v1,v2]; $x.__enum__ = pony_events_Listener2Type; $x.toString = $estr; return $x; };
- pony_events_Listener2Type.LSub1 = function(s,v) { var $x = ["LSub1",7,s,v]; $x.__enum__ = pony_events_Listener2Type; $x.toString = $estr; return $x; };
- pony_events_Listener2Type.LSub2 = function(s,v) { var $x = ["LSub2",8,s,v]; $x.__enum__ = pony_events_Listener2Type; $x.toString = $estr; return $x; };
- pony_events_Listener2Type.LNot = function(s,v1,v2) { var $x = ["LNot",9,s,v1,v2]; $x.__enum__ = pony_events_Listener2Type; $x.toString = $estr; return $x; };
- pony_events_Listener2Type.LNot1 = function(s,v) { var $x = ["LNot1",10,s,v]; $x.__enum__ = pony_events_Listener2Type; $x.toString = $estr; return $x; };
- pony_events_Listener2Type.LNot2 = function(s,v) { var $x = ["LNot2",11,s,v]; $x.__enum__ = pony_events_Listener2Type; $x.toString = $estr; return $x; };
- var pony_net_INet = function() { };
- pony_net_INet.__name__ = ["pony","net","INet"];
- var pony_net_ISocketClient = function() { };
- pony_net_ISocketClient.__name__ = ["pony","net","ISocketClient"];
- pony_net_ISocketClient.__interfaces__ = [pony_net_INet];
- var pony_net_ISocketServer = function() { };
- pony_net_ISocketServer.__name__ = ["pony","net","ISocketServer"];
- pony_net_ISocketServer.__interfaces__ = [pony_net_INet];
- var pony_net_SocketClientBase = function(host,port,reconnect,tryCount,aIsWithLength,maxSize) {
- if(maxSize == null) maxSize = 1024;
- if(aIsWithLength == null) aIsWithLength = true;
- if(tryCount == null) tryCount = 0;
- if(reconnect == null) reconnect = -1;
- this.eDisconnect = (function($this) {
- var $r;
- var this1;
- this1 = new pony_Priority(null,false,true);
- this1.compare = pony_events__$Event1_Event1_$Impl_$.compare;
- $r = this1;
- return $r;
- }(this));
- this.eClose = (function($this) {
- var $r;
- var this1;
- this1 = new pony_Priority(null,false,true);
- this1.compare = pony_events__$Event0_Event0_$Impl_$.compare;
- $r = this1;
- return $r;
- }(this));
- this.eString = (function($this) {
- var $r;
- var this1;
- this1 = new pony_Priority(null,false,true);
- this1.compare = pony_events__$Event2_Event2_$Impl_$.compare;
- $r = this1;
- return $r;
- }(this));
- this.eData = (function($this) {
- var $r;
- var this1;
- this1 = new pony_Priority(null,false,true);
- this1.compare = pony_events__$Event2_Event2_$Impl_$.compare;
- $r = this1;
- return $r;
- }(this));
- this.tryCou…
Large files files are truncated, but you can click here to view the full file