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
Родитель ebb1f3feb3
Коммит f14af88f11
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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,