JsDiagExceptionsInAsyncFunctions_BreakOnUncaughtExceptions.js 803 B

1234567891011121314151617181920212223242526272829303132333435
  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(uncaught):stack();**/
  6. async function f1() {
  7. await null;
  8. throw new Error('error in f1');
  9. }
  10. f1();
  11. async function f2() {
  12. async function f2a() {
  13. throw "err";
  14. }
  15. async function f2b() {
  16. try {
  17. var p = f2a();
  18. } catch (e) {
  19. console.log("caught " + e);
  20. }
  21. }
  22. async function f2c() {
  23. var p = f2a();
  24. }
  25. f2b();
  26. f2c();
  27. }
  28. f2();