Function: classkit_method_remove version 108

Function:
Description: Dynamically removes the given method.
Version:
Status: latest
Date: 2011-12-20 05:22
Summary: Import from phpjs.
Programmer: jj5
Code
1
2
3
4
5
6
7
8
9
10
11
12
13
function classkit_method_remove (classname, methodname) {
    // http://jsphp.co/jsphp/fn/view/classkit_method_remove
    // +   original by: Brett Zamir (http://brett-zamir.me)
    // *     example 1: classkit_method_remove('someClass', 'someMethod');
    // *     returns 1: true

    if (typeof classname === 'string') {
        classname = this.window[classname];
    }
    delete classname.prototype[methodname]; // Delete any on prototype
    // delete classname[methodname]; // Delete any as static class method
    return true;
}
[top]

Comments

There are no comments yet, be the first!

Please Login or Register to post comments.