Evaluate ES6-Module with undefined function

18 views
Skip to first unread message

Hans Maier

unread,
Jul 29, 2020, 4:23:58 AM7/29/20
to v8-users
Hi,

im upgrading from 8.0.426.26 to 8.4.371.22.

I've a small test case where I evalute (using v8::Module::Evaluate) a ES6-Module with the following content:
----
hello();
----

In 8.0.x I get an exception:
HelloWorld1.js:1: <no exeception message>
hello();
^
ReferenceError: hello is not defined
    at HelloWorld1.js:1:1

In 8.4.x there is no exception (it succeddes).

It this expected?

Thanks.

Ben Noordhuis

unread,
Jul 29, 2020, 6:41:06 AM7/29/20
to v8-users
It depends. What does module->GetStatus() return before and after and
what does module->Evaluate() itself return? Do you set the
--harmony_top_level_await flag?

Hans Maier

unread,
Jul 30, 2020, 3:33:48 AM7/30/20
to v8-users
Hi Ben,

the Status before evaluate is "kInstantiated" and after "kErrored", "--harmony_top_level_await" is not used.

I didn't check for the kErrored before, so I will just do that to get the old behaviour.

Thanks for the hint!
Reply all
Reply to author
Forward
0 new messages