Closed
Description
- Version: llnode 1.7.0, node v8.11.1
- Platform: OS X (10.13.4)
- Subsystem: findrefs
Let's say we have an object which is not referenced by any other objects, but is scoped by a function or by a script. Should v8 findrefs [obj addr]
return nothing (current behavior), or should it return the scope this object belongs to? IMO we should change the behavior to return the scope as well, because looking at the output from the example below it seems like there are Lero
instances leaking, even though it's not true.
Example:
index.js
class Lero {
constructor() {
this.lala = {};
}
}
class Lira {
constructor() {
this.lele = {};
}
}
const lero = new Lero();
function foo() {
const lero2 = new Lero();
boom();
}
foo();
llnode results
(llnode) v8 findjsinstances -d Lero
0x00000548a34200e1:<Object: Lero properties {
.constructor=<unknown field type>}>
0x00000548a3420589:<Object: Lero properties {
.lala=0x00000548a34205e9:<Object: Object>}>
0x00000548a3420659:<Object: Lero properties {
.lala=0x00000548a34206b9:<Object: Object>}>
(llnode) v8 findrefs 0x00000548a3420589
(llnode) v8 findrefs 0x00000548a3420659