From 5a0be42006603944559130e5f4b85f49d9e23420 Mon Sep 17 00:00:00 2001 From: Emil Tholin Date: Tue, 30 Apr 2019 01:08:27 +0200 Subject: [PATCH] Remove the scope key from props when calculating spread --- src/internal/spread.js | 4 ++-- .../component-slot-spread-props/Nested.svelte | 4 ++++ .../component-slot-spread-props/_config.js | 19 +++++++++++++++++++ .../component-slot-spread-props/main.svelte | 8 ++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 test/runtime/samples/component-slot-spread-props/Nested.svelte create mode 100644 test/runtime/samples/component-slot-spread-props/_config.js create mode 100644 test/runtime/samples/component-slot-spread-props/main.svelte diff --git a/src/internal/spread.js b/src/internal/spread.js index 2b4c8c42d5..0075c947cd 100644 --- a/src/internal/spread.js +++ b/src/internal/spread.js @@ -2,7 +2,7 @@ export function get_spread_update(levels, updates) { const update = {}; const to_null_out = {}; - const accounted_for = {}; + const accounted_for = { $$scope: 1 }; let i = levels.length; while (i--) { @@ -34,4 +34,4 @@ export function get_spread_update(levels, updates) { } return update; -} \ No newline at end of file +} diff --git a/test/runtime/samples/component-slot-spread-props/Nested.svelte b/test/runtime/samples/component-slot-spread-props/Nested.svelte new file mode 100644 index 0000000000..08fb4697a9 --- /dev/null +++ b/test/runtime/samples/component-slot-spread-props/Nested.svelte @@ -0,0 +1,4 @@ +
+ +
+
diff --git a/test/runtime/samples/component-slot-spread-props/_config.js b/test/runtime/samples/component-slot-spread-props/_config.js new file mode 100644 index 0000000000..042bdca6ec --- /dev/null +++ b/test/runtime/samples/component-slot-spread-props/_config.js @@ -0,0 +1,19 @@ +export default { + html: ` +
+ +
+
+ `, + + async test({ assert, component, target }) { + component.value = 'foo'; + + assert.htmlEqual(target.innerHTML, ` +
+ +
+
+ `); + } +}; diff --git a/test/runtime/samples/component-slot-spread-props/main.svelte b/test/runtime/samples/component-slot-spread-props/main.svelte new file mode 100644 index 0000000000..69d1269217 --- /dev/null +++ b/test/runtime/samples/component-slot-spread-props/main.svelte @@ -0,0 +1,8 @@ + + + + +