mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-26 18:15:36 +00:00
Added class_replaceMethod.
Reviewed by me.
This commit is contained in:
1 parent
699550c879
commit
53aadde343
1 file changed
+16
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user