On Feb 21, 11:13 am, "Edward K. Ream" <edream...@gmail.com> wrote: > I've got to learn javascript in order to read the MooTools sources :-) > > Some first steps. > > The MooTools sources are minimized, but not obfuscated. Googling for > "reformat JavaScript" took me to: > > http://jsbeautifier.org/ > [..] > > I'm still amazed that anyone can write software with a language like > this, but now I have an inkling about how it might happen. > execution of javascript in a browser is another limiting factor. speed, error reporting to just name two problems. it would be easy to load most javascript into a QScript engine previously loaded with mootools, prototype or other favorite wrapper, coffee script or whatever then evaluate any node or selected text as can now be done with python & execute script. not sure how completely pyqt wraps QScript. I have been using jsbn large integer javascript run inside QScript.
there are some things to notice, most javascript, especially projects started over a few years ago, expect to be run in a browser so they expect things like alert("") to work. prime the engine with something like: function alert(msg){ throw(Error(msg)); } of course, an actual popup could be done as well. sometimes they run code to determine which browser and change their code on the fly these kinds of things would have to be commented out or made to recognize QScript somehow. QScript is mostly compatible but not 100%. all problems that could be worked out if anyone cared. QScript has/can be given access to all Qt slots & signals. there are many more potential programmers of javascript looking for a fun tool in Leo than there are python programmers. http://altjs.org/ has a bunch of ports, forks and standalone engines links. also check out JSHint, a true fork of JSLint. I can't recommend a test harness project, there are many, I run tests outside using javascript to provide the answers. -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to leo-editor@googlegroups.com. To unsubscribe from this group, send email to leo-editor+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.