sporto / planetproto

Understanding JavaScript Prototypes - Workshop
221 stars 58 forks source link

planetproto run program.js isn't working #14

Open naz opened 10 years ago

naz commented 10 years ago

When the planetproto run program.js is run undefined error appears: ReferenceError: claim is not defined

sporto commented 10 years ago

@Gargol thanks for reporting this. I thought I got rid of the instructions saying to run program.js as they are not relevant. Is that from the readme?

naz commented 10 years ago

this command is referenced after each challenge. it also looks a bit odd.. on my machine i get somethings like this:

## Challenge

Follow the instructions in the boilerplate file created. 
A file 050.js with the necessary boilerplate has been created for you.

footerFile /home/gargol/.nvm/v0.10.26/lib/node_modules/planetproto/node_modules/workshopper/footer.md
 » To print these instructions again, run: planetproto print
 » To execute your program in a test environment, run: planetproto run program.js
 » To verify your program, run: planetproto verify program.js
 » For help run: planetproto help program.js 

don't think this footerFile line should be shown.

gorhgorh commented 9 years ago

hi there, coming to this issue after encountered the same problem in a nodeschool event, I just wanted to add that ppl use run a lot, and I use it as well as a mentor, run allow to pass the workshopper context to your current script without all the output of the test making it a useful tool while trying.

// jshint proto:true
if (!claim){
  var claim = function(a,b){
    if (a === b){
      console.log("matched", a, "===",b);
    }
  };
}

fist line prevent jshint to stop complaining about using proto and may be relevant for the boilerplates.

I would be glad to submit a pr if you are interested.

thanks for this workshopper, lots of ppl are have been playing with it yesterday !

sporto commented 9 years ago

This is annoying, sorry, cannot really get rid of those instructions as they are baked into workshopper.js Also haven't figure out yet how to inject globals when doing run. I will most likely wait until Workshopper hits 1.0 to fix this issue