diff --git a/mozilla/js/ref/jsapi.c b/mozilla/js/ref/jsapi.c index 75502773993..e832555cc89 100644 --- a/mozilla/js/ref/jsapi.c +++ b/mozilla/js/ref/jsapi.c @@ -1779,9 +1779,13 @@ JS_NewFunction(JSContext *cx, JSNative call, uintN nargs, uintN flags, JSAtom *atom; CHECK_REQUEST(cx); - atom = js_Atomize(cx, name, strlen(name), 0); - if (!atom) - return NULL; + + atom = NULL; + if (name) { + atom = js_Atomize(cx, name, strlen(name), 0); + if (!atom) + return NULL; + } return js_NewFunction(cx, NULL, call, nargs, flags, parent, atom); }