benjaminvr

Untitled

Jun 13th, 2023
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. Function.prototype.clone = function() {
  2. var that = this;
  3. var temp = function temporary() { return that.apply(this, arguments); };
  4. for(var key in this) {
  5. if (this.hasOwnProperty(key)) {
  6. temp[key] = this[key];
  7. }
  8. }
  9. return temp;
  10. };
  11. ƒ () {
  12. var that = this;
  13. var temp = function temporary() { return that.apply(this, arguments); };
  14. for(var key in this) {
  15. if (this.hasOwnProperty(key)) {
  16. temp[key] = this[…
  17. Function.call
  18. ƒ call() { [native code] }
  19. Function.prototype.LegacyCall = Function.prototype.call.clone();
  20. ƒ temporary() { return that.apply(this, arguments); }
  21. Function.prototype.call = function(){
  22. var fn = this;
  23.  
  24. return function(){
  25. try {
  26. return fn.apply(this, arguments);
  27. } catch (ex) {
  28. console.error("1");
  29. }
  30. }
  31. }
  32. ƒ (){
  33. var fn = this;
  34.  
  35. return function(){
  36. try {
  37. return fn.apply(this, arguments);
  38. } catch (ex) {
  39. console.error("1");
  40. }
  41. }
  42. }
  43. function test(){
  44. throw 123;
  45. }
  46. undefined
  47. test();
  48. VM622:2 Uncaught 123
  49. test @ VM622:2
  50. (anonymous) @ VM640:1
  51. test.call();
  52. ƒ (){
  53. try {
  54. return fn.apply(this, arguments);
  55. } catch (ex) {
  56. console.error("1");
  57. }
  58. }
  59. test.call()();
  60. VM532:8 1
  61. (anonymous) @ VM532:8
  62. (anonymous) @ VM679:1
  63. undefined
  64. test()();
  65. VM622:2 Uncaught 123
  66. test @ VM622:2
  67. (anonymous) @ VM703:1
  68. test.call
  69. ƒ (){
  70. var fn = this;
  71.  
  72. return function(){
  73. try {
  74. return fn.apply(this, arguments);
  75. } catch (ex) {
  76. console.error("1");
  77. }
  78. }
  79. }
  80. Function.prototype.call = (function(){
  81. var fn = this;
  82.  
  83. return function(){
  84. try {
  85. return fn.apply(this, arguments);
  86. } catch (ex) {
  87. console.error("1");
  88. }
  89. }
  90. })();
  91. ƒ (){
  92. try {
  93. return fn.apply(this, arguments);
  94. } catch (ex) {
  95. console.error("1");
  96. }
  97. }
  98. test();
  99. VM622:2 Uncaught 123
  100. test @ VM622:2
  101. (anonymous) @ VM796:1
  102. test.call();
  103. VM773:8 1
Advertisement
Add Comment
Please, Sign In to add comment