mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 632544 - JSD_GetJSFunction can return NULL (r=dmandelin)
This commit is contained in:
parent
bbfde362e9
commit
a2f27a580c
@ -1286,6 +1286,11 @@ jsdScript::GetParameterNames(PRUint32* count, PRUnichar*** paramNames)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
JSFunction *fun = JSD_GetJSFunction (mCx, mScript);
|
||||
if (!fun) {
|
||||
*count = 0;
|
||||
*paramNames = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
JSAutoRequest ar(cx);
|
||||
JSAutoEnterCompartment ac;
|
||||
@ -1293,8 +1298,7 @@ jsdScript::GetParameterNames(PRUint32* count, PRUnichar*** paramNames)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
uintN nargs;
|
||||
if (!fun ||
|
||||
!JS_FunctionHasLocalNames(cx, fun) ||
|
||||
if (!JS_FunctionHasLocalNames(cx, fun) ||
|
||||
(nargs = JS_GetFunctionArgumentCount(cx, fun)) == 0) {
|
||||
*count = 0;
|
||||
*paramNames = nsnull;
|
||||
|
Loading…
Reference in New Issue
Block a user