I wrote:

> I wasn't aware that one can livecode JS objects with PharoJS, only
> that PharoJS generates JS source which eventually runs in a browser.
> Can you give an example?

     Well, I evaluated the PharoJS playground expressions, and browsed
around the proxy support in the index.js that gets installed in a web
browser. I could inject the PjLoadForTest class into the web browser and
invoke its JS functions via Smalltalk messages from Pharo. I could send
#at:put: to the exposed "window" proxy of the web browser (as long as
the arguments were JS literals or proxies), and I could also inspect the
"document" proxy, but I got an exception when I tried to invoke
document.getElementWithId (via "bridge evalBlock: [document
getElementById: 'someID']"). Are arbitrary JS messages supposed to work?

     There isn't much exception handling support beyond relaying JS
error messages. (I guess one way to go would be to use the Chrome
Debugging Protocol.) I didn't see how to refer to Smalltalk objects from
JS (only JS objects from Smalltalk), so it seems the only Smalltalk
blocks one can use as JS callback functions are those which only use
objects and functions in JS-land.

     This might be okay for smoke-testing PharoJS apps, but I think the
kind of interactive DOM object sketching I mentioned before would be
uncomfortable.


-C

--
Craig Latta
Black Page Digital
Amsterdam :: San Francisco
cr...@blackpagedigital.com
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)

Reply via email to