1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const tslib_1 = require("tslib");
|
4 | class 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 | }
|
23 | exports.TaskHandler = TaskHandler;
|
24 | exports.createTaskHandler = (decoratee, id) => {
|
25 | return new TaskHandler(decoratee, id);
|
26 | };
|
27 |
|
\ | No newline at end of file |