From 97a1b7dc2d453a88c072fa7a33c83e6681e09508 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Sun, 27 Jun 2010 11:55:49 +0000 Subject: [PATCH] Reduce use of strongly-discouraged JS_ValueToFunction This was SVN commit r7636. --- source/gui/scripting/JSInterface_IGUIObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gui/scripting/JSInterface_IGUIObject.cpp b/source/gui/scripting/JSInterface_IGUIObject.cpp index 5e2e4c9770..acc9fee8f4 100644 --- a/source/gui/scripting/JSInterface_IGUIObject.cpp +++ b/source/gui/scripting/JSInterface_IGUIObject.cpp @@ -297,7 +297,7 @@ JSBool JSI_IGUIObject::setProperty(JSContext* cx, JSObject* obj, jsval id, jsval // Use onWhatever to set event handlers if (propName.Left(2) == "on") { - if (!JSVAL_IS_OBJECT(*vp) || !JS_ValueToFunction(cx, *vp)) + if (!JSVAL_IS_OBJECT(*vp) || !JS_ObjectIsFunction(cx, JSVAL_TO_OBJECT(*vp))) { JS_ReportError(cx, "on- event-handlers must be functions"); return JS_FALSE;