bzhkl
May 21, 2019, 8:12am
1
function greeter(whatToGreet)
{
return function() { Demo.print("hello " + whatToGreet + "!"); };
}
Demo.print( greeter("closure")() );
the code above will print hello undefined!
It seems javascript engine doesn’t support closure, Is there some plan to support this feature?
The JUCE Javascript implementation is fairly minimal - if you want full modern JS support you might want to look at adding V8, Spidermonkey or another embedded JS engine to your project.
1 Like
Integrating duktape isn’t totally crazy either. It’s pretty lightweight and is straightforward enough to set up and use.
1 Like
bzhkl
May 22, 2019, 10:41pm
4
wow, this library is exactly what i want. Althouth not as fancy as v8, but simple and powerful enough.
Thank you very much!