0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
svelte/test/js/samples/setup-method/expected.js

55 lines
931 B
JavaScript
Raw Normal View History

/* generated by Svelte vX.Y.Z */
2017-09-16 21:09:38 +02:00
import { assign, init, noop, proto } from "svelte/shared.js";
var template = (function() {
return {
methods: {
foo ( bar ) {
console.log( bar );
}
},
setup: (Component) => {
Component.SOME_CONSTANT = 42;
Component.factory = function (target) {
return new Component({
target: target
});
}
Component.prototype.foo( 'baz' );
}
};
}());
function create_main_fragment(state, component) {
return {
2017-09-19 04:00:28 +02:00
c: noop,
2017-09-19 04:00:28 +02:00
m: noop,
2017-09-19 04:00:28 +02:00
p: noop,
2017-08-14 04:36:39 +02:00
2017-09-19 04:00:28 +02:00
u: noop,
2017-09-19 04:00:28 +02:00
d: noop
};
}
function SvelteComponent(options) {
2017-09-16 21:09:38 +02:00
init(this, options);
this._state = options.data || {};
this._fragment = create_main_fragment(this._state, this);
if (options.target) {
2017-09-19 04:00:28 +02:00
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
}
}
2017-09-16 17:08:41 +02:00
assign(SvelteComponent.prototype, template.methods, proto);
template.setup(SvelteComponent);
export default SvelteComponent;