console.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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, type, text, args, location) {
  26. this._page = page;
  27. this._type = type;
  28. this._text = text;
  29. this._args = args;
  30. this._location = location || { url: "", lineNumber: 0, columnNumber: 0 };
  31. }
  32. page() {
  33. return this._page;
  34. }
  35. type() {
  36. return this._type;
  37. }
  38. text() {
  39. if (this._text === void 0)
  40. this._text = this._args.map((arg) => arg.preview()).join(" ");
  41. return this._text;
  42. }
  43. args() {
  44. return this._args;
  45. }
  46. location() {
  47. return this._location;
  48. }
  49. }
  50. // Annotate the CommonJS export names for ESM import in node:
  51. 0 && (module.exports = {
  52. ConsoleMessage
  53. });