Interesting question. I can't think of a way that Rhino would even know that the object was defined in script 'b' if you hadn't passed it to Rhino to parse (until it's parsed it's just text).
So although I'm not the expert here, I'm going to venture out and say that it's not possible, nor even conceptually possible by my reasoning. ----- Original Message ---- From: Michael Rennie <[email protected]> To: [email protected] Sent: Tue, August 10, 2010 12:17:07 PM Subject: Can you set a classpath-like entry for Rhino? I am playing around with Rhino, and encountered a case the internet did have an answer for. Say you have a script that references elements from another script - say a.js references b.js - is there some way to eval a.js and tell Rhino to also consider b.js? using the pattern like: Context txt - factory.enterContext(); Scriptable s = txt.iniStandardObjects(); txt.evaluateString(s, asrcstr, a.js, 0, null); will fail saying a.js refs b.js and it knows nothing about b.js Do I have to explicitly eval each script? For example eval b.js and then eval a.js, or can I just somehow tell Rhino to eval a.js and also look at some location for referenced scripts? Thanks in advance, Michael _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
