timoxley / functional-javascript-workshop

A functional javascript workshop. No libraries required (i.e. no underscore), just ES5.
2.06k stars 441 forks source link

async_loops solution accepts any solution that runs #197

Open preira opened 5 years ago

preira commented 5 years ago

The async_loops solution is not being validated.

NookaPavan commented 4 years ago

@preira is right, even leaving the for loop empty does passes the test . At first my solution passed then it got me into thinking just only making the function async how does it is acceptable... @timoxley indeed there is something wrong with the validation of the program.

holson1 commented 4 years ago

Seeing the same thing. Using a debugger, I can see it doesn't even enter my function, it just runs the solution.

1259642433 commented 3 years ago

After finding the async_loops folder in the functional-javascript-workshop directory of the npm global installation and trying to run it, I found that runner.custom ran twice, the first time the f assigned to fx was a function we wrote, and the second time it was a function in solution.js, so I Made a monitor and only assigned the value the first time. Edit exercise.js in this directory: var fx=>var fxWrap = new Proxy({ fx:'' },{ set:function(obj,props,val){ if(props=='fx'){ if(obj[props]==''){ obj[props] = val return true } } return true } }) And add the call object in front of the corresponding fx below. fx = f=>fxWrap.fx = f fx.call(fx, ids, load, done)=>fxWrap.fx.call(fxWrap.fx, ids, load, done) run command function-javascript verify ./file.js.It worked for me. My English isn't very good, so I used translation software and hope I spoke clearly enough