domenic / count-to-6

An intro to some ES6 features via a set of self-guided workshops.
Other
326 stars 76 forks source link

... is an unexpected token (rest challenge) #35

Closed philj0st closed 7 years ago

philj0st commented 8 years ago
phil@HAL:~/Development/js-node$ node program.js 
/home/phil/Development/js-node/program.js:1
(function (exports, require, module, __filename, __dirname) { function sum(...args) {
                                                                           ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:142:18)

running node with the --es_staging flag would solve the problem for me. But i can't tell count-to-6 verify to use this flag. im on node v5.9.1

Rrrapture commented 7 years ago

Hey @philj0st, want to post your code? I just completed this assignment; I don't get any errors when I run count-to-6 verify or count-to-6 run. I'm on node v5.8.0.

philj0st commented 7 years ago

@Rrrapture I don't have the code anymore but .. essentially i was just using the es6 spread operator which was not supported by node by default at the time and my problem was that i can't invoke count-to-6 verify with the es_staging flag (which would lead to spread operator support) because its a nodeschool internal node invocation. I guess the problem is automatically solved with newer versions of node. node .green spread operator support.

but i think "supported" still means you have to use the --es_staging flag

Rrrapture commented 7 years ago

@philj0st gotcha. Yes, when I'm testing I execute node --harmony program.js. So, did you end up passing the exercise? Since the workshop uses Traceur, when you execute count-to-6 run program.js or count-to-6 verify program.js, the compiler solves the support problem.

philj0st commented 7 years ago

I think i ended up skipping it .. can't remember for sure though.

Rrrapture commented 7 years ago

@domenic, I'm suggesting this gets closed since it's a non-issue.