Closed BarrensZeppelin closed 1 year ago
Consider the following analysis.cjs:
analysis.cjs
//DO NOT INSTRUMENT (function (sandbox) { function MyAnalysis() { this.newSource = function(sourceInfo, source) { console.log("newSource", sourceInfo); }; } sandbox.addAnalysis(new MyAnalysis(), function filter(source) { return !source.internal || source.name.startsWith("file://"); }); })(J$);
and analysis target a.mjs:
a.mjs
await Promise.resolve(42);
When I run
$GRAAL_HOME/bin/node --jvm --experimental-options --nodeprof $GRAAL_HOME/tools/nodeprof/jalangi.js --analysis analysis.cjs a.mjs
there is no output.
If I run the dynamic analysis on b.mjs:
b.mjs
(async () => await Promise.resolve(42))();
I get the output:
newSource { name: 'file:///path/to/b.mjs', internal: true }
Is there a way to have the newSource-callback triggered for ES modules that use top-level await?
newSource
I just tried to reproduce this issue on master without luck. The newSource-callback is now correctly triggered. :partying_face:
master
Consider the following
analysis.cjs
:and analysis target
a.mjs
:When I run
there is no output.
If I run the dynamic analysis on
b.mjs
:I get the output:
Is there a way to have the
newSource
-callback triggered for ES modules that use top-level await?