I'm attempting to filter a FreeMarker list in a Magnolia JavaScript model using Array.prototype.filter().  List  [#assign list = [1, 2, 3]]   Model  var Model = function() {   this.filterList = function(list) {     return list.filter(function(ite...
In Java 1.7, prior to it's removal, one could use 'Packages' to access Java Enums in the following way from Javascript on an HTML page viewed a browser:  var enumvar1 = document.appletid.Packages.com.mycompany.MyClass$MyEnumYesNo.YES var...
I need to evaluate this function in Javascript from Scala/Java  function hello(a, b) {     return a+b; }   I did this basic code:  val factory = new ScriptEngineManager(null) val engine = factory.getEngineByName("JavaScript")  val body =   &#...
I want to render d3 charts on the server.  I had 3 options:  Node, Phantom, and Nashorn.    I prefer Nashorn because my API is Scala Play and I don't want to manage another process.  (deployment, load, queue, etc etc)  So now I need to get JSDom...
I am trying to write a library that will let me execute JSON Logic rules via the Nashorn Javascript engine.  My problem right now is specifically around the JSObject wrapper I've created to handle moving data from Java/Kotlin into the scripting e...
I have evaluated the following script using the NashornScriptEngine:  var Namespace = {     test: function()     {         return "It works";     } }   Now I want to call the function test.  When using the method invokeFunction of the nashorn...
Java calling code:  import jdk.nashorn.api.scripting.*; .... myCustomHashMap dataStore = new myCustomHashMap(); ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine engine = sem.getEngineByName("nashorn"); engine.put("dataSto...
I used the following code with the Rhino JavaScript engine in Java:  @Test public void testRhino() throws ScriptException {     final ScriptEngineManager factory = new ScriptEngineManager();     final ScriptEngine engine = factory.getEngineByName(...
Nashorn java script engine has built-in profiler which can be invoked like this:   jjs -pcs profiled_script.js.   This profiler produces a file named NashornProfile.txt. Here is an example line from this file:   0       dyn:getProp|getElem|getMethod:...
While running below code, I am getting error. I have no idea what is causing this error.  ScriptEngine engine = engineManager.getEngineByName("nashorn");       String str = "var shape_objects = [ Java.Type(\"new Triangle()\"), Jav...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.