Comments on: Custom JavaScript with “parseScripts” https://j11y.io/cool-stuff/custom-javascript-with-parsescripts/ Sun, 22 Mar 2015 15:39:22 +0000 hourly 1 https://wordpress.org/?v=5.0.13 By: Derek Fowler https://j11y.io/cool-stuff/custom-javascript-with-parsescripts/#comment-936 Sun, 24 May 2009 21:31:39 +0000 https://j11y.io/?p=828#comment-936 This looks really interesting, there’s no reason why you couldn’t use Rhino on your server to do the parsing server-side and just send normal JavaScript to the browser.

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';
  }
}
]]>
By: Valentino https://j11y.io/cool-stuff/custom-javascript-with-parsescripts/#comment-935 Sat, 23 May 2009 00:50:59 +0000 https://j11y.io/?p=828#comment-935 I hope somebody took this ideas to build E4X in javascript cross-browser, so we can write something like:

var sales =

;

]]>
By: Pete https://j11y.io/cool-stuff/custom-javascript-with-parsescripts/#comment-934 Fri, 22 May 2009 11:52:13 +0000 https://j11y.io/?p=828#comment-934 IMO it’s an interesting idea, but a little too derivative to take seriously. I mean, ‘#’ instead of ‘function’ is very ugly looking.

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.

]]>
By: Balazs Endresz https://j11y.io/cool-stuff/custom-javascript-with-parsescripts/#comment-933 Fri, 22 May 2009 11:46:39 +0000 https://j11y.io/?p=828#comment-933 Another useful thing is that you can also make Firebug recognize Crambdas by inserting the parsing functon in the `evaluate` method located here under the Firefox profile folder:
extensionsfirebug@software.joehewitt.comcontentfirebugcommandLineInjected.js

It would be much nicer as an extension though.

]]>