decaffeinate-parser
Version:
A better AST for CoffeeScript, inspired by CoffeeScriptRedux.
32 lines (31 loc) • 1.44 kB
JavaScript
;
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 __());
};
})();
exports.__esModule = true;
var util_1 = require("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: " + util_1.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));
exports["default"] = UnsupportedNodeError;