UNPKG

792 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const tslib_1 = require("tslib");
4class TaskHandler {
5 constructor(decoratee, id) {
6 this.decoratee = decoratee;
7 this.id = id;
8 }
9 selector(node) {
10 return this.decoratee.selector(node);
11 }
12 run(node, api) {
13 return tslib_1.__awaiter(this, void 0, void 0, function* () {
14 try {
15 return yield this.decoratee.run(node, api);
16 }
17 catch (error) {
18 api.reportError(node.id, error, api.task && api.task.trace);
19 }
20 });
21 }
22}
23exports.TaskHandler = TaskHandler;
24exports.createTaskHandler = (decoratee, id) => {
25 return new TaskHandler(decoratee, id);
26};
27//# sourceMappingURL=taskHandler.js.map
\No newline at end of file