Closed barslev closed 5 years ago
@barslev , thanks, l will look into this issue.
We are waiting for a Graal.js change to be merged in order to fix this.
This has been fixed with 2c91d9bac5538938f02aaf11d34ad69504f4ba97.
I'm still observing cases where the proper this
object cannot be resolved by NodeProf (e.g. an empty function or one that does not reference this
). We're still looking into that, but to me it sounds like a graal-js optimization we would have to undo.
I have created a small JavaScript program and a Jalangi analysis, which shows a case where the
functionEnter
hook is triggered with an unexpected value fordis
.The JavaScript program simply calls
f
and writes the return value toy
. It is expected thatthis
inf
should be the global object. Below is the Jalangi analysis that shows the unexpected behavior:Running NodeProf with the above program and analysis, we get the following output:
It shows correctly that the value written to
y
is the global object, sof
is executed correctly, but when entering functionf
the value fordis
in thefunctionEnter
hook isundefined
, instead of being the global object as expected.