UNPKG

decaffeinate-parser

Version:

A better AST for CoffeeScript, inspired by CoffeeScriptRedux.

30 lines (29 loc) 1.38 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import { inspect } from 'util'; var UnsupportedNodeError = /** @class */ (function (_super) { __extends(UnsupportedNodeError, _super); function UnsupportedNodeError(node, message) { if (message === void 0) { message = null; } var _this = this; var prefix = message ? message + "\n\n" : ''; _this = _super.call(this, prefix + "node type '" + node.constructor.name + "' is not supported: " + inspect(node)) || this; // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work Object.setPrototypeOf(_this, UnsupportedNodeError.prototype); _this.node = node; return _this; } return UnsupportedNodeError; }(Error)); export default UnsupportedNodeError;