report-base.js 362 B

12345678910111213141516
  1. 'use strict';
  2. // TODO: switch to class private field when targetting node.js 12
  3. const _summarizer = Symbol('ReportBase.#summarizer');
  4. class ReportBase {
  5. constructor(opts = {}) {
  6. this[_summarizer] = opts.summarizer;
  7. }
  8. execute(context) {
  9. context.getTree(this[_summarizer]).visit(this, context);
  10. }
  11. }
  12. module.exports = ReportBase;