Il giorno lun, 28-02-2005 alle 17:54 -0800, Donovan Preston ha scritto:
On Feb 28, 2005, at 3:09 PM, Federico Di Gregorio wrote:
substituting "this" to "node"? It is fine for me and even the "js" name is not too bad (i.e., I can't think of anything better right now.)
That is correct, and I hope it is ok. The way "literal" (to be renamed "js") is written is very convenient, too:
handler(mycallable, liveevil.js.this.value)
Would work just as well (__getattr__ constructs new literal instances). There is already a module-global "document" literal, so you can do livepage.document.getElementById. literal (js) provides __getitem__ as well as __call__ implementations.
Usefull. Can we also have a module-global "this"? And maybe "window"? document, window and this are almost the only JS globals I can think of that are used in a normal page.
I hope it all makes sense, it is somewhat experimental at this point. One good thing about this new implementation is that there are extensive javascript quoting unittests, where there were none before, so hopefully it is less buggy, more flexible, and less likely to change in the future.
Great. :) federico -- Federico Di Gregorio http://people.initd.org/fog Debian GNU/Linux Developer fog@debian.org INIT.D Developer fog@initd.org Sei una bergogna. Vergonga. Vergogna. -- Valentina