Fix use of getPrivate() on function object, bug 693754.
authorBrian Hackett <bhackett1024@gmail.com>
Wed, 12 Oct 2011 09:48:46 -0700
changeset 82889 cec1cd6fa7b5b8779918c23b804b60d5ca6c1c03
parent 82888 ab14001bab8472350da84b0d15e587194ecd961d
child 82890 75b87fb3f2ebb424934de817f5a4caeac8243098
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs693754
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Fix use of getPrivate() on function object, bug 693754.
dom/plugins/base/nsJSNPRuntime.cpp
--- a/dom/plugins/base/nsJSNPRuntime.cpp
+++ b/dom/plugins/base/nsJSNPRuntime.cpp
@@ -1478,17 +1478,17 @@ CallNPMethodInternal(JSContext *cx, JSOb
 
       msg = "Attempt to construct object from class with no constructor.";
     }
   } else if (funobj != obj) {
     // A obj.function() style call is made, get the method name from
     // the function object.
 
     if (npobj->_class->invoke) {
-      JSFunction *fun = (JSFunction *)::JS_GetPrivate(cx, funobj);
+      JSFunction *fun = ::JS_GetObjectFunction(funobj);
       JSString *name = ::JS_InternJSString(cx, ::JS_GetFunctionId(fun));
       NPIdentifier id = StringToNPIdentifier(cx, name);
 
       ok = npobj->_class->invoke(npobj, id, npargs, argc, &v);
     } else {
       ok = JS_FALSE;
 
       msg = "Attempt to call a method on object with no invoke method.";