rra/ilgonmic/js-fun-import

[JS IR] Test import.meta syntax

[JS IR] Add possibility to use import.meta

[JS IR] Check if import function-like returns Promise

[JS IR] Add test with import function syntax

[JS IR] Allow import function-like in js function

Merge-request: KT-MR-5948
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51125 fixed
This commit is contained in:
Ilya Goncharov
2022-04-04 16:26:54 +00:00
committed by Space
parent 5a3b397552
commit 611e70c254
3 changed files with 24 additions and 1 deletions
@@ -18,7 +18,7 @@
* Copyright (C) 1997-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Contributor(s):
* Mike Ang
* Mike McCabe
*
@@ -1140,6 +1140,13 @@ public class Parser {
mustMatchToken(ts, TokenStream.GWT, "msg.no.paren");
return pn;
case TokenStream.IMPORT:
// for import() and import.meta syntax
if (ts.peekToken() != TokenStream.LP && ts.peekToken() != TokenStream.DOT) {
reportError(ts, "msg.syntax");
}
return nf.createName(TokenStream.tokenToName(TokenStream.IMPORT), position);
case TokenStream.NAME:
String name = ts.getString();
return nf.createName(name, position);