2
0

try4.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 test(i) {
  6. try {
  7. var g = function (x) {
  8. try {
  9. eval("throw x;");
  10. }
  11. catch(b) {
  12. WScript.Echo("g: caught " + b);
  13. }
  14. };
  15. throw g;
  16. }
  17. catch (a) {
  18. return a;
  19. }
  20. };
  21. try {
  22. var g = function (x) {
  23. try {
  24. throw x;
  25. }
  26. catch(b) {
  27. WScript.Echo("g: caught " + b);
  28. return x;
  29. }
  30. };
  31. throw g;
  32. }
  33. catch (a) {
  34. eval("WScript.Echo(a(6))");
  35. }
  36. test(1)(2);