syntaxError.js 327 B

12345678910111213141516
  1. export class SyntaxError extends Error {
  2. constructor (msg, id) {
  3. super(...msg);
  4. this.id = id;
  5. this._context = {};
  6. if (Error.captureStackTrace) Error.captureStackTrace(this, SyntaxError);
  7. }
  8. get context () {
  9. return this._context;
  10. }
  11. set context (contextObj) {
  12. this._context = contextObj;
  13. }
  14. }