bug56026_trycatch.js 904 B

123456789101112131415161718192021222324252627
  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. // Tests that bug 56025 is fixed in the try/catch/with funcexprscope case.
  6. // http://bugcheck/bugs/WindowsBlueBugs/56026
  7. try {
  8. (function TestFunc() {
  9. var a;
  10. (function outer() {
  11. (function inner() { a; })();
  12. try {
  13. throw "Exception";
  14. }
  15. catch (ex) {
  16. with ({}) { outer(); }
  17. }
  18. })();
  19. })();
  20. }
  21. catch (ex) {
  22. if (ex.message == "Out of stack space") {
  23. WScript.Echo("PASSED");
  24. }
  25. }