Bug 852761 - dis() doesn't work on arrow functions. r=luke.

This commit is contained in:
Jason Orendorff 2013-03-20 09:37:33 -07:00
parent c29c55e65d
commit 827c995879

View File

@ -1417,6 +1417,15 @@ ValueToScript(JSContext *cx, jsval v, JSFunction **funp = NULL)
if (!fun) if (!fun)
return NULL; return NULL;
// Unwrap bound functions.
while (fun->isBoundFunction()) {
JSObject *target = fun->getBoundFunctionTarget();
if (target && target->isFunction())
fun = target->toFunction();
else
break;
}
RootedScript script(cx); RootedScript script(cx);
JSFunction::maybeGetOrCreateScript(cx, fun, &script); JSFunction::maybeGetOrCreateScript(cx, fun, &script);
if (!script) if (!script)