mirror of https://github.com/sveltejs/svelte
parent
662ee1ec5d
commit
bbb5db1ef9
@ -1,5 +1,8 @@
|
||||
import * as $ from 'svelte/internal/server';
|
||||
|
||||
export default function Bind_this($$payload) {
|
||||
const $$cleanup = $.setup($$payload);
|
||||
|
||||
Foo($$payload, {});
|
||||
$$cleanup($$payload);
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
import * as $ from 'svelte/internal/server';
|
||||
|
||||
export default function Main($$payload) {
|
||||
const $$cleanup = $.setup($$payload);
|
||||
// needs to be a snapshot test because jsdom does auto-correct the attribute casing
|
||||
let x = 'test';
|
||||
let y = () => 'test';
|
||||
|
||||
$$payload.out += `<div${$.attr('foobar', x)}></div> <svg${$.attr('viewBox', x)}></svg> <custom-element${$.attr('foobar', x)}></custom-element> <div${$.attr('foobar', y())}></div> <svg${$.attr('viewBox', y())}></svg> <custom-element${$.attr('foobar', y())}></custom-element>`;
|
||||
$$cleanup($$payload);
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
import * as $ from 'svelte/internal/server';
|
||||
|
||||
export default function Hello_world($$payload) {
|
||||
const $$cleanup = $.setup($$payload);
|
||||
|
||||
$$payload.out += `<h1>hello world</h1>`;
|
||||
$$cleanup($$payload);
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
import * as $ from 'svelte/internal/server';
|
||||
|
||||
export default function Hmr($$payload) {
|
||||
const $$cleanup = $.setup($$payload);
|
||||
|
||||
$$payload.out += `<h1>hello world</h1>`;
|
||||
$$cleanup($$payload);
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
import * as $ from 'svelte/internal/server';
|
||||
|
||||
export default function Nullish_coallescence_omittance($$payload) {
|
||||
const $$cleanup = $.setup($$payload);
|
||||
let name = 'world';
|
||||
let count = 0;
|
||||
|
||||
$$payload.out += `<h1>Hello, ${$.escape(name)}!</h1> <b>${$.escape(1 ?? 'stuff')}${$.escape(2 ?? 'more stuff')}${$.escape(3 ?? 'even more stuff')}</b> <button>Count is ${$.escape(count)}</button> <h1>Hello, ${$.escape(name ?? 'earth' ?? null)}</h1>`;
|
||||
$$cleanup($$payload);
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
import * as $ from 'svelte/internal/server';
|
||||
|
||||
export default function Purity($$payload) {
|
||||
const $$cleanup = $.setup($$payload);
|
||||
|
||||
$$payload.out += `<p>${$.escape(Math.max(0, Math.min(0, 100)))}</p> <p>${$.escape(location.href)}</p> `;
|
||||
Child($$payload, { prop: encodeURIComponent('hello') });
|
||||
$$payload.out += `<!---->`;
|
||||
$$cleanup($$payload);
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
import * as $ from 'svelte/internal/server';
|
||||
|
||||
export default function Skip_static_subtree($$payload, $$props) {
|
||||
const $$cleanup = $.setup($$payload);
|
||||
let { title, content } = $$props;
|
||||
|
||||
$$payload.out += `<header><nav><a href="/">Home</a> <a href="/away">Away</a></nav></header> <main><h1>${$.escape(title)}</h1> <div class="static"><p>we don't need to traverse these nodes</p></div> <p>or</p> <p>these</p> <p>ones</p> ${$.html(content)} <p>these</p> <p>trailing</p> <p>nodes</p> <p>can</p> <p>be</p> <p>completely</p> <p>ignored</p></main> <cant-skip><custom-elements with="attributes"></custom-elements></cant-skip> <div><input autofocus></div> <div><source muted></div> <select><option value="a">a</option></select> <img src="..." alt="" loading="lazy"> <div><img src="..." alt="" loading="lazy"></div>`;
|
||||
$$cleanup($$payload);
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
import * as $ from 'svelte/internal/server';
|
||||
|
||||
export default function Svelte_element($$payload, $$props) {
|
||||
const $$cleanup = $.setup($$payload);
|
||||
let { tag = 'hr' } = $$props;
|
||||
|
||||
$.element($$payload, tag);
|
||||
$$cleanup($$payload);
|
||||
}
|
Loading…
Reference in new issue