capture.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 f1(x) {
  6. try {
  7. throw 'catch';
  8. }
  9. catch (x) {
  10. var f2 = function () {
  11. WScript.Echo(x);
  12. }
  13. f2();
  14. function f3() {
  15. WScript.Echo(x);
  16. try {
  17. throw 'catch2';
  18. }
  19. catch (y) {
  20. f2();
  21. var f4 = function () {
  22. WScript.Echo(x, y);
  23. }
  24. function f5() {
  25. WScript.Echo(x, y);
  26. }
  27. }
  28. f4();
  29. f5();
  30. }
  31. f3();
  32. }
  33. }
  34. y = 'y';
  35. f1('param');
  36. function f10(){
  37. var ex = 'Carey Price';
  38. try {
  39. throw 1;
  40. } catch(ex) {
  41. try {
  42. throw 2;
  43. } catch(ex) {
  44. function f11 (){};
  45. function f12 (){ WScript.Echo(ex); };
  46. }
  47. }
  48. f12();
  49. };
  50. f10();
  51. function outer(g) {
  52. function inner() {
  53. try {
  54. throw 1;
  55. }
  56. catch(g) {
  57. if (g !== 1)
  58. WScript.Echo('g === ' + g + ' in catch');
  59. }
  60. }
  61. inner();
  62. if (g !== 'g')
  63. WScript.Echo('g === ' + g + ' in "inner"');
  64. }
  65. outer('g');