Merge branch 'patch-1' of https://github.com/petterek/svelte into petterek-patch-1

pull/907/head
Rich Harris 8 years ago
commit 218dcacef8

@ -190,9 +190,7 @@ export default function dom(
`if (!options || (!options.target && !options._root)) throw new Error("'target' is a required option");`}
@init(this, options);
${generator.usesRefs && `this.refs = {};`}
this._state = ${templateProperties.data
? `@assign(%data(), options.data)`
: `options.data || {}`};
this._state = @assign(${templateProperties.data ? '%data()' : '{}'}, options.data);
${generator.metaBindings}
${computations.length && `this._recompute({ ${Array.from(computationDeps).map(dep => `${dep}: 1`).join(', ')} }, this._state);`}
${options.dev &&

@ -198,7 +198,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
if (!options._root) {
this._oncreate = [];

@ -33,7 +33,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
if (!options._root) {
this._oncreate = [];

@ -191,7 +191,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._recompute({ x: 1 }, this._state);
this._fragment = create_main_fragment(this._state, this);

@ -26,7 +26,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._recompute({ x: 1 }, this._state);
this._fragment = create_main_fragment(this._state, this);

@ -226,7 +226,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
if (!document.getElementById("svelte-2363328337-style")) add_css();

@ -41,7 +41,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
if (!document.getElementById("svelte-2363328337-style")) add_css();

@ -205,7 +205,7 @@ class SvelteComponent extends HTMLElement {
constructor(options = {}) {
super();
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `<style>div{animation:foo 1s}@keyframes foo{0%{opacity:0}100%{opacity:1}}</style>`;

@ -28,7 +28,7 @@ class SvelteComponent extends HTMLElement {
constructor(options = {}) {
super();
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `<style>div{animation:foo 1s}@keyframes foo{0%{opacity:0}100%{opacity:1}}</style>`;

@ -338,7 +338,7 @@ function create_each_block(state, comments, comment, i, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -141,7 +141,7 @@ function create_each_block(state, comments, comment, i, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -223,7 +223,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -46,7 +46,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -271,7 +271,7 @@ function select_block_type(state) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -90,7 +90,7 @@ function select_block_type(state) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -247,7 +247,7 @@ function create_if_block(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -66,7 +66,7 @@ function create_if_block(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -220,7 +220,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -39,7 +39,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -215,7 +215,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -34,7 +34,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -215,7 +215,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -34,7 +34,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -226,7 +226,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -45,7 +45,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -226,7 +226,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -41,7 +41,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -213,7 +213,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -30,7 +30,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -238,7 +238,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -38,7 +38,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -302,7 +302,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
if (!options._root) {
this._oncreate = [];

@ -109,7 +109,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
if (!options._root) {
this._oncreate = [];

@ -221,7 +221,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
if (!options._root) {
this._oncreate = [];

@ -45,7 +45,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
if (!options._root) {
this._oncreate = [];

@ -187,7 +187,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._handlers.destroy = [ondestroy];

@ -22,7 +22,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._handlers.destroy = [ondestroy]

@ -199,7 +199,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -34,7 +34,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -437,7 +437,7 @@ function create_if_block_4(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -248,7 +248,7 @@ function create_if_block_4(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

Loading…
Cancel
Save