bailout-throw.js 719 B

12345678910111213141516171819202122232425
  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. var a = 3;
  6. function test()
  7. {
  8. // Bail out point to make sure the stack walker can get the line number of the throw after bailout
  9. for (var i = 0; i < a; i++)
  10. {
  11. WScript.Echo(i);
  12. }
  13. throw 1;
  14. }
  15. (function () {
  16. try {
  17. test();
  18. }
  19. catch (e) {
  20. print(e === 1);
  21. }
  22. })();