Output result different from document in mjs example of Events
#49537
Closed
Description
Version
v20.5.1
Platform
ubuntu 20.04, Microsoft Windows NT 10.0.19045.0 x64
Subsystem
No response
What steps will reproduce the bug?
When performing the document example for event, the results are different.
Lines 102 to 111 in e0fb3f7
Even if you print console.log(this);
in the part where the callback is called in another mjs example, it is the same.
Lines 484 to 537 in e0fb3f7
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
// Prints: a b {}
What do you see instead?
// Prints: a b undefined
Additional information
In cjs examples, this
is output as {}
, while in mjs examples, this
is output as undefined
. It is necessary to check whether the output as undefined
is a problem or normal, and if not, the document needs to be modified.