Added class_replaceMethod.

Reviewed by me.
This commit is contained in:
Francisco Tolmasky committed 2009-02-15 01:08:44 -08:00
1 parent 699550c879
commit 53aadde343
1 file changed
+16
+16
View File
@@ -226,6 +226,22 @@ function class_copyMethodList(/*Class*/ aClass)
return aClass.method_list.slice(0);
}
function class_replaceMethod(/*Class*/ aClass, /*SEL*/ aSelector, /*IMP*/ aMethodImplementation)
{
if (!aClass || !aSelector)
return NULL;
var method = aClass.method_dtable[aSelector],
method_imp = NULL;
if (method)
method_imp = method.method_imp;
method.method_imp = aMethodImplementation;
return method_imp;
}
var _class_initialize = function(/*Class*/ aClass)
{
var meta = GETMETA(aClass);