pub fn is_module_source(source: &str) -> boolExpand description
Whether source should be evaluated as a module, decided the way qjs decides.
The rule is deliberately shallow: the first token must be import or export
(an import followed by . or ( is import.meta or import(), both of which are
expressions, so a script may use them). Nothing else makes a file a module.
It has to be this shallow to match the reference, and the difference is observable:
a file that merely mentions import.meta further down is a script, so it fails with
“import.meta only valid in module code” rather than silently becoming a module.