Skip to content

Commit

Permalink
Merge pull request #965 from sveltejs/gh-961
Browse files Browse the repository at this point in the history
prevent boolean attributes breaking shapes inside estree-walker
  • Loading branch information
Rich-Harris authored Nov 27, 2017
2 parents 3843261 + f10e86f commit 3264b51
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/generators/Generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,8 @@ function removeIndentation(
// We need to tell estree-walker that it should always
// look for an `else` block, otherwise it might get
// the wrong idea about the shape of each/if blocks
childKeys.EachBlock = [
'children',
'else'
];

childKeys.IfBlock = [
'children',
'else'
];
childKeys.EachBlock = childKeys.IfBlock = ['children', 'else'];
childKeys.Attribute = ['value'];

export default class Generator {
ast: Parsed;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<a href={{href}}>link</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
html: `<a href='/cool'>link</a>`
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Link x href="/cool"/>

<script>
import Link from './Link.html';
export default {
components: {
Link
}
};
</script>

0 comments on commit 3264b51

Please sign in to comment.