From 68bc5ee8b565dca792d196184d4396530813ecc8 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sat, 2 Mar 2019 18:07:15 -0500 Subject: [PATCH] refactor message stuff --- .../components/Repl/Input/ModuleEditor.svelte | 49 +----------- site/src/components/Repl/Message.svelte | 80 +++++++++++++++++++ site/src/components/Repl/Output/Viewer.svelte | 46 ++++------- site/src/components/Repl/Output/index.svelte | 17 ++-- site/src/components/Repl/SplitPane.svelte | 1 + site/src/components/Repl/index.svelte | 42 ---------- 6 files changed, 106 insertions(+), 129 deletions(-) create mode 100644 site/src/components/Repl/Message.svelte diff --git a/site/src/components/Repl/Input/ModuleEditor.svelte b/site/src/components/Repl/Input/ModuleEditor.svelte index a3e66c0f7a..e7a9dc9059 100644 --- a/site/src/components/Repl/Input/ModuleEditor.svelte +++ b/site/src/components/Repl/Input/ModuleEditor.svelte @@ -1,6 +1,7 @@ + + + +
+ {#if details} +

{message(details)}

+ {:else} + + {/if} +
\ No newline at end of file diff --git a/site/src/components/Repl/Output/Viewer.svelte b/site/src/components/Repl/Output/Viewer.svelte index 010600e5b0..b9b0e60070 100644 --- a/site/src/components/Repl/Output/Viewer.svelte +++ b/site/src/components/Repl/Output/Viewer.svelte @@ -2,6 +2,7 @@ import { onMount, createEventDispatcher, getContext } from 'svelte'; import getLocationFromStack from './getLocationFromStack.js'; import ReplProxy from './replProxy.js'; + import Message from '../Message.svelte'; import { decode } from 'sourcemap-codec'; const dispatch = createEventDispatcher(); @@ -100,7 +101,7 @@ const loc = getLocationFromStack(e.stack, $bundle.ssr.map); if (loc) { e.filename = loc.source; - e.loc = { line: loc.line, column: loc.column }; + e.start = { line: loc.line, column: loc.column }; } error = e; @@ -197,8 +198,10 @@