Fix some formatting and indenting inconsistiencies

pull/8386/head
Nguyen Tran 4 years ago
parent 8b2ad778f1
commit 3eb16eba24

@ -194,7 +194,7 @@ export function unpack_destructuring({
number_of_computed_props
});
}
}
}
});
}
}

@ -1,20 +1,20 @@
export default {
html: `
<p>4, 12, 60</p>
`,
<p>4, 12, 60</p>
`,
async test({ component, target, assert }) {
component.permutation = [2, 3, 1];
component.permutation = [2, 3, 1];
await (component.promise1 = Promise.resolve({length: 1, width: 2, height: 3}));
try {
await (component.promise2 = Promise.reject({length: 97, width: 98, height: 99}));
} catch (e) {
// nothing
}
try {
await (component.promise2 = Promise.reject({length: 97, width: 98, height: 99}));
} catch (e) {
// nothing
}
assert.htmlEqual(target.innerHTML, `
<p>2, 11, 2</p>
<p>9506, 28811, 98</p>
<p>2, 11, 2</p>
<p>9506, 28811, 98</p>
`);
}
};

@ -1,25 +1,25 @@
<script>
export let promise1 = {length: 5, width: 3, height: 4};
export let promise2 = {length: 12, width: 5, height: 13};
export let permutation = [1, 2, 3];
export let permutation = [1, 2, 3];
function calculate(length, width, height) {
function calculate(length, width, height) {
return {
'1-Dimensions': [length, width, height],
'2-Dimensions': [length * width, width * height, length * height],
'3-Dimensions': [length * width * height, length + width + height, length * width + width * height + length * height]
};
'1-Dimensions': [length, width, height],
'2-Dimensions': [length * width, width * height, length * height],
'3-Dimensions': [length * width * height, length + width + height, length * width + width * height + length * height]
};
}
</script>
{#await promise1 then { length, width, height }}
{@const [a, b, c] = permutation}
{@const [a, b, c] = permutation}
{@const { [`${a}-Dimensions`]: { [c - 1]: first }, [`${b}-Dimensions`]: { [b - 1]: second }, [`${c}-Dimensions`]: { [a - 1]: third } } = calculate(length, width, height) }
<p>{first}, {second}, {third}</p>
<p>{first}, {second}, {third}</p>
{/await}
{#await promise2 catch { length, width, height }}
{@const [a, b, c] = permutation}
{@const [a, b, c] = permutation}
{@const { [`${a}-Dimensions`]: { [c - 1]: first }, [`${b}-Dimensions`]: { [b - 1]: second }, [`${c}-Dimensions`]: { [a - 1]: third } } = calculate(length, width, height) }
<p>{first}, {second}, {third}</p>
<p>{first}, {second}, {third}</p>
{/await}

@ -6,10 +6,10 @@ export default {
`,
async test({ component, target, assert }) {
component.boxes = [{ length: 10, width: 20, height: 30 }];
component.boxes = [{ length: 10, width: 20, height: 30 }];
assert.htmlEqual(target.innerHTML,
'<button>200, 600, 300, 6000</button>'
);
assert.htmlEqual(target.innerHTML,
'<button>200, 600, 300, 6000</button>'
);
}
};

@ -7,36 +7,36 @@
function calculate(length, width, height) {
return {
twoDimensions: {
bottomArea: length * width,
sideArea1: width * height,
sideArea2: length * height
},
threeDimensions: {
volume: length * width * height
}
};
twoDimensions: {
bottomArea: length * width,
sideArea1: width * height,
sideArea2: length * height
},
threeDimensions: {
volume: length * width * height
}
};
}
export let dimension = 'Dimensions';
function changeDimension() {
dimension = 'DIMENSIONS';
}
export let dimension = 'Dimensions';
function changeDimension() {
dimension = 'DIMENSIONS';
}
let area = 'Area';
let area = 'Area';
</script>
{#each boxes as { length, width, height }}
{@const {
[`two${dimension}`]: {
i = 1,
[`bottom${area}`]: bottom,
[`side${area}${i++}`]: sideone,
[`side${area}${i++}`]: sidetwo
},
[`three${dimension}`]: {
volume
}
} = calculate(length, width, height)}
[`two${dimension}`]: {
i = 1,
[`bottom${area}`]: bottom,
[`side${area}${i++}`]: sideone,
[`side${area}${i++}`]: sidetwo
},
[`three${dimension}`]: {
volume
}
} = calculate(length, width, height)}
<button on:click={changeDimension}>{bottom}, {sideone}, {sidetwo}, {volume}</button>
{/each}

@ -1,10 +1,10 @@
export default {
props: {
array: [
[1, 2, 3, 4, 5],
[6, 7, 8],
[9, 10, 11, 12],
[13, 14, 15, 16, 17, 18, 19, 20, 21, 22]
[1, 2, 3, 4, 5],
[6, 7, 8],
[9, 10, 11, 12],
[13, 14, 15, 16, 17, 18, 19, 20, 21, 22]
]
},

@ -1,11 +1,11 @@
export default {
props: {
firstString: 'cats',
secondString: 'dogs',
firstString: 'cats',
secondString: 'dogs',
objectsArray: [
{ dogs: 'woof', cats: 'meow', stac: 'stack', DOGS: 'WOOF' },
{ dogs: 'A German sheppard', cats: 'A tailless cat', stac: 'A jenga tower', DOGS: 'A GERMAN SHEPPARD' },
{ dogs: 'dogs', cats: 'cats', stac: 'stac', DOGS: 'DOGS' }
{ dogs: 'woof', cats: 'meow', stac: 'stack', DOGS: 'WOOF' },
{ dogs: 'A German sheppard', cats: 'A tailless cat', stac: 'A jenga tower', DOGS: 'A GERMAN SHEPPARD' },
{ dogs: 'dogs', cats: 'cats', stac: 'stac', DOGS: 'DOGS' }
]
},

@ -1,7 +1,7 @@
<script>
export let objectsArray;
export let firstString;
export let secondString;
export let firstString;
export let secondString;
</script>
{#each objectsArray as { [firstString]: firstProp, [secondString]: secondProp, [firstString.split('').reverse().join('')]: reverseFirst, [secondString.toUpperCase()]: upperSecond } }

Loading…
Cancel
Save