Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function a()
- {
- new_code();
- original_a();
- }
- function a()
- {
- original_a();
- other_new_code();
- }
- var a = (function() {
- var original_a = a;
- if (condition) {
- return function() {
- new_code();
- original_a();
- }
- }
- else {
- return function() {
- original_a();
- other_new_code();
- }
- }
- })();
- //Saving the original func
- var org_foo = window.foo;
- //Assigning proxy fucnc
- window.foo = function(args){
- //Performing checks
- if(checkCondition(args)){
- //Calling original funcs
- org_foo(args);
- }
- };
- if (condition) { new_code(); original_a(); }
- else { original_a(); other_new_code(); }
- });
Add Comment
Please, Sign In to add comment