console.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. "use strict";
  2. var __defProp = Object.defineProperty;
  3. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  4. var __getOwnPropNames = Object.getOwnPropertyNames;
  5. var __hasOwnProp = Object.prototype.hasOwnProperty;
  6. var __export = (target, all) => {
  7. for (var name in all)
  8. __defProp(target, name, { get: all[name], enumerable: true });
  9. };
  10. var __copyProps = (to, from, except, desc) => {
  11. if (from && typeof from === "object" || typeof from === "function") {
  12. for (let key of __getOwnPropNames(from))
  13. if (!__hasOwnProp.call(to, key) && key !== except)
  14. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  15. }
  16. return to;
  17. };
  18. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  19. var console_exports = {};
  20. __export(console_exports, {
  21. ConsoleMessage: () => ConsoleMessage
  22. });
  23. module.exports = __toCommonJS(console_exports);
  24. class ConsoleMessage {
  25. constructor(page, worker, type, text, args, location) {
  26. this._page = page;
  27. this._worker = worker;
  28. this._type = type;
  29. this._text = text;
  30. this._args = args;
  31. this._location = location || { url: "", lineNumber: 0, columnNumber: 0 };
  32. }
  33. page() {
  34. return this._page;
  35. }
  36. worker() {
  37. return this._worker;
  38. }
  39. type() {
  40. return this._type;
  41. }
  42. text() {
  43. if (this._text === void 0)
  44. this._text = this._args.map((arg) => arg.preview()).join(" ");
  45. return this._text;
  46. }
  47. args() {
  48. return this._args;
  49. }
  50. location() {
  51. return this._location;
  52. }
  53. }
  54. // Annotate the CommonJS export names for ESM import in node:
  55. 0 && (module.exports = {
  56. ConsoleMessage
  57. });