mirror of https://github.com/sveltejs/svelte
parent
bc7ade0bbd
commit
6bd410c886
@ -0,0 +1,13 @@
|
|||||||
|
import { Validator } from '../../';
|
||||||
|
import { Node } from '../../../interfaces';
|
||||||
|
|
||||||
|
const validTypes = new Set([
|
||||||
|
'FunctionExpression',
|
||||||
|
'ArrowFunctionExpression',
|
||||||
|
'Identifier',
|
||||||
|
'MemberExpression'
|
||||||
|
]);
|
||||||
|
|
||||||
|
export default function preload(validator: Validator, prop: Node) {
|
||||||
|
// not sure there's anything we need to check here...
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
export default {
|
||||||
|
test(assert, component) {
|
||||||
|
const Component = component.constructor;
|
||||||
|
assert.deepEqual(Component.preload({ foo: 1 }), { bar: 2 });
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,9 @@
|
|||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
preload({ foo }) {
|
||||||
|
return {
|
||||||
|
bar: foo * 2
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue