diff --git a/src/compiler/compile/nodes/shared/Context.ts b/src/compiler/compile/nodes/shared/Context.ts index 2338f76678..fb2b6a6318 100644 --- a/src/compiler/compile/nodes/shared/Context.ts +++ b/src/compiler/compile/nodes/shared/Context.ts @@ -194,7 +194,7 @@ export function unpack_destructuring({ number_of_computed_props }); } - } + } }); } } diff --git a/test/runtime/samples/const-tag-await-then-destructuring-computed-props/_config.js b/test/runtime/samples/const-tag-await-then-destructuring-computed-props/_config.js index ef1c60c66c..9ec4a3e3e6 100644 --- a/test/runtime/samples/const-tag-await-then-destructuring-computed-props/_config.js +++ b/test/runtime/samples/const-tag-await-then-destructuring-computed-props/_config.js @@ -1,20 +1,20 @@ export default { html: ` -

4, 12, 60

- `, +

4, 12, 60

+ `, 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, ` -

2, 11, 2

-

9506, 28811, 98

+

2, 11, 2

+

9506, 28811, 98

`); } }; diff --git a/test/runtime/samples/const-tag-await-then-destructuring-computed-props/main.svelte b/test/runtime/samples/const-tag-await-then-destructuring-computed-props/main.svelte index 536f4a509a..fbc54e4d0b 100644 --- a/test/runtime/samples/const-tag-await-then-destructuring-computed-props/main.svelte +++ b/test/runtime/samples/const-tag-await-then-destructuring-computed-props/main.svelte @@ -1,25 +1,25 @@ {#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) } -

{first}, {second}, {third}

+

{first}, {second}, {third}

{/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) } -

{first}, {second}, {third}

+

{first}, {second}, {third}

{/await} diff --git a/test/runtime/samples/const-tag-each-destructure-computed-props/_config.js b/test/runtime/samples/const-tag-each-destructure-computed-props/_config.js index 87aac12083..c299f19da6 100644 --- a/test/runtime/samples/const-tag-each-destructure-computed-props/_config.js +++ b/test/runtime/samples/const-tag-each-destructure-computed-props/_config.js @@ -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, - '' - ); + assert.htmlEqual(target.innerHTML, + '' + ); } }; diff --git a/test/runtime/samples/const-tag-each-destructure-computed-props/main.svelte b/test/runtime/samples/const-tag-each-destructure-computed-props/main.svelte index f45674044e..c8c7e1977a 100644 --- a/test/runtime/samples/const-tag-each-destructure-computed-props/main.svelte +++ b/test/runtime/samples/const-tag-each-destructure-computed-props/main.svelte @@ -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'; {#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)} {/each} diff --git a/test/runtime/samples/each-block-destructured-array-computed-props/_config.js b/test/runtime/samples/each-block-destructured-array-computed-props/_config.js index bc5fe12539..e400e2f280 100644 --- a/test/runtime/samples/each-block-destructured-array-computed-props/_config.js +++ b/test/runtime/samples/each-block-destructured-array-computed-props/_config.js @@ -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] ] }, diff --git a/test/runtime/samples/each-block-destructured-object-computed-props/_config.js b/test/runtime/samples/each-block-destructured-object-computed-props/_config.js index 7bd1a7edbe..7e98fab913 100644 --- a/test/runtime/samples/each-block-destructured-object-computed-props/_config.js +++ b/test/runtime/samples/each-block-destructured-object-computed-props/_config.js @@ -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' } ] }, diff --git a/test/runtime/samples/each-block-destructured-object-computed-props/main.svelte b/test/runtime/samples/each-block-destructured-object-computed-props/main.svelte index a99fe6401f..9c2ae29617 100644 --- a/test/runtime/samples/each-block-destructured-object-computed-props/main.svelte +++ b/test/runtime/samples/each-block-destructured-object-computed-props/main.svelte @@ -1,7 +1,7 @@ {#each objectsArray as { [firstString]: firstProp, [secondString]: secondProp, [firstString.split('').reverse().join('')]: reverseFirst, [secondString.toUpperCase()]: upperSecond } }