Skip to content

bosscheng/simple-aop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

aop 一个对象的方法

demo

例如 aop window.setTimeout

aop(window,'setTimeout',function(it){

    return function(){
        var args = [].prototype.slice(arguments);

        // do somethings
        if (it.apply) {
            it.apply(this, args);
        } else {
            Function.prototype.apply.apply(it, [it, args]);
        }

        // do somethings
    }

})

About

a simple aop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published