update tests

pull/811/head
Rich Harris 8 years ago
parent 118988c16b
commit 824998fdaa

@ -153,6 +153,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -162,7 +170,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
var template = (function () { var template = (function () {

@ -129,6 +129,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -138,7 +146,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
var template = (function () { var template = (function () {

@ -149,6 +149,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -158,7 +166,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
function encapsulateStyles ( node ) { function encapsulateStyles ( node ) {

@ -149,6 +149,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -158,7 +166,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
function create_main_fragment ( state, component ) { function create_main_fragment ( state, component ) {
@ -238,7 +248,15 @@ class SvelteComponent extends HTMLElement {
} }
customElements.define('custom-element', SvelteComponent); customElements.define('custom-element', SvelteComponent);
assign( SvelteComponent.prototype, proto , {
assign( SvelteComponent.prototype, proto ); _mount(target, anchor) {
this._fragment.mount(this.shadowRoot, null);
target.insertBefore(this, anchor);
},
_unmount() {
this.parentNode.removeChild(this);
}
});
export default SvelteComponent; export default SvelteComponent;

@ -77,7 +77,15 @@ class SvelteComponent extends HTMLElement {
} }
customElements.define('custom-element', SvelteComponent); customElements.define('custom-element', SvelteComponent);
assign( SvelteComponent.prototype, proto , {
assign( SvelteComponent.prototype, proto ); _mount(target, anchor) {
this._fragment.mount(this.shadowRoot, null);
target.insertBefore(this, anchor);
},
_unmount() {
this.parentNode.removeChild(this);
}
});
export default SvelteComponent; export default SvelteComponent;

@ -153,6 +153,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -162,7 +170,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
function create_main_fragment ( state, component ) { function create_main_fragment ( state, component ) {
@ -245,7 +255,15 @@ class SvelteComponent extends HTMLElement {
} }
customElements.define('custom-element', SvelteComponent); customElements.define('custom-element', SvelteComponent);
assign( SvelteComponent.prototype, proto , {
assign( SvelteComponent.prototype, proto ); _mount(target, anchor) {
this._fragment.mount(this.shadowRoot, null);
target.insertBefore(this, anchor);
},
_unmount() {
this.parentNode.removeChild(this);
}
});
export default SvelteComponent; export default SvelteComponent;

@ -80,7 +80,15 @@ class SvelteComponent extends HTMLElement {
} }
customElements.define('custom-element', SvelteComponent); customElements.define('custom-element', SvelteComponent);
assign( SvelteComponent.prototype, proto , {
assign( SvelteComponent.prototype, proto ); _mount(target, anchor) {
this._fragment.mount(this.shadowRoot, null);
target.insertBefore(this, anchor);
},
_unmount() {
this.parentNode.removeChild(this);
}
});
export default SvelteComponent; export default SvelteComponent;

@ -149,6 +149,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -158,7 +166,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
function create_main_fragment ( state, component ) { function create_main_fragment ( state, component ) {
@ -211,7 +221,7 @@ class SvelteComponent extends HTMLElement {
this._bind = options._bind; this._bind = options._bind;
this.attachShadow({ mode: 'open' }); this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = '<style>h1{color:red}</style>'; this.shadowRoot.innerHTML = `<style>h1{color:red}</style>`;
this._fragment = create_main_fragment( this._state, this ); this._fragment = create_main_fragment( this._state, this );
@ -239,7 +249,15 @@ class SvelteComponent extends HTMLElement {
} }
customElements.define('custom-element', SvelteComponent); customElements.define('custom-element', SvelteComponent);
assign( SvelteComponent.prototype, proto , {
assign( SvelteComponent.prototype, proto ); _mount(target, anchor) {
this._fragment.mount(this.shadowRoot, null);
target.insertBefore(this, anchor);
},
_unmount() {
this.parentNode.removeChild(this);
}
});
export default SvelteComponent; export default SvelteComponent;

@ -50,7 +50,7 @@ class SvelteComponent extends HTMLElement {
this._bind = options._bind; this._bind = options._bind;
this.attachShadow({ mode: 'open' }); this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = '<style>h1{color:red}</style>'; this.shadowRoot.innerHTML = `<style>h1{color:red}</style>`;
this._fragment = create_main_fragment( this._state, this ); this._fragment = create_main_fragment( this._state, this );
@ -78,7 +78,15 @@ class SvelteComponent extends HTMLElement {
} }
customElements.define('custom-element', SvelteComponent); customElements.define('custom-element', SvelteComponent);
assign( SvelteComponent.prototype, proto , {
assign( SvelteComponent.prototype, proto ); _mount(target, anchor) {
this._fragment.mount(this.shadowRoot, null);
target.insertBefore(this, anchor);
},
_unmount() {
this.parentNode.removeChild(this);
}
});
export default SvelteComponent; export default SvelteComponent;

@ -162,6 +162,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -171,7 +179,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
function create_main_fragment ( state, component ) { function create_main_fragment ( state, component ) {

@ -149,6 +149,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -158,7 +166,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
var template = (function () { var template = (function () {

@ -153,6 +153,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -162,7 +170,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
function create_main_fragment ( state, component ) { function create_main_fragment ( state, component ) {

@ -153,6 +153,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -162,7 +170,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
function create_main_fragment ( state, component ) { function create_main_fragment ( state, component ) {

@ -147,6 +147,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -156,7 +164,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
function create_main_fragment ( state, component ) { function create_main_fragment ( state, component ) {

@ -143,6 +143,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -152,7 +160,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
var template = (function () { var template = (function () {
@ -182,17 +192,17 @@ function create_main_fragment ( state, component ) {
}, },
mount: function ( target, anchor ) { mount: function ( target, anchor ) {
imported._fragment.mount( target, anchor ); imported._mount( target, anchor );
insertNode( text, target, anchor ); insertNode( text, target, anchor );
nonimported._fragment.mount( target, anchor ); nonimported._mount( target, anchor );
}, },
update: noop, update: noop,
unmount: function () { unmount: function () {
imported._fragment.unmount(); imported._unmount();
detachNode( text ); detachNode( text );
nonimported._fragment.unmount(); nonimported._unmount();
}, },
destroy: function () { destroy: function () {
@ -228,9 +238,7 @@ function SvelteComponent ( options ) {
if ( !options._root ) { if ( !options._root ) {
this._fragment.create(); this._fragment.create();
this._fragment.mount( options.target, options.anchor || null ); this._fragment.mount( options.target, options.anchor || null );
}
if ( !options._root ) {
this._lock = true; this._lock = true;
callAll(this._beforecreate); callAll(this._beforecreate);
callAll(this._oncreate); callAll(this._oncreate);

@ -29,17 +29,17 @@ function create_main_fragment ( state, component ) {
}, },
mount: function ( target, anchor ) { mount: function ( target, anchor ) {
imported._fragment.mount( target, anchor ); imported._mount( target, anchor );
insertNode( text, target, anchor ); insertNode( text, target, anchor );
nonimported._fragment.mount( target, anchor ); nonimported._mount( target, anchor );
}, },
update: noop, update: noop,
unmount: function () { unmount: function () {
imported._fragment.unmount(); imported._unmount();
detachNode( text ); detachNode( text );
nonimported._fragment.unmount(); nonimported._unmount();
}, },
destroy: function () { destroy: function () {
@ -75,9 +75,7 @@ function SvelteComponent ( options ) {
if ( !options._root ) { if ( !options._root ) {
this._fragment.create(); this._fragment.create();
this._fragment.mount( options.target, options.anchor || null ); this._fragment.mount( options.target, options.anchor || null );
}
if ( !options._root ) {
this._lock = true; this._lock = true;
callAll(this._beforecreate); callAll(this._beforecreate);
callAll(this._oncreate); callAll(this._oncreate);

@ -129,6 +129,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -138,7 +146,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
var template = (function () { var template = (function () {
@ -193,9 +203,7 @@ function SvelteComponent ( options ) {
if ( !options._root ) { if ( !options._root ) {
this._fragment.create(); this._fragment.create();
this._fragment.mount( options.target, options.anchor || null ); this._fragment.mount( options.target, options.anchor || null );
}
if ( !options._root ) {
callAll(this._oncreate); callAll(this._oncreate);
} }
} }

@ -52,9 +52,7 @@ function SvelteComponent ( options ) {
if ( !options._root ) { if ( !options._root ) {
this._fragment.create(); this._fragment.create();
this._fragment.mount( options.target, options.anchor || null ); this._fragment.mount( options.target, options.anchor || null );
}
if ( !options._root ) {
callAll(this._oncreate); callAll(this._oncreate);
} }
} }

@ -129,6 +129,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -138,7 +146,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
var template = (function () { var template = (function () {

@ -153,6 +153,14 @@ function callAll(fns) {
while (fns && fns.length) fns.pop()(); while (fns && fns.length) fns.pop()();
} }
function _mount(target, anchor) {
this._fragment.mount(target, anchor);
}
function _unmount() {
this._fragment.unmount();
}
var proto = { var proto = {
destroy: destroy, destroy: destroy,
get: get, get: get,
@ -162,7 +170,9 @@ var proto = {
set: set, set: set,
teardown: destroy, teardown: destroy,
_recompute: noop, _recompute: noop,
_set: _set _set: _set,
_mount: _mount,
_unmount: _unmount
}; };
function create_main_fragment ( state, component ) { function create_main_fragment ( state, component ) {

Loading…
Cancel
Save