Convert src/compiler/compile/render_dom/wrappers/shared/is_dynamic.ts to JavaScript

pull/8569/head
Simon Holthausen 3 years ago
parent a8a7cc6d50
commit bf9caafece

@ -1,12 +1,18 @@
import { Var } from '../../../../interfaces'; import { is_reserved_keyword } from '../../../utils/reserved_keywords.js';
import { is_reserved_keyword } from '../../../utils/reserved_keywords';
export default function is_dynamic(variable: Var) { /** @param {import('../../../../interfaces.js').Var} variable */
if (variable) { export default function is_dynamic(variable) {
if (variable.mutated || variable.reassigned) return true; // dynamic internal state if (variable) {
if (!variable.module && variable.writable && variable.export_name) return true; // writable props if (variable.mutated || variable.reassigned)
if (is_reserved_keyword(variable.name)) return true; return true; // dynamic internal state
} if (!variable.module && variable.writable && variable.export_name)
return true; // writable props
return false; if (is_reserved_keyword(variable.name))
return true;
}
return false;
} }

Loading…
Cancel
Save