diff --git a/src/parse/state/tag.ts b/src/parse/state/tag.ts index c34f3d5d2a..028e73e7ad 100644 --- a/src/parse/state/tag.ts +++ b/src/parse/state/tag.ts @@ -232,7 +232,8 @@ export default function tag(parser: Parser) { const special = specials.get(name); parser.eat('>', true); - parser[special.property].push(special.read(parser, start, element.attributes)); + const content = special.read(parser, start, element.attributes); + if (content) parser[special.property].push(content); return; } diff --git a/test/js/samples/bind-width-height/expected.js b/test/js/samples/bind-width-height/expected.js index b57e895541..99308fdca1 100644 --- a/test/js/samples/bind-width-height/expected.js +++ b/test/js/samples/bind-width-height/expected.js @@ -47,6 +47,11 @@ function define($$self, $$props, $$make_dirty) { } $$self.$$.get = () => ({ w, h, div_resize_handler }); + + $$self.$$.set = $$props => { + if ('w' in $$props) w = $$props.w; + if ('h' in $$props) h = $$props.h; + }; } class SvelteComponent extends SvelteComponent_1 { diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index 5487b2d0b2..83ca52634a 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -58,7 +58,6 @@ function create_fragment(component, ctx) { } function define($$self, $$props, $$make_dirty) { - // TODO some of these are read-only... let { buffered, seekable, played, currentTime, duration, paused, volume } = $$props; function audio_timeupdate_handler() { diff --git a/test/parser/samples/script-comment-only/output.json b/test/parser/samples/script-comment-only/output.json index badcce4de9..5e18e97e74 100644 --- a/test/parser/samples/script-comment-only/output.json +++ b/test/parser/samples/script-comment-only/output.json @@ -21,7 +21,5 @@ ] }, "css": [], - "js": [ - null - ] + "js": [] } \ No newline at end of file