errors.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.QuickJSMemoryLeakDetected = exports.QuickJSAsyncifySuspended = exports.QuickJSAsyncifyError = exports.QuickJSNotImplemented = exports.QuickJSUseAfterFree = exports.QuickJSWrongOwner = exports.QuickJSUnwrapError = void 0;
  4. /**
  5. * Error thrown if [[QuickJSContext.unwrapResult]] unwraps an error value that isn't an object.
  6. */
  7. class QuickJSUnwrapError extends Error {
  8. constructor(cause, context) {
  9. super(String(cause));
  10. this.cause = cause;
  11. this.context = context;
  12. this.name = "QuickJSUnwrapError";
  13. }
  14. }
  15. exports.QuickJSUnwrapError = QuickJSUnwrapError;
  16. class QuickJSWrongOwner extends Error {
  17. constructor() {
  18. super(...arguments);
  19. this.name = "QuickJSWrongOwner";
  20. }
  21. }
  22. exports.QuickJSWrongOwner = QuickJSWrongOwner;
  23. class QuickJSUseAfterFree extends Error {
  24. constructor() {
  25. super(...arguments);
  26. this.name = "QuickJSUseAfterFree";
  27. }
  28. }
  29. exports.QuickJSUseAfterFree = QuickJSUseAfterFree;
  30. class QuickJSNotImplemented extends Error {
  31. constructor() {
  32. super(...arguments);
  33. this.name = "QuickJSNotImplemented";
  34. }
  35. }
  36. exports.QuickJSNotImplemented = QuickJSNotImplemented;
  37. class QuickJSAsyncifyError extends Error {
  38. constructor() {
  39. super(...arguments);
  40. this.name = "QuickJSAsyncifyError";
  41. }
  42. }
  43. exports.QuickJSAsyncifyError = QuickJSAsyncifyError;
  44. class QuickJSAsyncifySuspended extends Error {
  45. constructor() {
  46. super(...arguments);
  47. this.name = "QuickJSAsyncifySuspended";
  48. }
  49. }
  50. exports.QuickJSAsyncifySuspended = QuickJSAsyncifySuspended;
  51. class QuickJSMemoryLeakDetected extends Error {
  52. constructor() {
  53. super(...arguments);
  54. this.name = "QuickJSMemoryLeakDetected";
  55. }
  56. }
  57. exports.QuickJSMemoryLeakDetected = QuickJSMemoryLeakDetected;
  58. //# sourceMappingURL=errors.js.map