pkg/playground/exception.js
raw| 1 | // SPDX-License-Identifier: LGPL-2.1-or-later |
| 2 | /* An unhandled javascript exception */ |
| 3 | import '../lib/patternfly/patternfly-6-cockpit.scss'; |
| 4 | import cockpit from "cockpit"; |
| 5 | |
| 6 | const button = document.getElementById("exception"); |
| 7 | button.addEventListener("click", function() { |
| 8 | const obj = { }; |
| 9 | window.setTimeout(function() { |
| 10 | obj[0].value = 1; |
| 11 | }, 0); |
| 12 | }); |
| 13 | |
| 14 | cockpit.transport.wait(function() { |
| 15 | document.body.removeAttribute("hidden"); |
| 16 | }); |