Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 2x 2x 2x 2x 2x 2x 2x 285x 285x 2x 2x 262x 262x 262x 262x 262x 262x 262x 262x 262x 262x 262x | import * as e from '../errors.js'; import { component_context } from '../runtime.js'; import { FILENAME } from '../../../constants.js'; import { get_component } from './ownership.js'; /** @param {Function & { [FILENAME]: string }} target */ export function check_target(target) { if (target) { e.component_api_invalid_new(target[FILENAME] ?? 'a component', target.name); } } export function legacy_api() { const component = component_context?.function; /** @param {string} method */ function error(method) { // @ts-expect-error const parent = get_component()?.[FILENAME] ?? 'Something'; e.component_api_changed(parent, method, component[FILENAME]); } return { $destroy: () => error('$destroy()'), $on: () => error('$on(...)'), $set: () => error('$set(...)') }; } |