Unwrap the target before checking for callability, so that wrappers don't wrongly appear to be callable. r=orange

This commit is contained in:
Jeff Walden 2010-08-26 01:22:20 -04:00
parent e5fd6c565c
commit 23c30a7beb

View File

@ -2575,7 +2575,7 @@ fun_bind(JSContext *cx, uintN argc, Value *vp)
return false;
/* Step 2. */
if (!target->isCallable()) {
if (!target->wrappedObject(cx)->isCallable()) {
if (JSString *str = js_ValueToString(cx, vp[1])) {
if (const char *bytes = js_GetStringBytes(cx, str)) {
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,