From e851630be4d6bed3dc17531bf121eaba386a121a Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Wed, 12 May 2021 13:55:47 +0200 Subject: [PATCH] SvelteViewEngine: update backend calls prefix to $locals (store) --- src/frontend/SvelteViewEngine.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/SvelteViewEngine.ts b/src/frontend/SvelteViewEngine.ts index 6435c2c..b47cadf 100644 --- a/src/frontend/SvelteViewEngine.ts +++ b/src/frontend/SvelteViewEngine.ts @@ -14,7 +14,7 @@ import {logger} from "../Logger.js"; import FileCache from "../utils/FileCache.js"; import ViewEngine from "./ViewEngine.js"; -const BACKEND_CODE_PREFIX = 'locals.'; +const BACKEND_CODE_PREFIX = '$locals.'; const BACKEND_CODE_PREFIX_TEMPORARY_HOLDER = '$$locals$$'; const COMPILED_SVELTE_EXTENSION = '.precompiled'; @@ -250,7 +250,7 @@ export default class SvelteViewEngine extends ViewEngine { backendCalls.add(backendCall); output = output.substring(0, index) + - 'locals(' + backendCall.split(BACKEND_CODE_PREFIX).join(BACKEND_CODE_PREFIX_TEMPORARY_HOLDER) + ')' + + '$locals(' + backendCall.split(BACKEND_CODE_PREFIX).join(BACKEND_CODE_PREFIX_TEMPORARY_HOLDER) + ')' + output.substring(endIndex, output.length); } output = output.split(BACKEND_CODE_PREFIX_TEMPORARY_HOLDER).join(BACKEND_CODE_PREFIX);