From f5ff5082f826e7f2c03cc643c45e942c970de987 Mon Sep 17 00:00:00 2001 From: Ryan Turnquist Date: Wed, 25 Sep 2024 16:35:24 -0700 Subject: [PATCH] fix: add frame property to compile errors --- .changeset/nine-kids-divide.md | 6 ++++++ packages/compiler/src/util/build-code-frame.js | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 .changeset/nine-kids-divide.md diff --git a/.changeset/nine-kids-divide.md b/.changeset/nine-kids-divide.md new file mode 100644 index 0000000000..76739d3547 --- /dev/null +++ b/.changeset/nine-kids-divide.md @@ -0,0 +1,6 @@ +--- +"@marko/compiler": patch +"marko": patch +--- + +Add frame property to compile errors diff --git a/packages/compiler/src/util/build-code-frame.js b/packages/compiler/src/util/build-code-frame.js index 503394f6ff..270183314d 100644 --- a/packages/compiler/src/util/build-code-frame.js +++ b/packages/compiler/src/util/build-code-frame.js @@ -34,6 +34,12 @@ class CompileError extends Error { writable: true, configurable: true, }, + frame: { + value: prettyMessage, + enumerable: false, + writable: true, + configurable: true, + }, // Ignore some mutations from Babel. code: { enumerable: false,