[quickjs-devel] Re: import.meta

  • From: Saúl Ibarra Corretgé <s@xxxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Wed, 21 Aug 2019 11:22:26 +0200


On 21/08/2019 10:11, Fabrice Bellard wrote:

There is no standard yet for the content of import.meta hence it is
empty. I agree that "url" could be a good candidate.

Best regards,

Fabrice.

True that. Since the content is not defined yet, how about adding a way
to customize it? Then the module loader could put stuff in there for
example.

I'll try to come up with a patch.


Cheers,


On 8/19/19 10:48 PM, Saúl Ibarra Corretgé wrote:
Hi there,

Thanks a lot for the last release, love the cadence of updates :-)

I noticed the changelog mentions import.meta was added, but I can't seem
to find what it contains in the code. When I print it all I see is an
empty object.

Am I missing something or this is just the start? Are there plans to
include the "url" aka full path of the module file?

Context: I'm in need of some equivalent to __filename (in Node lingo)
and import.meta seems to be that.


Cheers,




-- 
Saúl

Other related posts: