You have an invisible character before the last semicolon.
You can spot this character if you copy/paste your code, for example, in vim or if you tell your editor to show hidden characters.
If you remove this character your code should run fine.
I found it out because pasting your code in Chrome javascript console I got the same error as in PhantomJS, rewriting your code by hand I didn't get any error.