Implement AOP of javascript