JsDiagGetStackTrace.js 845 B

12345678910111213141516171819202122232425262728293031323334
  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. /**exception(all):stack();**/
  6. function fromEval() {
  7. try {
  8. throw new Error('Caught Error');
  9. } catch (ex) {}
  10. }
  11. function foo() {
  12. eval("fromEval();");
  13. }
  14. foo();
  15. function FuncLevel2() {
  16. var level2Var = 1;
  17. function FuncLevel3() {
  18. var level3Var = level2Var; /**bp:stack();**/
  19. }
  20. FuncLevel3();
  21. }
  22. var globalVar = Math;
  23. function FuncLevel1() {
  24. var level1Var = globalVar;
  25. FuncLevel2();
  26. }
  27. FuncLevel1(1);
  28. WScript.Echo("pass");