Skip to content

Commit

Permalink
Check for both 'module' and 'target'.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRosenwasser committed Apr 28, 2018
1 parent bc0d3e1 commit 161535b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Expand Up @@ -18812,7 +18812,7 @@ namespace ts {
}

function checkImportMetaProperty(node: MetaProperty) {
if (languageVersion < ScriptTarget.ESNext && moduleKind < ModuleKind.ESNext) {
if (languageVersion < ScriptTarget.ESNext || moduleKind < ModuleKind.ESNext) {

This comment has been minimized.

Copy link
@weswigham

weswigham Apr 28, 2018

Member

I think the emit module kind is all we care about. The language version doesn't really matter, as the import.meta transform would be a module-related transform if we could downleveled it, I think.

error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_using_ESNext_for_the_target_and_module_compiler_options);
}
const file = getSourceFileOfNode(node);
Expand Down

0 comments on commit 161535b

Please sign in to comment.