0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-30 08:56:14 +01:00
svelte/test/js/samples/setup-method/expected.js
2018-05-12 21:55:07 -04:00

50 lines
879 B
JavaScript

/* generated by Svelte vX.Y.Z */
import { assign, init, noop, proto } from "svelte/shared.js";
var methods = {
foo ( bar ) {
console.log( bar );
}
};
function setup(Component) {
Component.SOME_CONSTANT = 42;
Component.factory = function (target) {
return new Component({
target: target
});
}
Component.prototype.foo( 'baz' );
}
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, methods);
setup(SvelteComponent);
export default SvelteComponent;