MCPcopy Create free account
hub / github.com/babel/babel / constructor

Method constructor

packages/babel-parser/test/helpers/fixture-error.js:13–25  ·  view source on GitHub ↗
(difference, { cause } = {})

Source from the content-addressed store, hash-verified

11
12export default class FixtureError extends Error {
13 constructor(difference, { cause } = {}) {
14 super();
15
16 // Sigh, still have to manually set the name unfortunately...
17 named(this.constructor.name, this);
18
19 this.difference = difference;
20
21 // Set cause ourselves, since node < 17 has a bug where it won't show it
22 // otherwise. Technically, we display it ourselves, but best to be defensive
23 // in case we modify this implementation later.
24 if (cause) this.cause = cause;
25 }
26
27 static toMessage() {
28 return this.constructor.name;

Callers

nothing calls this directly

Calls 1

namedFunction · 0.85

Tested by

no test coverage detected