MCPcopy
hub / github.com/jquery/esprima / constructError

Method constructError

src/error-handler.ts:34–47  ·  view source on GitHub ↗
(msg: string, column: number)

Source from the content-addressed store, hash-verified

32 }
33
34 constructError(msg: string, column: number): Error {
35 let error = new Error(msg);
36 try {
37 throw error;
38 } catch (base) {
39 /* istanbul ignore else */
40 if (Object.create && Object.defineProperty) {
41 error = Object.create(base);
42 Object.defineProperty(error, 'column', { value: column });
43 }
44 }
45 /* istanbul ignore next */
46 return error;
47 }
48
49 createError(index: number, line: number, col: number, description: string): Error {
50 const msg = 'Line ' + line + ': ' + description;

Callers 1

createErrorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected