Subj : Calling functions without the lookup To : spidermonkey list From : ggadwa@voyager.net (Brian Barnes) Date : Wed Jan 15 2003 06:13 am I've asked this before, and gotten some answers, tried them out, then I looked through the code and found some equivalents. My problem is that I can certain functions over and over again, and want to avoid the name to object lookup. Is this equivalent? JS_CallFunctionName(cx,obj,"BLECH",argc,&argv,&rval); To this: jsval myfunc; JS_GetProperty(cx,obj,"BLECH",&myfunc); JS_CallFunctionValue(cx,obj,"BLECH",argc,&argv,&rval); Is there any problem with this across garbage collections? I'd be caching the myfunc and using it continually. It would be nice to have an additional API that got you a JSFunction from a name, like: JS_GetFunctionObject(cx,obj,"BLECH",&fun); Then I could call JS_CallFunction and the code would make a bit more readable, but if this is OK, then this way is good for me. [>] Brian .