diff --git a/src/compile/nodes/Component.ts b/src/compile/nodes/Component.ts index c5efd25afb..736b2306ea 100644 --- a/src/compile/nodes/Component.ts +++ b/src/compile/nodes/Component.ts @@ -123,7 +123,7 @@ export default class Component extends Node { const name = this.var; - const componentInitProperties = [`root: #component.root`]; + const componentInitProperties = [`root: #component.root`, `store: #component.store`]; if (this.children.length > 0) { const slots = Array.from(this._slots).map(name => `${quoteNameIfNecessary(name)}: @createFragment()`); diff --git a/src/shared/index.js b/src/shared/index.js index c9d901af64..4d0e7896c6 100644 --- a/src/shared/index.js +++ b/src/shared/index.js @@ -64,7 +64,7 @@ export function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } export function on(eventName, handler) { diff --git a/test/cli/samples/basic/expected/Main.js b/test/cli/samples/basic/expected/Main.js index d42218c622..19de3981da 100644 --- a/test/cli/samples/basic/expected/Main.js +++ b/test/cli/samples/basic/expected/Main.js @@ -69,7 +69,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/cli/samples/custom-element/expected/Main.js b/test/cli/samples/custom-element/expected/Main.js index 74c99b1f1d..64981ea826 100644 --- a/test/cli/samples/custom-element/expected/Main.js +++ b/test/cli/samples/custom-element/expected/Main.js @@ -90,7 +90,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/cli/samples/dev/expected/Main.js b/test/cli/samples/dev/expected/Main.js index 664f9ec0b8..3808927235 100644 --- a/test/cli/samples/dev/expected/Main.js +++ b/test/cli/samples/dev/expected/Main.js @@ -93,7 +93,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/cli/samples/dir-sourcemap/expected/Main.js b/test/cli/samples/dir-sourcemap/expected/Main.js index 3d507d9867..85e8e85480 100644 --- a/test/cli/samples/dir-sourcemap/expected/Main.js +++ b/test/cli/samples/dir-sourcemap/expected/Main.js @@ -1,4 +1,4 @@ -/* src/Main.html generated by Svelte vx.y.z */ +/* src/Main.html generated by Svelte v2.7.2 */ import Widget from './Widget.html'; @@ -6,7 +6,8 @@ import Widget from './Widget.html'; function create_main_fragment(component, ctx) { var widget = new Widget({ - root: component.root + root: component.root, + store: component.store }); return { @@ -72,7 +73,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/cli/samples/dir-sourcemap/expected/Main.js.map b/test/cli/samples/dir-sourcemap/expected/Main.js.map index e164b7b845..3177f8b8be 100644 --- a/test/cli/samples/dir-sourcemap/expected/Main.js.map +++ b/test/cli/samples/dir-sourcemap/expected/Main.js.map @@ -1 +1 @@ -{"version":3,"file":"Main.js","sources":["../src/Main.html"],"sourcesContent":["\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"Main.js","sources":["../src/Main.html"],"sourcesContent":["\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/test/cli/samples/dir-sourcemap/expected/Widget.js b/test/cli/samples/dir-sourcemap/expected/Widget.js index 25e36da0dd..47794ea409 100644 --- a/test/cli/samples/dir-sourcemap/expected/Widget.js +++ b/test/cli/samples/dir-sourcemap/expected/Widget.js @@ -1,4 +1,4 @@ -/* src/Widget.html generated by Svelte vx.y.z */ +/* src/Widget.html generated by Svelte v2.7.2 */ function create_main_fragment(component, ctx) { var p; @@ -69,7 +69,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/cli/samples/dir-subdir/expected/Main.js b/test/cli/samples/dir-subdir/expected/Main.js index 73503e2106..a80bf2f976 100644 --- a/test/cli/samples/dir-subdir/expected/Main.js +++ b/test/cli/samples/dir-subdir/expected/Main.js @@ -6,7 +6,8 @@ import Widget from './widget/Widget.html'; function create_main_fragment(component, ctx) { var widget = new Widget({ - root: component.root + root: component.root, + store: component.store }); return { @@ -72,7 +73,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/cli/samples/dir-subdir/expected/widget/Widget.js b/test/cli/samples/dir-subdir/expected/widget/Widget.js index f27a3b1257..974326ad95 100644 --- a/test/cli/samples/dir-subdir/expected/widget/Widget.js +++ b/test/cli/samples/dir-subdir/expected/widget/Widget.js @@ -69,7 +69,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/cli/samples/dir/expected/Main.js b/test/cli/samples/dir/expected/Main.js index 017f054795..edfbe3c67f 100644 --- a/test/cli/samples/dir/expected/Main.js +++ b/test/cli/samples/dir/expected/Main.js @@ -6,7 +6,8 @@ import Widget from './Widget.html'; function create_main_fragment(component, ctx) { var widget = new Widget({ - root: component.root + root: component.root, + store: component.store }); return { @@ -72,7 +73,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/cli/samples/dir/expected/Widget.js b/test/cli/samples/dir/expected/Widget.js index cfc85b0c1c..7bec9ae438 100644 --- a/test/cli/samples/dir/expected/Widget.js +++ b/test/cli/samples/dir/expected/Widget.js @@ -69,7 +69,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/cli/samples/globals/expected/Main.js b/test/cli/samples/globals/expected/Main.js index 357e10b9c4..1a79813b58 100644 --- a/test/cli/samples/globals/expected/Main.js +++ b/test/cli/samples/globals/expected/Main.js @@ -90,7 +90,7 @@ var Main = (function(answer) { "use strict"; component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/cli/samples/sourcemap-inline/expected/Main.js b/test/cli/samples/sourcemap-inline/expected/Main.js index 78bc2da178..de6a8894ce 100644 --- a/test/cli/samples/sourcemap-inline/expected/Main.js +++ b/test/cli/samples/sourcemap-inline/expected/Main.js @@ -69,7 +69,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/cli/samples/sourcemap/expected/Main.js b/test/cli/samples/sourcemap/expected/Main.js index 70c50e76b5..e136e16f48 100644 --- a/test/cli/samples/sourcemap/expected/Main.js +++ b/test/cli/samples/sourcemap/expected/Main.js @@ -69,7 +69,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/cli/samples/store/expected/Main.js b/test/cli/samples/store/expected/Main.js index 0cadb9e366..3f97badad4 100644 --- a/test/cli/samples/store/expected/Main.js +++ b/test/cli/samples/store/expected/Main.js @@ -85,7 +85,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function assign(tar, src) { diff --git a/test/js/samples/action/expected-bundle.js b/test/js/samples/action/expected-bundle.js index fe61c32b09..e1b3e6ce18 100644 --- a/test/js/samples/action/expected-bundle.js +++ b/test/js/samples/action/expected-bundle.js @@ -61,7 +61,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/bind-width-height/expected-bundle.js b/test/js/samples/bind-width-height/expected-bundle.js index e66cc47aaf..8a441a8d3f 100644 --- a/test/js/samples/bind-width-height/expected-bundle.js +++ b/test/js/samples/bind-width-height/expected-bundle.js @@ -93,7 +93,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/collapses-text-around-comments/expected-bundle.js b/test/js/samples/collapses-text-around-comments/expected-bundle.js index 49c9c75813..87f65ba860 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle.js @@ -69,7 +69,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/component-static-array/expected-bundle.js b/test/js/samples/component-static-array/expected-bundle.js index 1fd894e093..5f85c7487a 100644 --- a/test/js/samples/component-static-array/expected-bundle.js +++ b/test/js/samples/component-static-array/expected-bundle.js @@ -49,7 +49,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { @@ -124,6 +124,7 @@ function create_main_fragment(component, ctx) { var nested_initial_data = { foo: [1, 2, 3] }; var nested = new Nested({ root: component.root, + store: component.store, data: nested_initial_data }); diff --git a/test/js/samples/component-static-array/expected.js b/test/js/samples/component-static-array/expected.js index c1dcfea4a7..bae0c850f7 100644 --- a/test/js/samples/component-static-array/expected.js +++ b/test/js/samples/component-static-array/expected.js @@ -8,6 +8,7 @@ function create_main_fragment(component, ctx) { var nested_initial_data = { foo: [1, 2, 3] }; var nested = new Nested({ root: component.root, + store: component.store, data: nested_initial_data }); diff --git a/test/js/samples/component-static-immutable/expected-bundle.js b/test/js/samples/component-static-immutable/expected-bundle.js index dc6d94a1f2..3ebd360b2a 100644 --- a/test/js/samples/component-static-immutable/expected-bundle.js +++ b/test/js/samples/component-static-immutable/expected-bundle.js @@ -53,7 +53,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { @@ -128,6 +128,7 @@ function create_main_fragment(component, ctx) { var nested_initial_data = { foo: "bar" }; var nested = new Nested({ root: component.root, + store: component.store, data: nested_initial_data }); diff --git a/test/js/samples/component-static-immutable/expected.js b/test/js/samples/component-static-immutable/expected.js index 41fe5a349b..f40f060325 100644 --- a/test/js/samples/component-static-immutable/expected.js +++ b/test/js/samples/component-static-immutable/expected.js @@ -8,6 +8,7 @@ function create_main_fragment(component, ctx) { var nested_initial_data = { foo: "bar" }; var nested = new Nested({ root: component.root, + store: component.store, data: nested_initial_data }); diff --git a/test/js/samples/component-static-immutable2/expected-bundle.js b/test/js/samples/component-static-immutable2/expected-bundle.js index dc6d94a1f2..3ebd360b2a 100644 --- a/test/js/samples/component-static-immutable2/expected-bundle.js +++ b/test/js/samples/component-static-immutable2/expected-bundle.js @@ -53,7 +53,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { @@ -128,6 +128,7 @@ function create_main_fragment(component, ctx) { var nested_initial_data = { foo: "bar" }; var nested = new Nested({ root: component.root, + store: component.store, data: nested_initial_data }); diff --git a/test/js/samples/component-static-immutable2/expected.js b/test/js/samples/component-static-immutable2/expected.js index 41fe5a349b..f40f060325 100644 --- a/test/js/samples/component-static-immutable2/expected.js +++ b/test/js/samples/component-static-immutable2/expected.js @@ -8,6 +8,7 @@ function create_main_fragment(component, ctx) { var nested_initial_data = { foo: "bar" }; var nested = new Nested({ root: component.root, + store: component.store, data: nested_initial_data }); diff --git a/test/js/samples/component-static/expected-bundle.js b/test/js/samples/component-static/expected-bundle.js index 21c70ae9a7..d2c8280062 100644 --- a/test/js/samples/component-static/expected-bundle.js +++ b/test/js/samples/component-static/expected-bundle.js @@ -49,7 +49,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { @@ -124,6 +124,7 @@ function create_main_fragment(component, ctx) { var nested_initial_data = { foo: "bar" }; var nested = new Nested({ root: component.root, + store: component.store, data: nested_initial_data }); diff --git a/test/js/samples/component-static/expected.js b/test/js/samples/component-static/expected.js index 2318521cf4..1a5631fc58 100644 --- a/test/js/samples/component-static/expected.js +++ b/test/js/samples/component-static/expected.js @@ -8,6 +8,7 @@ function create_main_fragment(component, ctx) { var nested_initial_data = { foo: "bar" }; var nested = new Nested({ root: component.root, + store: component.store, data: nested_initial_data }); diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js index 0e967c7a67..73830ee233 100644 --- a/test/js/samples/computed-collapsed-if/expected-bundle.js +++ b/test/js/samples/computed-collapsed-if/expected-bundle.js @@ -49,7 +49,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/css-media-query/expected-bundle.js b/test/js/samples/css-media-query/expected-bundle.js index b481784118..ff7bdcfcc1 100644 --- a/test/js/samples/css-media-query/expected-bundle.js +++ b/test/js/samples/css-media-query/expected-bundle.js @@ -65,7 +65,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js index c34d69215b..8d9d31dff2 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js @@ -61,7 +61,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/deconflict-builtins/expected-bundle.js b/test/js/samples/deconflict-builtins/expected-bundle.js index 976c71face..c3d9d762b9 100644 --- a/test/js/samples/deconflict-builtins/expected-bundle.js +++ b/test/js/samples/deconflict-builtins/expected-bundle.js @@ -79,7 +79,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/deconflict-globals/expected-bundle.js b/test/js/samples/deconflict-globals/expected-bundle.js index 524d379e88..0d2226d5cb 100644 --- a/test/js/samples/deconflict-globals/expected-bundle.js +++ b/test/js/samples/deconflict-globals/expected-bundle.js @@ -54,7 +54,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js b/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js index b26570734c..3b9a92c90e 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js @@ -82,7 +82,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/do-use-dataset/expected-bundle.js b/test/js/samples/do-use-dataset/expected-bundle.js index 7eac008dbe..10c7600975 100644 --- a/test/js/samples/do-use-dataset/expected-bundle.js +++ b/test/js/samples/do-use-dataset/expected-bundle.js @@ -65,7 +65,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js index 93fbd587cf..4a963e3300 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js +++ b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js @@ -69,7 +69,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js b/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js index 349eff3f4d..5b1827344d 100644 --- a/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js +++ b/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js @@ -69,7 +69,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/each-block-changed-check/expected-bundle.js b/test/js/samples/each-block-changed-check/expected-bundle.js index b06f8662f9..02db1ce829 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -81,7 +81,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/each-block-keyed-animated/expected-bundle.js b/test/js/samples/each-block-keyed-animated/expected-bundle.js index 54876c6152..9989c77978 100644 --- a/test/js/samples/each-block-keyed-animated/expected-bundle.js +++ b/test/js/samples/each-block-keyed-animated/expected-bundle.js @@ -391,7 +391,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/each-block-keyed/expected-bundle.js b/test/js/samples/each-block-keyed/expected-bundle.js index 89f1655008..09f61a6d3e 100644 --- a/test/js/samples/each-block-keyed/expected-bundle.js +++ b/test/js/samples/each-block-keyed/expected-bundle.js @@ -164,7 +164,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index 5e04f88939..78d5d1a005 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -61,7 +61,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/head-no-whitespace/expected-bundle.js b/test/js/samples/head-no-whitespace/expected-bundle.js index f7bbdcc431..d878a85cbf 100644 --- a/test/js/samples/head-no-whitespace/expected-bundle.js +++ b/test/js/samples/head-no-whitespace/expected-bundle.js @@ -61,7 +61,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/if-block-no-update/expected-bundle.js b/test/js/samples/if-block-no-update/expected-bundle.js index 358177436b..f07810c565 100644 --- a/test/js/samples/if-block-no-update/expected-bundle.js +++ b/test/js/samples/if-block-no-update/expected-bundle.js @@ -65,7 +65,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js index 6028d9dfc1..88729b1159 100644 --- a/test/js/samples/if-block-simple/expected-bundle.js +++ b/test/js/samples/if-block-simple/expected-bundle.js @@ -65,7 +65,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js index be92ba9730..37dd300b5d 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js @@ -65,7 +65,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/inline-style-optimized-url/expected-bundle.js b/test/js/samples/inline-style-optimized-url/expected-bundle.js index 439a9b8740..716dac771d 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-url/expected-bundle.js @@ -65,7 +65,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/inline-style-optimized/expected-bundle.js b/test/js/samples/inline-style-optimized/expected-bundle.js index a5a474d08f..817462d0bd 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle.js +++ b/test/js/samples/inline-style-optimized/expected-bundle.js @@ -65,7 +65,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle.js b/test/js/samples/inline-style-unoptimized/expected-bundle.js index f9611d370a..a378c2f4a6 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle.js +++ b/test/js/samples/inline-style-unoptimized/expected-bundle.js @@ -65,7 +65,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/input-range/expected-bundle.js b/test/js/samples/input-range/expected-bundle.js index 61560074dc..108fc37a01 100644 --- a/test/js/samples/input-range/expected-bundle.js +++ b/test/js/samples/input-range/expected-bundle.js @@ -77,7 +77,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/input-without-blowback-guard/expected-bundle.js b/test/js/samples/input-without-blowback-guard/expected-bundle.js index 9a0998ed9a..e3fb0c60a4 100644 --- a/test/js/samples/input-without-blowback-guard/expected-bundle.js +++ b/test/js/samples/input-without-blowback-guard/expected-bundle.js @@ -73,7 +73,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/legacy-input-type/expected-bundle.js b/test/js/samples/legacy-input-type/expected-bundle.js index 41701a0b41..e1d6f84a8f 100644 --- a/test/js/samples/legacy-input-type/expected-bundle.js +++ b/test/js/samples/legacy-input-type/expected-bundle.js @@ -67,7 +67,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/media-bindings/expected-bundle.js b/test/js/samples/media-bindings/expected-bundle.js index 151a26f603..fd83ed3c68 100644 --- a/test/js/samples/media-bindings/expected-bundle.js +++ b/test/js/samples/media-bindings/expected-bundle.js @@ -77,7 +77,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js index 0cfeadbd9d..345d98d16e 100644 --- a/test/js/samples/non-imported-component/expected-bundle.js +++ b/test/js/samples/non-imported-component/expected-bundle.js @@ -63,7 +63,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { @@ -137,11 +137,13 @@ function create_main_fragment(component, ctx) { var text; var imported = new Imported({ - root: component.root + root: component.root, + store: component.store }); var nonimported = new NonImported({ - root: component.root + root: component.root, + store: component.store }); return { diff --git a/test/js/samples/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js index e384445105..b3e01289c3 100644 --- a/test/js/samples/non-imported-component/expected.js +++ b/test/js/samples/non-imported-component/expected.js @@ -8,11 +8,13 @@ function create_main_fragment(component, ctx) { var text; var imported = new Imported({ - root: component.root + root: component.root, + store: component.store }); var nonimported = new NonImported({ - root: component.root + root: component.root, + store: component.store }); return { diff --git a/test/js/samples/setup-method/expected-bundle.js b/test/js/samples/setup-method/expected-bundle.js index da8d02f4d6..df0ea63860 100644 --- a/test/js/samples/setup-method/expected-bundle.js +++ b/test/js/samples/setup-method/expected-bundle.js @@ -49,7 +49,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/svg-title/expected-bundle.js b/test/js/samples/svg-title/expected-bundle.js index 948fb03a4d..4073da0148 100644 --- a/test/js/samples/svg-title/expected-bundle.js +++ b/test/js/samples/svg-title/expected-bundle.js @@ -69,7 +69,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/title/expected-bundle.js b/test/js/samples/title/expected-bundle.js index 1060deab4c..109ec3276b 100644 --- a/test/js/samples/title/expected-bundle.js +++ b/test/js/samples/title/expected-bundle.js @@ -49,7 +49,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/use-elements-as-anchors/expected-bundle.js b/test/js/samples/use-elements-as-anchors/expected-bundle.js index 979a7ff3e7..2771ac3719 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle.js @@ -73,7 +73,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) { diff --git a/test/js/samples/window-binding-scroll/expected-bundle.js b/test/js/samples/window-binding-scroll/expected-bundle.js index 7fdc38fc63..2d718e483f 100644 --- a/test/js/samples/window-binding-scroll/expected-bundle.js +++ b/test/js/samples/window-binding-scroll/expected-bundle.js @@ -69,7 +69,7 @@ function init(component, options) { component.options = options; component.root = options.root || component; - component.store = component.root.store || options.store; + component.store = options.store || component.root.store; } function on(eventName, handler) {