Fix JS_CompileUCFunctionForPrincipals to allow null obj with non-null funAtom, for precompiling a named function against no scope (no bug, r=self trivial change).

This commit is contained in:
brendan%mozilla.org 2003-04-10 23:38:59 +00:00
parent d9ad51a769
commit 05f54166a9

View File

@ -3287,7 +3287,7 @@ JS_CompileUCFunctionForPrincipals(JSContext *cx, JSObject *obj,
fun = NULL;
goto out;
}
if (funAtom) {
if (obj && funAtom) {
if (!OBJ_DEFINE_PROPERTY(cx, obj, (jsid)funAtom,
OBJECT_TO_JSVAL(fun->object),
NULL, NULL, 0, NULL)) {