doc_promise.html 776 B

12345678910111213141516171819202122232425262728293031
  1. <!-- Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ -->
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta charset="utf-8"/>
  7. <title>Debugger + Promise test page</title>
  8. </head>
  9. <body>
  10. <script>
  11. window.pending = new Promise(function () {});
  12. window.fulfilled = Promise.resolve({ a: 1, b: 2, c: 3 });
  13. window.rejected = Promise.reject(new Error("uh oh"));
  14. window.doPause = function () {
  15. var p = window.pending;
  16. var f = window.fulfilled;
  17. var r = window.rejected;
  18. debugger;
  19. };
  20. // Attach an error handler so that the logs don't have a warning about an
  21. // unhandled, rejected promise.
  22. window.rejected.then(null, function () {});
  23. </script>
  24. </body>
  25. </html>