missed a few

pull/816/merge
Rich Harris 7 years ago
parent 2c8268bf1c
commit 822f070d7e

@ -102,7 +102,7 @@ export default function visitElement(
if (node._cssRefAttribute) { if (node._cssRefAttribute) {
block.builders.hydrate.addLine( block.builders.hydrate.addLine(
`@setAttribute( ${name}, 'svelte-ref-${node._cssRefAttribute}', '' );` `@setAttribute(${name}, "svelte-ref-${node._cssRefAttribute}", ");`
) )
} }
} }
@ -228,14 +228,14 @@ function getRenderStatement(
name: string name: string
) { ) {
if (namespace === 'http://www.w3.org/2000/svg') { if (namespace === 'http://www.w3.org/2000/svg') {
return `@createSvgElement( '${name}' )`; return `@createSvgElement("${name}")`;
} }
if (namespace) { if (namespace) {
return `document.createElementNS( '${namespace}', '${name}' )`; return `document.createElementNS("${namespace}", "${name}")`;
} }
return `@createElement( '${name}' )`; return `@createElement("${name}")`;
} }
function getClaimStatement( function getClaimStatement(
@ -251,12 +251,12 @@ function getClaimStatement(
const name = namespace ? node.name : node.name.toUpperCase(); const name = namespace ? node.name : node.name.toUpperCase();
return `@claimElement( ${nodes}, '${name}', ${attributes return `@claimElement(${nodes}, "${name}", ${attributes
? `{ ${attributes} }` ? `{ ${attributes} }`
: `{}`}, ${namespace === namespaces.svg ? true : false})`; : `{}`}, ${namespace === namespaces.svg ? true : false})`;
} }
function quoteProp(name: string) { function quoteProp(name: string) {
if (/[^a-zA-Z_$0-9]/.test(name)) return `'${name}'`; if (/[^a-zA-Z_$0-9]/.test(name)) return `"${name}"`;
return name; return name;
} }

Loading…
Cancel
Save