You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could not find an issue regarding arrow functions so far, so I hope this is the right place and no duplicate.
As a lot of Javascript example code works with functions using the arrow syntax, I was surprised to find out that this interpreter does not seem to be able to handle these.
Example that you can paste into the live demo:
// works:alert((function(x){returnx})(3));// does not work:alert((x=>x)(3));
For my purposes I can use the longer variant, but it would be pretty neat if the shorter syntax was supported. At least a hint in the docs or a list of supportedd features would be very much appreciated. Thanks for the nice project!
The text was updated successfully, but these errors were encountered:
I've written a transpiler specifically for arrow functions, and it simply converts them into regular functions. Hope this helps!
var_="() => {}"var[__,___]=[(/\s*\)\s*=\s*>\s*{/g)];var____=[];while(___=__.exec(_)){let__=___.index;while(_.substring(__,__+1)!=="("||__<=0){__-=1;}____.push(__)};var__=0;____.forEach((index)=>{__+=index;_=_.substring(0,__)+'function'+_.substring(__)__+=('function').length-1})_=_.replace((/\s*\)\s*=\s*>\s*{/g),') {');console.log(_)// _ is the output.
I could not find an issue regarding arrow functions so far, so I hope this is the right place and no duplicate.
As a lot of Javascript example code works with functions using the arrow syntax, I was surprised to find out that this interpreter does not seem to be able to handle these.
Example that you can paste into the live demo:
For my purposes I can use the longer variant, but it would be pretty neat if the shorter syntax was supported. At least a hint in the docs or a list of supportedd features would be very much appreciated. Thanks for the nice project!
The text was updated successfully, but these errors were encountered: