allow overwritten observe

pull/1346/head
Rich Harris 7 years ago
parent 83270b26af
commit ee8256604c

@ -138,7 +138,6 @@ export default function dom(
: options.shared || '';
let prototypeBase = `${name}.prototype`;
templateProperties.methods && (prototypeBase = `@assign(${prototypeBase}, %methods)`);
const proto = sharedPath
? `@proto`
@ -343,6 +342,7 @@ export default function dom(
}
@assign(${prototypeBase}, ${proto});
${templateProperties.methods && `@assign(${prototypeBase}, %methods);`}
`);
}

@ -6,7 +6,7 @@ import getName from '../../../utils/getName';
import { Validator } from '../../index';
import { Node } from '../../../interfaces';
const builtin = new Set(['set', 'get', 'on', 'fire', 'observe', 'destroy']);
const builtin = new Set(['set', 'get', 'on', 'fire', 'destroy']);
export default function methods(validator: Validator, prop: Node) {
if (prop.value.type !== 'ObjectExpression') {

@ -204,6 +204,7 @@ function SvelteComponent(options) {
}
}
assign(assign(SvelteComponent.prototype, methods), proto);
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, methods);
export default SvelteComponent;

@ -56,5 +56,6 @@ function SvelteComponent(options) {
}
}
assign(assign(SvelteComponent.prototype, methods), proto);
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, methods);
export default SvelteComponent;

@ -181,7 +181,8 @@ function SvelteComponent(options) {
}
}
assign(assign(SvelteComponent.prototype, methods), proto);
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, methods);
setup(SvelteComponent);

@ -44,7 +44,8 @@ function SvelteComponent(options) {
}
}
assign(assign(SvelteComponent.prototype, methods), proto);
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, methods);
setup(SvelteComponent);
export default SvelteComponent;
Loading…
Cancel
Save