Subj : Re: Access a property faster To : Egor Senin From : Igor Bukanov Date : Wed Nov 17 2004 08:29 pm Egor Senin wrote: > Hi! > > Suppose I have the following call: > > ctx.evaluateString(myScriptable, "properyName", "JustPropertyAccess", > 1, null); > > It just reads a property named "propertyName" starting from > myScriptable. > As I understand first "propertyName" script is compiled into > script-class and then is executed. > > Is there any other way to retrive property without a script-class > compilation but with all required traverses of prototype chain and > parent scopes, something like ctx.getProperty(myScriptable, > "propertyName"); Use ScriptableObject.getProperty(myScriptable, "properyName"), http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/ScriptableObject.html#getProperty(org.mozilla.javascript.Scriptable,%20java.lang.String) Regards, Igor .