Core functionalities of jaggery2 were written in using Java.but we change
that approach and now onwards everything is in JavaScript.(Accessing Java
through JavaScript code).Jaggery2 will expose all the core functionalities
via JavaScript.

Jaggery.js is the startup js file which corresponding to load all core
functionalities in jaggery2.At the nashorn engine startup we load the
script file Jaggery.js and bind all jaggery2 core functions to global
ScriptObject using "Object.bindProperties(this,property)".

you can find source @
https://github.com/sidias/jaggery2/tree/jagger2.1

*Edit*
compileScript and runScript methods were redeveloped to bypass issues
mentioned in previous post.

in compiled script function you can execute as follow

globalVar = 0;

var script = vm.compileScript('myfile.js','globalVar += 1');
    for (var i = 0; i < 1000 ; i += 1) {
         vm.runScripts(script);
    }
 print(globalVar)

output -1000

-- 
Thanks & Best Regards,

*Buddhi Nipun Mihara*
Software Engineer(intern)
WSO2, Inc.:http://wso2.com
lean.enterprise.middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to