MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / get_diagnostic

Function get_diagnostic

shared/assert.ts:33–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31// assert_type(x, class, message?, extra_info...?)
32
33function get_diagnostic() {
34 const e = new Error();
35 const trace = parse(e);
36 if (trace.length >= 4) {
37 const invoker_frame = trace[3];
38 if (invoker_frame.fileName && invoker_frame.lineNumber) {
39 return {
40 file: invoker_frame.fileName,
41 line: invoker_frame.lineNumber,
42 };
43 }
44 }
45}
46
47function fail(fail_message: string, user_message: string | undefined, args: any[]): never {
48 // Assertions will look like:

Callers 1

failFunction · 0.70

Calls 1

parseFunction · 0.70

Tested by

no test coverage detected