Skip to content

Commit

Permalink
fix linting/prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinsjk committed Oct 19, 2023
1 parent f59bf85 commit 8257918
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function invalidate(renderer, scope, node, names, main_execution_context
if (
node.type === 'AssignmentExpression' &&
node.operator === '=' &&
nodes_match(node.left, node.right, ['trailingComments','leadingComments']) &&
nodes_match(node.left, node.right, ['trailingComments', 'leadingComments']) &&
tail.length === 0
) {
return get_invalidated(head, node);
Expand Down
10 changes: 7 additions & 3 deletions packages/svelte/src/compiler/utils/nodes_match.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function nodes_match(a, b, ignoreKeys=[]) {
export function nodes_match(a, b, ignore_keys = []) {
if (!!a !== !!b) return false;
if (Array.isArray(a) !== Array.isArray(b)) return false;

Expand All @@ -8,8 +8,12 @@ export function nodes_match(a, b, ignoreKeys=[]) {
return a.every((child, i) => nodes_match(child, b[i]));
}

const a_keys = Object.keys(a).sort().filter(key => !ignoreKeys.includes(key));
const b_keys = Object.keys(b).sort().filter(key => !ignoreKeys.includes(key));
const a_keys = Object.keys(a)
.sort()
.filter((key) => !ignore_keys.includes(key));
const b_keys = Object.keys(b)
.sort()
.filter((key) => !ignore_keys.includes(key));

if (a_keys.length !== b_keys.length) return false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1 2 3
1 2 3
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
1 <!-- HTML_TAG_START -->2<!-- HTML_TAG_END --> 3
&nbsp;1
<!-- HTML_TAG_START -->2<!-- HTML_TAG_END -->
3
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export default {
async test({ assert, target, window }) {
const incrementButton = target.querySelector('button');
const increment_button = target.querySelector('button');

assert.equal(target.querySelector('#render-count').innerHTML, '1');
await incrementButton.dispatchEvent(new window.MouseEvent('click'));
await increment_button.dispatchEvent(new window.MouseEvent('click'));
assert.equal(target.querySelector('#render-count').innerHTML, '2');
}
};

0 comments on commit 8257918

Please sign in to comment.