Skip to content

Commit

Permalink
Remove an error use of relpath to fix #13
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty472123 committed Mar 26, 2018
1 parent 88abf3f commit 3504cd8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions wuWxml.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ function analyze(core,z,namePool,xPool,fakePool={}){
}
break;
case "_ic":
pushSon(f.arguments[5].name,{tag:"include",son:[],v:{src:wu.toDir(xPool[f.arguments[0].property.value],xPool[f.arguments[2].property.value])}});
pushSon(f.arguments[5].name,{tag:"include",son:[],v:{src:xPool[f.arguments[0].property.value]}});
break;
case "_ai":
{//template import
let to=Object.keys(fakePool)[0];
if(to)pushSon(to,{tag:"import",son:[],v:{src:wu.toDir(xPool[f.arguments[1].property.value],xPool[f.arguments[3].property.value])}});
if(to)pushSon(to,{tag:"import",son:[],v:{src:xPool[f.arguments[1].property.value]}});
else throw Error("Unexpected fake pool");
}
break;
Expand Down Expand Up @@ -255,10 +255,10 @@ function doWxml(dir,name,code,z,xPool,rDs,wxsList){
if(wxsList[name])result.push(wxsList[name]);
wu.save(name,result.join(""));
}
function tryWxml(dir,name,code,z,xPool,rDs,wxsList){
function tryWxml(dir,name,code,...args){
console.log("Decompile "+name+"...");
try{
doWxml(dir,name,code,z,xPool,rDs,wxsList);
doWxml(dir,name,code,...args);
console.log("Decompile success!");
}catch(e){
console.log("error on "+name+"\nerr: ",e);
Expand All @@ -285,6 +285,7 @@ function doFrame(name,cb){
return ()=>path;
}}});
vm.run(code+"\n_vmRev_([x,"+json+"])");
console.log(x);
let dir=path.dirname(name),pF=[];
for(let info in rF)if(typeof rF[info]=="function"){
let name=path.resolve(dir,(info[0]=='/'?'.':'')+info),ref=rF[info]();
Expand Down

0 comments on commit 3504cd8

Please # to comment.