Skip to content

Commit

Permalink
fix bug with lambda functions
Browse files Browse the repository at this point in the history
  • Loading branch information
drylib committed Apr 4, 2017
1 parent 02394e9 commit 24a472a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/dbg.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ dbg.assert = (fn, ...args)=>{
}
let msg = '';
if (typeof fn == 'function')
msg = fn.toString().match(/function.*\{\s*return(.*)\s*\}/i)[1].slice(0,-1);
{
let removefn = fn.toString().match(/function.*\{\s*return(.*)\s*\}/i);
if(removefn)
msg = removefn[1].slice(0,-1);
else
msg = fn.toString();
}
let res_args_log = res_args.filter(arg=>!msg.includes(arg));
if (!success)
{
Expand Down

0 comments on commit 24a472a

Please sign in to comment.