Post by Lutz » Sat Jan 04, 2014 6:44 pm

What browser and version are you using? I don't get any "undefined" messages when using only one parameter for the window.prompt call. I am using:



Firefox 26.0

Chrome 31.0

Safari 7.01



Also, all the code from Emscripten uses windows.prompt() with only one string argument.



Regarding the the size of the returned string from eval-string-js:

It seems that JavaScript is allocating the memory for the returned string and then is also managing it for GC. newLISP makes a copy of it and manages that copy. I tested for memory leaks when invoking eval-string-js and it seems that memory is managed well by JavaScript and newLISP for this call. I haven't tested for the max memory allowed as return value but believe, there will be no problems loading code source.



Talking about memory in general:

At this moment newlis-js-lib.js is limited to about 16MB of heap memory, which is the default Emscripten allocates and probably a sensible (conservative) choice for browser based applications. This value can be changed in a configuration file and perhaps I will bump it up to 32MB or even more. There are many other limits which can be configured before compilation and as things move along, I will experiment. At the moment I go with the defaults until we know more.



Ps: thanks for the great examples Marc. Do you also get this “undefined” message HPW is talking about? And what browser version do you run?



Ps2: I am getting a "undefined" as return value from (eval-string-js "alert(6)"), but believe this is Ok, "undefined" is simply the return value from the JavaScript alert() function in this case, perhaps in JavaScript alert is "void alert()".



Ps3: Note, that using $(window).width(); also would need jQuery installed.