max-mapper / node-repl

run a node program but also attach a repl to the same context that your code runs in so you can inspect + mess with stuff as your program is running. node 0.12/iojs and above only
http://maxogden.com/node-repl
129 stars 12 forks source link

Error when no trailing newline last line in file is a comment #11

Open esromneb opened 5 years ago

esromneb commented 5 years ago

If the last line in the file that is passed to node-repl is a // comment , AND there is no newline at the end of the file the code breaks with:

SyntaxError: Unexpected token }
crobinson42 commented 5 years ago

@esromneb this doesn't appear to be an issue for me? I'm using node-repl@2.0.2 and Node.js version 10.15.3

Screenshot 2019-06-30 20 28 29

dccarmo commented 4 years ago

I was having the same issue, adding a new line at the end of the file fixed it for me as well.