Tests for ES6 arrow function syntax errors On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS =>{} threw exception SyntaxError: Unexpected keyword '=>'. PASS x=> threw exception SyntaxError: Unexpected end of script. PASS x=>* threw exception SyntaxError: Unexpected token '*'. PASS x=>/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression.. PASS x=>% threw exception SyntaxError: Unexpected token '%'. PASS x=>+ threw exception SyntaxError: Unexpected end of script. PASS x=>- threw exception SyntaxError: Unexpected end of script. PASS x=><< threw exception SyntaxError: Unexpected token '<<'. PASS x=>>> threw exception SyntaxError: Unexpected token '>>'. PASS x=>>>> threw exception SyntaxError: Unexpected token '>>>'. PASS x=>< threw exception SyntaxError: Unexpected token '<'. PASS x=>> threw exception SyntaxError: Unexpected token '>'. PASS x=><= threw exception SyntaxError: Unexpected token '<='. PASS x=>>= threw exception SyntaxError: Unexpected token '>='. PASS x=>instanceof threw exception SyntaxError: Unexpected keyword 'instanceof'. PASS x=>in threw exception SyntaxError: Unexpected keyword 'in'. PASS x=>== threw exception SyntaxError: Unexpected token '=='. PASS x=>!= threw exception SyntaxError: Unexpected token '!='. PASS x=>=== threw exception SyntaxError: Unexpected token '==='. PASS x=>!== threw exception SyntaxError: Unexpected token '!=='. PASS x=>& threw exception SyntaxError: Unexpected token '&'. PASS x=>^ threw exception SyntaxError: Unexpected token '^'. PASS x=>| threw exception SyntaxError: Unexpected token '|'. PASS x=>&& threw exception SyntaxError: Unexpected token '&&'. PASS x=>|| threw exception SyntaxError: Unexpected token '||'. PASS x=>; threw exception SyntaxError: Unexpected token ';'. PASS x=>, threw exception SyntaxError: Unexpected token ','. PASS x=>{ threw exception SyntaxError: Unexpected end of script. PASS x=>{* threw exception SyntaxError: Unexpected token '*'. PASS x=>{/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression.. PASS x=>{% threw exception SyntaxError: Unexpected token '%'. PASS x=>{+ threw exception SyntaxError: Unexpected end of script. PASS x=>{- threw exception SyntaxError: Unexpected end of script. PASS x=>{<< threw exception SyntaxError: Unexpected token '<<'. PASS x=>{>> threw exception SyntaxError: Unexpected token '>>'. PASS x=>{>>> threw exception SyntaxError: Unexpected token '>>>'. PASS x=>{< threw exception SyntaxError: Unexpected token '<'. PASS x=>{> threw exception SyntaxError: Unexpected token '>'. PASS x=>{<= threw exception SyntaxError: Unexpected token '<='. PASS x=>{>= threw exception SyntaxError: Unexpected token '>='. PASS x=>{instanceof threw exception SyntaxError: Unexpected keyword 'instanceof'. PASS x=>{in threw exception SyntaxError: Unexpected keyword 'in'. PASS x=>{== threw exception SyntaxError: Unexpected token '=='. PASS x=>{!= threw exception SyntaxError: Unexpected token '!='. PASS x=>{=== threw exception SyntaxError: Unexpected token '==='. PASS x=>{!== threw exception SyntaxError: Unexpected token '!=='. PASS x=>{& threw exception SyntaxError: Unexpected token '&'. PASS x=>{^ threw exception SyntaxError: Unexpected token '^'. PASS x=>{| threw exception SyntaxError: Unexpected token '|'. PASS x=>{&& threw exception SyntaxError: Unexpected token '&&'. PASS x=>{|| threw exception SyntaxError: Unexpected token '||'. PASS x=>{; threw exception SyntaxError: Unexpected end of script. PASS x=>{, threw exception SyntaxError: Unexpected token ','. PASS x=>} threw exception SyntaxError: Unexpected token '}'. PASS var y = x=> threw exception SyntaxError: Unexpected end of script. PASS var y = x=>* threw exception SyntaxError: Unexpected token '*'. PASS var y = x=>/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression.. PASS var y = x=>% threw exception SyntaxError: Unexpected token '%'. PASS var y = x=>+ threw exception SyntaxError: Unexpected end of script. PASS var y = x=>- threw exception SyntaxError: Unexpected end of script. PASS var y = x=><< threw exception SyntaxError: Unexpected token '<<'. PASS var y = x=>>> threw exception SyntaxError: Unexpected token '>>'. PASS var y = x=>>>> threw exception SyntaxError: Unexpected token '>>>'. PASS var y = x=>< threw exception SyntaxError: Unexpected token '<'. PASS var y = x=>> threw exception SyntaxError: Unexpected token '>'. PASS var y = x=><= threw exception SyntaxError: Unexpected token '<='. PASS var y = x=>>= threw exception SyntaxError: Unexpected token '>='. PASS var y = x=>instanceof threw exception SyntaxError: Unexpected keyword 'instanceof'. PASS var y = x=>in threw exception SyntaxError: Unexpected keyword 'in'. PASS var y = x=>== threw exception SyntaxError: Unexpected token '=='. PASS var y = x=>!= threw exception SyntaxError: Unexpected token '!='. PASS var y = x=>=== threw exception SyntaxError: Unexpected token '==='. PASS var y = x=>!== threw exception SyntaxError: Unexpected token '!=='. PASS var y = x=>& threw exception SyntaxError: Unexpected token '&'. PASS var y = x=>^ threw exception SyntaxError: Unexpected token '^'. PASS var y = x=>| threw exception SyntaxError: Unexpected token '|'. PASS var y = x=>&& threw exception SyntaxError: Unexpected token '&&'. PASS var y = x=>|| threw exception SyntaxError: Unexpected token '||'. PASS var y = x=>; threw exception SyntaxError: Unexpected token ';'. PASS var y = x=>, threw exception SyntaxError: Unexpected token ','. PASS var y = x=>{ threw exception SyntaxError: Unexpected end of script. PASS var y = x=>{* threw exception SyntaxError: Unexpected token '*'. PASS var y = x=>{/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression.. PASS var y = x=>{% threw exception SyntaxError: Unexpected token '%'. PASS var y = x=>{+ threw exception SyntaxError: Unexpected end of script. PASS var y = x=>{- threw exception SyntaxError: Unexpected end of script. PASS var y = x=>{<< threw exception SyntaxError: Unexpected token '<<'. PASS var y = x=>{>> threw exception SyntaxError: Unexpected token '>>'. PASS var y = x=>{>>> threw exception SyntaxError: Unexpected token '>>>'. PASS var y = x=>{< threw exception SyntaxError: Unexpected token '<'. PASS var y = x=>{> threw exception SyntaxError: Unexpected token '>'. PASS var y = x=>{<= threw exception SyntaxError: Unexpected token '<='. PASS var y = x=>{>= threw exception SyntaxError: Unexpected token '>='. PASS var y = x=>{instanceof threw exception SyntaxError: Unexpected keyword 'instanceof'. PASS var y = x=>{in threw exception SyntaxError: Unexpected keyword 'in'. PASS var y = x=>{== threw exception SyntaxError: Unexpected token '=='. PASS var y = x=>{!= threw exception SyntaxError: Unexpected token '!='. PASS var y = x=>{=== threw exception SyntaxError: Unexpected token '==='. PASS var y = x=>{!== threw exception SyntaxError: Unexpected token '!=='. PASS var y = x=>{& threw exception SyntaxError: Unexpected token '&'. PASS var y = x=>{^ threw exception SyntaxError: Unexpected token '^'. PASS var y = x=>{| threw exception SyntaxError: Unexpected token '|'. PASS var y = x=>{&& threw exception SyntaxError: Unexpected token '&&'. PASS var y = x=>{|| threw exception SyntaxError: Unexpected token '||'. PASS var y = x=>{; threw exception SyntaxError: Unexpected end of script. PASS var y = x=>{, threw exception SyntaxError: Unexpected token ','. PASS var y = x=>} threw exception SyntaxError: Unexpected token '}'. PASS var t = x=>x+1; =>{} threw exception SyntaxError: Unexpected keyword '=>'. PASS [=>x+1] threw exception SyntaxError: Unexpected keyword '=>'. PASS [x=>x+1, =>x+1] threw exception SyntaxError: Unexpected keyword '=>'. PASS var f=>x+1; threw exception SyntaxError: Unexpected keyword '=>'. Expected ';' after var declaration.. PASS var x, y=>y+1; threw exception SyntaxError: Unexpected keyword '=>'. Expected ';' after var declaration.. PASS debug(=>x+1) threw exception SyntaxError: Unexpected keyword '=>'. PASS debug("xyz", =>x+1) threw exception SyntaxError: Unexpected keyword '=>'. PASS var af1=y =>y+1 threw exception SyntaxError: Unexpected keyword '=>'. PASS var af2=(y) =>y+1 threw exception SyntaxError: Unexpected keyword '=>'. PASS var af3=(x, y) =>y+1 threw exception SyntaxError: Unexpected keyword '=>'. PASS successfullyParsed is true TEST COMPLETE