Hello,

I'm trying to run JSLint using Rhino, but I've encountered a problem that has 
somewhat stumped me. How can I create a 'real' array from Java? Here's what 
I've been trying:

  Context cx = Context.enter();
  Scriptable scope = cx.initStandardObjects();
  String src = "function f(a) { return a instanceof Array; };";

  cx.evaluateString(scope, src, "<src>", 0, null);

  Function f = (Function) scope.get("f", scope);
  Object[] fArgs = new Object[]{ new NativeArray(0) };
  Object result = f.call(cx, scope, scope, fArgs);

  System.out.println(Context.toString(result));
  Context.exit();

But result is false. What am I doing wrong?

P.S.: Since I don't want to mess with JSLint's source, it is essential that I 
can create an object that passes the "instanceof" test.
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to