Could point the src of the script tags to a server-side script to invoke the parser or maybe a web server module that catches the <script type=”application/javascript”> and runs the content of the tag through the parser.
As for the lambda syntax I think the best is from C# e.g. function(x){return x > 0;}
would be… x => x > 0;
with multiple arguments and lines being…
(x, y) => { if(x > 0) { return 'X greater than 0'; } else if(y > 0) { return 'Y greater than 0'; } } |
var sales =
;
]]>JavaScript parsing engines are inconsistent enough (e.g trailing commas in object literals) at base level. You’d need a pretty good reason to tackle it; like creating something that is radically different to JavaScript, not just JavaScript with some extra weirdness.
]]>It would be much nicer as an extension though.
]]>