* Set the `meta` property of this doclet. * * @param {object} meta
(meta)
| 447 | * @param {object} meta |
| 448 | */ |
| 449 | setMeta(meta) { |
| 450 | let pathname; |
| 451 | |
| 452 | /** |
| 453 | * Information about the source code associated with this doclet. |
| 454 | * @namespace |
| 455 | */ |
| 456 | this.meta = this.meta || {}; |
| 457 | |
| 458 | if (meta.range) { |
| 459 | /** |
| 460 | * The positions of the first and last characters of the code associated with this doclet. |
| 461 | * @type Array.<number> |
| 462 | */ |
| 463 | this.meta.range = meta.range.slice(0); |
| 464 | } |
| 465 | |
| 466 | if (meta.lineno) { |
| 467 | /** |
| 468 | * The name of the file containing the code associated with this doclet. |
| 469 | * @type string |
| 470 | */ |
| 471 | this.meta.filename = path.basename(meta.filename); |
| 472 | /** |
| 473 | * The line number of the code associated with this doclet. |
| 474 | * @type number |
| 475 | */ |
| 476 | this.meta.lineno = meta.lineno; |
| 477 | /** |
| 478 | * The column number of the code associated with this doclet. |
| 479 | * @type number |
| 480 | */ |
| 481 | this.meta.columnno = meta.columnno; |
| 482 | |
| 483 | pathname = path.dirname(meta.filename); |
| 484 | if (pathname && pathname !== '.') { |
| 485 | this.meta.path = pathname; |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | /** |
| 490 | * Information about the code symbol. |
| 491 | * @namespace |
| 492 | */ |
| 493 | this.meta.code = this.meta.code || {}; |
| 494 | if (meta.id) { this.meta.code.id = meta.id; } |
| 495 | if (meta.code) { |
| 496 | if (meta.code.name) { |
| 497 | /** |
| 498 | * The name of the symbol in the source code. |
| 499 | * @type {string} |
| 500 | */ |
| 501 | this.meta.code.name = meta.code.name; |
| 502 | } |
| 503 | if (meta.code.type) { |
| 504 | /** |
| 505 | * The type of the symbol in the source code. |
| 506 | * @type {string} |