Lint and format src/compiler/compile/nodes/shared/is_contextual.js

pull/8569/head
Simon Holthausen 3 years ago
parent cf15a8ec39
commit 67b7e9d27f

@ -6,19 +6,12 @@ import { is_reserved_keyword } from '../../utils/reserved_keywords.js';
* @param {string} name
*/
export default function is_contextual(component, scope, name) {
if (is_reserved_keyword(name))
return true;
// if it's a name below root scope, it's contextual
if (!scope.is_top_level(name))
return true;
const variable = component.var_lookup.get(name);
// hoistables, module declarations, and imports are non-contextual
if (!variable || variable.hoistable)
return false;
// assume contextual
return true;
if (is_reserved_keyword(name)) return true;
// if it's a name below root scope, it's contextual
if (!scope.is_top_level(name)) return true;
const variable = component.var_lookup.get(name);
// hoistables, module declarations, and imports are non-contextual
if (!variable || variable.hoistable) return false;
// assume contextual
return true;
}

Loading…
Cancel
Save