Skip to content

Commit

Permalink
Merge pull request #3817 from sveltejs/revert-3812-tanhauhau/remove-e…
Browse files Browse the repository at this point in the history
…mpty-value-declaration

Revert "remove empty value declaration from style tree"
  • Loading branch information
Rich-Harris authored Oct 28, 2019
2 parents b6f4c23 + b59c942 commit f849408
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 21 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"eslint": "^6.3.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-svelte3": "^2.7.3",
"estree-walker": "^0.9.0",
"estree-walker": "^0.8.1",
"is-reference": "^1.1.4",
"jsdom": "^15.1.1",
"kleur": "^3.0.3",
Expand Down
6 changes: 1 addition & 5 deletions src/compiler/parse/read/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function read_style(parser: Parser, start: number, attributes: No

// tidy up AST
walk(ast, {
enter(node: any) { // `any` because this isn't an ESTree node
enter: (node: any) => { // `any` because this isn't an ESTree node
// replace `ref:a` nodes
if (node.type === 'Selector') {
for (let i = 0; i < node.children.length; i += 1) {
Expand All @@ -47,10 +47,6 @@ export default function read_style(parser: Parser, start: number, attributes: No
}
}

if (node.type === 'Declaration' && node.value.type === 'Value' && node.value.children.length === 0) {
this.remove();
}

if (node.loc) {
node.start = node.loc.start.offset;
node.end = node.loc.end.offset;
Expand Down
1 change: 0 additions & 1 deletion test/css/samples/empty-value/expected.css

This file was deleted.

11 changes: 0 additions & 11 deletions test/css/samples/empty-value/input.svelte

This file was deleted.

0 comments on commit f849408

Please sign in to comment.