Subj : Properties not defined with JS_DefineProperty possible? To : netscape.public.mozilla.jseng From : Thomas Sondergaard Date : Sat Jan 08 2005 07:03 pm I'd like to use Spidermonkey as a glorified expression evaluator in a C++ application. I already have the values that needs to be available for the expression evaluator available in a std::map. I'd like to make the keys in the map available as global properties with values corresponding to the values in the map. I am wondering if there is a way that SpiderMonkey can dynamically look up properties not defined with JS_DefineProperty? Otherwise I have to refresh the defined properties to coincide with the keys available in the map before I evaluate a script (or implement another scheme to keep the global objects defined properties in sync with the keys in the map) Many dynamic languages choose to invoke a special method on the object if the desired method (or property) doesn't exist, e.g. method_missing in ruby, __getattr__ in python, unknown in Tcl. I don't think such a method exists in JavaScript, but it might exist in SpiderMonkey behind the scenes to make it simple to support native objects where the available properties change dynamically. Best regards, Thomas .