mirror of https://github.com/sveltejs/svelte
parent
a8a7cc6d50
commit
bf9caafece
@ -1,12 +1,18 @@
|
||||
import { Var } from '../../../../interfaces';
|
||||
import { is_reserved_keyword } from '../../../utils/reserved_keywords';
|
||||
import { is_reserved_keyword } from '../../../utils/reserved_keywords.js';
|
||||
|
||||
export default function is_dynamic(variable: Var) {
|
||||
if (variable) {
|
||||
if (variable.mutated || variable.reassigned) return true; // dynamic internal state
|
||||
if (!variable.module && variable.writable && variable.export_name) return true; // writable props
|
||||
if (is_reserved_keyword(variable.name)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
/** @param {import('../../../../interfaces.js').Var} variable */
|
||||
export default function is_dynamic(variable) {
|
||||
if (variable) {
|
||||
if (variable.mutated || variable.reassigned)
|
||||
return true; // dynamic internal state
|
||||
if (!variable.module && variable.writable && variable.export_name)
|
||||
return true; // writable props
|
||||
if (is_reserved_keyword(variable.name))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in new issue