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); slot_template.attributes.push(attribute);
} }
} }
children.push(slot_template); children.push(slot_template);
info.children.splice(i, 1); info.children.splice(i, 1);
} }
} }
if (info.children.some(node => not_whitespace_text(node))) { if (info.children.some(node => not_whitespace_text(node))) {
children.push({ children.push({
start: info.start, start: info.start,
end: info.end, end: info.end,
type: 'SlotTemplate', type: 'SlotTemplate',
name: 'svelte:fragment', name: 'svelte:fragment',
attributes: [], attributes: [],
children: info.children children: info.children

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

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

Loading…
Cancel
Save