Skip to content

Commit a5547bf

Browse files
committed
Fix a bug in the sandbox breakout fix
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.
1 parent 42f6914 commit a5547bf

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,13 @@ module.exports = function (ast, vars) {
131131
oldVars[element] = vars[element];
132132
})
133133

134-
node.params.forEach(function(key) {
134+
for(var i=0; i<node.params.length; i++){
135+
var key = node.params[i];
135136
if(key.type == 'Identifier'){
136137
vars[key.name] = null;
137138
}
138139
else return FAIL;
139-
});
140+
}
140141
for(var i in bodies){
141142
if(walk(bodies[i]) === FAIL){
142143
return FAIL;

0 commit comments

Comments
 (0)