pull/17124/head
Elliott Johnson 2 weeks ago
parent d6f240a949
commit 7d0451e9f7

@ -645,9 +645,9 @@ export class Renderer {
/** @param {[string, unknown][]} serialized */ /** @param {[string, unknown][]} serialized */
static #hydratable_block(serialized) { static #hydratable_block(serialized) {
let entries = ''; let entries = [];
for (const [k, v] of serialized) { for (const [k, v] of serialized) {
entries += `["${k}",${v}],`; entries.push(`["${k}",${v}]`);
} }
// TODO csp? // TODO csp?
// TODO how can we communicate this error better? Is there a way to not just send it to the console? // TODO how can we communicate this error better? Is there a way to not just send it to the console?
@ -655,7 +655,7 @@ export class Renderer {
return ` return `
<script> <script>
var store = (window.__svelte ??= {}).h ??= new Map(); var store = (window.__svelte ??= {}).h ??= new Map();
for (const [k,v] of ${entries}) { for (const [k,v] of [${entries.join(',')}]) {
store.set(k, v); store.set(k, v);
} }
</script>`; </script>`;

Loading…
Cancel
Save