diff --git a/src/Core__Error.mjs b/src/Core__Error.mjs index e5334cf8..5c9e853f 100644 --- a/src/Core__Error.mjs +++ b/src/Core__Error.mjs @@ -14,7 +14,7 @@ var $$TypeError = {}; var $$URIError = {}; function panic(msg) { - throw new Error("Panic! " + msg); + throw new Error("Panic! " + msg + ""); } export { diff --git a/src/Core__Error.res b/src/Core__Error.res index 788e0bdb..408b08ff 100644 --- a/src/Core__Error.res +++ b/src/Core__Error.res @@ -36,4 +36,4 @@ module URIError = { external raise: t => 'a = "%raise" -let panic = msg => make(j`Panic! $msg`)->raise +let panic = msg => make(`Panic! ${msg}`)->raise diff --git a/test/Test.mjs b/test/Test.mjs index 3dffa8f0..2c881291 100644 --- a/test/Test.mjs +++ b/test/Test.mjs @@ -58,7 +58,7 @@ function run(loc, left, comparator, right) { }, { highlightCode: true }); - var errorMessage = "\n \u001b[31mTest Failure!\n \u001b[36m" + file + "\u001b[0m:\u001b[2m" + line + "\n" + codeFrame + "\n \u001b[39mLeft: \u001b[31m" + left$1 + "\n \u001b[39mRight: \u001b[31m" + right$1 + "\u001b[0m\n"; + var errorMessage = "\n \u001b[31mTest Failure!\n \u001b[36m" + file + "\u001b[0m:\u001b[2m" + String(line) + "\n" + codeFrame + "\n \u001b[39mLeft: \u001b[31m" + left$1 + "\n \u001b[39mRight: \u001b[31m" + right$1 + "\u001b[0m\n"; console.log(errorMessage); var obj = {}; Error.captureStackTrace(obj); diff --git a/test/Test.res b/test/Test.res index 8a7c325f..9c4b0f5b 100644 --- a/test/Test.res +++ b/test/Test.res @@ -53,12 +53,12 @@ let run = (loc, left, comparator, right) => { {"start": {"line": line}}, {"highlightCode": true}, ) - let errorMessage = j` + let errorMessage = ` \u001b[31mTest Failure! - \u001b[36m$file\u001b[0m:\u001b[2m$line -$codeFrame - \u001b[39mLeft: \u001b[31m$left - \u001b[39mRight: \u001b[31m$right\u001b[0m + \u001b[36m${file}\u001b[0m:\u001b[2m${string_of_int(line)} +${codeFrame} + \u001b[39mLeft: \u001b[31m${left} + \u001b[39mRight: \u001b[31m${right}\u001b[0m ` Console.log(errorMessage) // API: https://nodejs.org/api/errors.html#errors_error_capturestacktrace_targetobject_constructoropt