Skip to content

Commit

Permalink
Fix a bug in the sandbox breakout fix
Browse files Browse the repository at this point in the history
The `return FAIL` was making the anonymous function of the forEach call
to return, that wasn't what I was expecting, so the last fix didn't have
any effects. I changed the code so now the `return FAIL` makes the main
function return.
  • Loading branch information
cript0nauta committed Feb 18, 2019
1 parent 42f6914 commit a5547bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,13 @@ module.exports = function (ast, vars) {
oldVars[element] = vars[element];
})

node.params.forEach(function(key) {
for(var i=0; i<node.params.length; i++){
var key = node.params[i];
if(key.type == 'Identifier'){
vars[key.name] = null;
}
else return FAIL;
});
}
for(var i in bodies){
if(walk(bodies[i]) === FAIL){
return FAIL;
Expand Down

0 comments on commit a5547bf

Please sign in to comment.