Skip to content

Commit

Permalink
revert formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 committed Jun 18, 2024
1 parent 5a484df commit 8fb005b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/jsx-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function parseJsxElement(element, moduleContents = '') {
if (expression.property.type === 'Identifier') {
// we leave markers for `this` so we can replace it later while also NOT accidentally replacing
// legitimate uses of this that might be actual content / markup of the custom element
string += ` ${name}='__this__.${expression.property.name}()'`;
string += ` ${name}="__this__.${expression.property.name}()"`;
}
}
}
Expand All @@ -110,7 +110,7 @@ function parseJsxElement(element, moduleContents = '') {
if (expression.type === 'ArrowFunctionExpression') {
if (expression.body && expression.body.type === 'CallExpression') {
const { start, end } = expression;
string += ` ${name}='${moduleContents.slice(start, end).replace(/this./g, '__this__.').replace('() => ', '')}'`;
string += ` ${name}="${moduleContents.slice(start, end).replace(/this./g, '__this__.').replace('() => ', '')}"`;
}
}

Expand All @@ -120,7 +120,7 @@ function parseJsxElement(element, moduleContents = '') {
if (left.object.type === 'ThisExpression') {
if (left.property.type === 'Identifier') {
// very naive (fine grained?) reactivity
string += ` ${name}='__this__.${left.property.name}${expression.operator}${right.raw}; __this__.render();'`;
string += ` ${name}="__this__.${left.property.name}${expression.operator}${right.raw}; __this__.render();"`;
}
}
}
Expand All @@ -130,8 +130,8 @@ function parseJsxElement(element, moduleContents = '') {
// Can all these be parsed using one function>
if (attribute.value) {
if (attribute.value.type === 'Literal') {
// xxx='yyy' >
string += ` ${name}='${attribute.value.value}'`;
// xxx="yyy" >
string += ` ${name}="${attribute.value.value}"`;
} else if (attribute.value.type === 'JSXExpressionContainer') {
// xxx={allTodos.length} >
const { value } = attribute;
Expand Down

0 comments on commit 8fb005b

Please sign in to comment.