esprima icon indicating copy to clipboard operation
esprima copied to clipboard

import('aa.js') not supported

Open jogibear9988 opened this issue 4 years ago • 8 comments

jogibear9988 avatar Apr 12 '21 12:04 jogibear9988

I've done a fix for this in esprima.net https://github.com/sebastienros/esprima-dotnet/pull/154/commits/272dd32541fb8202e76f9157cbf741bb138921b0

jogibear9988 avatar Apr 12 '21 16:04 jogibear9988

fix : https://github.com/jquery/esprima/pull/2076

jogibear9988 avatar Apr 12 '21 16:04 jogibear9988

Hi @jogibear9988, thanks for the report and the fix! For our future reference, this likely needs a reference to the specification, as well as some tests.

ariya avatar Apr 12 '21 16:04 ariya

there are already tests for "import(xxx)"

jogibear9988 avatar Apr 13 '21 08:04 jogibear9988

spec: https://github.com/estree/estree/blob/master/es2020.md#importexpression

jogibear9988 avatar Apr 13 '21 08:04 jogibear9988

for example here: https://github.com/jquery/esprima/blob/main/test/fixtures/es2018/dynamic-import/await-import.js

jogibear9988 avatar Apr 13 '21 08:04 jogibear9988

my fix has one problem:

import('a','b') is no error (but it should be). but I don't know how this should be fixed atm. I'm not deep enough into esprima

jogibear9988 avatar Apr 13 '21 08:04 jogibear9988

the import('a', 'b') is now also fixed that it would fail.

jogibear9988 avatar Apr 28 '21 19:04 jogibear9988