dumpFunctionProperties.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. function foo() {
  6. var x = 1; /**bp:dumpFunctionProperties();**/
  7. }
  8. foo();
  9. (function () {
  10. var x = 1; /**bp:dumpFunctionProperties(0, 1);**/
  11. })();
  12. var arr = [0];
  13. arr.forEach((s) => {
  14. var x = 1; /**bp:dumpFunctionProperties([0], '0');**/
  15. });
  16. function same(shouldBreak) {
  17. if (shouldBreak) {
  18. // 0 is same(true), 1 is same(false), 2 is global function). same is dumped only once as functionHandle for frame 0 and 1 is same.
  19. var x = 1; /**bp:stack();dumpFunctionProperties([0,1,2]);**/
  20. } else {
  21. same(!shouldBreak);
  22. }
  23. }
  24. same(false);
  25. function one(arg1) {
  26. two();
  27. }
  28. function two(arg1, arg2) {
  29. three();
  30. }
  31. function three(arg1, arg2, arg3) {
  32. var x = 1; /**bp:stack();dumpFunctionProperties([0,1,2,3], 0);**/
  33. }
  34. one();
  35. WScript.Echo("pass");