revert useless changes

pull/6898/head
Yuichiro Yamashita 5 years ago
parent e2a36a4a48
commit 75621dc88b

@ -126,17 +126,17 @@ export default class InlineComponent extends Node {
slot_template.attributes.push(attribute);
}
}
children.push(slot_template);
info.children.splice(i, 1);
}
}
if (info.children.some(node => not_whitespace_text(node))) {
children.push({
children.push({
start: info.start,
end: info.end,
type: 'SlotTemplate',
type: 'SlotTemplate',
name: 'svelte:fragment',
attributes: [],
children: info.children

@ -112,6 +112,7 @@ export default class Renderer {
render(nodes: INode[], options: RenderOptions) {
nodes.forEach(node => {
const handler = handlers[node.type];
if (!handler) {
throw new Error(`No handler for '${node.type}' nodes`);
}

@ -102,15 +102,12 @@ export default function tag(parser: Parser) {
}
}
const type = (function () {
if (meta_tags.has(name)) return meta_tags.get(name);
if ((/[A-Z]/.test(name[0]) || name === 'svelte:self' || name === 'svelte:component')) return 'InlineComponent';
if (name === 'svelte:fragment') return 'SlotTemplate';
if (name === 'title' && parent_is_head(parser.stack)) return 'Title';
if (name === 'slot' && !parser.customElement) return 'Slot';
if (name === 'svelte:element') return 'Element';
return 'Element';
})();
const type = meta_tags.has(name)
? meta_tags.get(name)
: (/[A-Z]/.test(name[0]) || name === 'svelte:self' || name === 'svelte:component') ? 'InlineComponent'
: name === 'svelte:fragment' ? 'SlotTemplate'
: name === 'title' && parent_is_head(parser.stack) ? 'Title'
: name === 'slot' && !parser.customElement ? 'Slot' : 'Element';
const element: TemplateNode = {
start,

Loading…
Cancel
Save