Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. // save original console object into a variable to try and bring it back later
  2. var savedConsole = console;
  3.  
  4. // test console.log before we do anything.
  5. console.log("before console freeze");
  6.  
  7. // set console to an empty function
  8. console.log=function() {}
  9.  
  10. // make console immutable now that we have transformed it
  11. console = Object.freeze(console);
  12.  
  13. // attempt to bring console back from previous console save.
  14. console = savedConsole;
  15.  
  16. // attempt to use console log, after freeze, and after resetting it
  17. // back to savedConsole
  18. console.log("after console freeze");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement