Output result different from document in mjs example of Events
#49537
Labels
doc
Issues and PRs related to the documentations.
Events
#49537
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.
node/doc/api/events.md
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.node/doc/api/http.md
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 asundefined
. It is necessary to check whether the output asundefined
is a problem or normal, and if not, the document needs to be modified.The text was updated successfully, but these errors were encountered: