UNPKG

decaffeinate-parser

Version:

A better AST for CoffeeScript, inspired by CoffeeScriptRedux.

12 lines (11 loc) 744 B
"use strict"; exports.__esModule = true; var nodes_1 = require("../nodes"); var getLocation_1 = require("../util/getLocation"); var mapAny_1 = require("./mapAny"); var mapPossiblyEmptyBlock_1 = require("./mapPossiblyEmptyBlock"); function mapTry(context, node) { var _a = getLocation_1["default"](context, node), line = _a.line, column = _a.column, start = _a.start, end = _a.end, raw = _a.raw; return new nodes_1.Try(line, column, start, end, raw, mapPossiblyEmptyBlock_1["default"](context, node.attempt), node.errorVariable ? mapAny_1["default"](context, node.errorVariable) : null, mapPossiblyEmptyBlock_1["default"](context, node.recovery), mapPossiblyEmptyBlock_1["default"](context, node.ensure)); } exports["default"] = mapTry;