Closed Soulike closed 3 years ago
Hi @Soulike,
NodeProf callbacks like getField
work inside JavaScript code only. In your example the element access happens inside a builtin function, which cannot be instrumented and thus not analyzed. Working around this, you may want to try adding analysis models for certain builtin functions to your analysis, or as far as possible replace builtins with JS polyfills that can be analyzed.
Hi @Soulike,
NodeProf callbacks like
getField
work inside JavaScript code only. In your example the element access happens inside a builtin function, which cannot be instrumented and thus not analyzed. Working around this, you may want to try adding analysis models for certain builtin functions to your analysis, or as far as possible replace builtins with JS polyfills that can be analyzed.
OK. Thank you for your reply. :)
Hi, I'm developing a NodeProf analysis for logging all accesses to object/array fields. But I found
getField()
is not called when analyzing codes using some library functions (likeArray.prototype.map()
) or iterator related functions/syntax/statements (likeArray.from()
, spread expression,for...of
statement). For example:Analyzed Code
My Analysis Code
What I expect is that
getField()
should be called and telling me thatoffset
:"0"
"1"
"2"
"3"
"4"
ofbase
:array
are read with value1
2
3
4
5
, respectively. Is it possible to achieve this?