Subj : Re: Access a property faster To : netscape.public.mozilla.jseng From : Egor.Senin Date : Thu Nov 18 2004 02:28 am Igor Bukanov wrote in message news:<419BA6A6.1080709@fastmail.fm>... > Egor Senin wrote: > > ... > > 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) Hmm, it seems that this method doesn't traverse parent scopes, just prototype chain ... Sorry, I had to mention that I need any native objects or variables returned too when it's name is specified. Consider the call ctx.evaluateString(myScriptable, "Math", "NowNativeObjectAccess", 1, null); It returns Math object after the top scope is reached. So, which code I should write in order to fully emulate the presented ctx.evaluateString() call? Egor. .