Bug 433529: Part 6 - Add JS_GetFunctionDisplayId as a jsapi function for a JSFunction's displayAtom. r=jimb

This commit is contained in:
Alex Crichton 2012-08-18 21:45:54 -07:00
parent 4c491e32fe
commit f6fd736dd3
2 changed files with 16 additions and 0 deletions

View File

@ -4924,6 +4924,12 @@ JS_GetFunctionId(JSFunction *fun)
return fun->atom();
}
JS_PUBLIC_API(JSString *)
JS_GetFunctionDisplayId(JSFunction *fun)
{
return fun->displayAtom();
}
JS_PUBLIC_API(unsigned)
JS_GetFunctionFlags(JSFunction *fun)
{

View File

@ -4974,6 +4974,16 @@ JS_GetFunctionObject(JSFunction *fun);
extern JS_PUBLIC_API(JSString *)
JS_GetFunctionId(JSFunction *fun);
/*
* Return a function's display name. This is the defined name if one was given
* where the function was defined, or it could be an inferred name by the JS
* engine in the case that the function was defined to be anonymous. This can
* still return NULL if a useful display name could not be inferred. The same
* restrictions on rooting as those in JS_GetFunctionId apply.
*/
extern JS_PUBLIC_API(JSString *)
JS_GetFunctionDisplayId(JSFunction *fun);
/*
* Return JSFUN_* flags for fun.
*/