Browse Source

js for debug

221V 3 years ago
parent
commit
238a87d211
2 changed files with 8 additions and 3 deletions
  1. 4 2
      priv/n2o.js
  2. 4 1
      priv/protocols/bert.js

+ 4 - 2
priv/n2o.js

@@ -25,8 +25,10 @@ function co(name) { match=document.cookie.match(new RegExp(name+'=([^;]+)')); re
 /// N2O Protocols
 
 var $io = {}; $io.on = function onio(r, cb) { if (is(r,3,'io')) {
-    try { eval(utf8_dec(r.v[1].v)); if (typeof cb == 'function') cb(r); return { status: "ok" }; }
-    catch (e) { console.log(e); return { status: '' }; } } else return { status: '' }; }
+  try {
+    if(window.debug){ console.log("from n2o.js:29\n", utf8_dec(r.v[1].v)); }
+    eval(utf8_dec(r.v[1].v)); if (typeof cb == 'function') cb(r); return { status: "ok" };
+  } catch (e) { console.log(e); return { status: '' }; } } else return { status: '' }; }
 
 var $file = {}; $file.on = function onfile(r, cb) { if (is(r,10,'ftp')) {
     if (typeof cb == 'function') cb(r); return { status: "ok" }; } else return { status: ''}; }

+ 4 - 1
priv/protocols/bert.js

@@ -16,7 +16,10 @@ function list()    { return {t:108,v:Array.apply(null,arguments)}; }
 function number(o) { return {t:98,v:o}; }
 function enc(o)    { return fl([131,ein(o)]); }
 function ein(o)    { return Array.isArray(o)?en_108({t:108,v:o}):eval('en_'+o.t)(o); }
-function en_undefined(o) { return [106]; }
+function en_undefined(o) {
+  if(window.debug){ console.log("from bert.js:20\n", o); }
+  return [106];
+}
 function en_98(o)  { return [98,o.v>>>24,(o.v>>>16)&255,(o.v>>>8)&255,o.v&255]; }
 function en_97(o)  { return [97,o.v];}
 function en_106(o) { return [106];}