doc_bug_1112378.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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>Web Audio Editor test page</title>
  8. </head>
  9. <body>
  10. <script type="text/javascript;version=1.8">
  11. "use strict";
  12. let ctx = new AudioContext();
  13. let osc = ctx.createOscillator();
  14. function throwError () {
  15. try {
  16. osc.connect({});
  17. } catch (e) {
  18. return {
  19. lineNumber: e.lineNumber,
  20. fileName: e.fileName,
  21. columnNumber: e.columnNumber,
  22. message: e.message,
  23. instanceof: e instanceof TypeError,
  24. stringified: e.toString(),
  25. name: e.name
  26. }
  27. }
  28. }
  29. function throwDOMException () {
  30. try {
  31. osc.frequency.setValueAtTime(0, -1);
  32. } catch (e) {
  33. return {
  34. lineNumber: e.lineNumber,
  35. columnNumber: e.columnNumber,
  36. filename: e.filename,
  37. message: e.message,
  38. code: e.code,
  39. result: e.result,
  40. instanceof: e instanceof DOMException,
  41. stringified: e.toString(),
  42. name: e.name
  43. }
  44. }
  45. }
  46. </script>
  47. </body>
  48. </html>