metadata-hook.js (593B)
1 enableShellAllocationMetadataBuilder(); 2 3 function Foo() { 4 this.x = 0; 5 this.y = 1; 6 } 7 8 function hello() { 9 function there() { 10 w = new Foo(); 11 x = [1,2,3]; 12 y = [2,3,5]; 13 z = {a:0,b:1}; 14 } 15 callee = there; 16 callee(); 17 } 18 hello(); 19 20 var wc = getAllocationMetadata(w).index; 21 var xc = getAllocationMetadata(x).index; 22 var yc = getAllocationMetadata(y).index; 23 var zc = getAllocationMetadata(z).index; 24 25 assertEq(xc > wc, true); 26 assertEq(yc > xc, true); 27 assertEq(zc > yc, true); 28 assertEq(getAllocationMetadata(x).stack[0], callee); 29 assertEq(getAllocationMetadata(x).stack[1], hello);