diff --git a/assets/views/layouts/svelte_layout.html b/assets/views/layouts/svelte_layout.html index caf13b9..599f6c6 100644 --- a/assets/views/layouts/svelte_layout.html +++ b/assets/views/layouts/svelte_layout.html @@ -11,9 +11,11 @@ const locals = %locals%; localStore.set((key, args) => { - return locals[args ? + const localKey = args ? `'${key}', \`${args}\`` - : `'${key}'`]; + : `'${key}'`; + // console.debug(localKey + '=' + locals[localKey]) + return locals[localKey]; }); new View({ diff --git a/test/assets/views/AllTests.svelte b/test/assets/views/AllTests.svelte new file mode 100644 index 0000000..caafcaf --- /dev/null +++ b/test/assets/views/AllTests.svelte @@ -0,0 +1,34 @@ + + + + +
Name | +Expected value | +Actual value | +
---|
Simple dep test
-\$locals.
-\$locals.
- -$locals: {$locals}
-\$locals.route: {$locals.route}
{$locals.dump(typeof $locals.route)}
\$locals.dump: {$locals.dump('bonjour')}
-\$locals.dump: {$locals.dump($locals.app)}
-\$locals.dump: {$locals.dump(NaN)}
-\$locals.route: {$locals.route('auth')}
-\$locals.route: {$locals.route('home')}
diff --git a/test/assets/views/home_test.svelte b/test/assets/views/home_test.svelte deleted file mode 100644 index b54040a..0000000 --- a/test/assets/views/home_test.svelte +++ /dev/null @@ -1,61 +0,0 @@ - - - - -Direct access: {$locals.direct}
- -{#if $locals.route('auth') === '/'} - We're home! -{:else} - We're somewhere else... {$locals.route('auth')} -{/if} - -The route to auth is {$locals.route('auth')}
- -\$locals.notcode
- -{`{\\$locals.escaped}`}
- -Blue!
-Dependency test: {depTest}