if (platformSupportsSamplingProfiler()) { | |
load("./sampling-profiler/samplingProfiler.js", "caller relative"); | |
function foo() { | |
let o = {}; | |
for (let i = 0; i < 100; i++) { | |
o[i + "p"] = i; | |
} | |
} | |
function bar() { | |
let o = {}; | |
for (let i = 0; i < 100; i++) { | |
o[i + "p"] = i; | |
} | |
} | |
let boundFoo = foo.bind(null); | |
let boundBar = bar.bind(null); | |
let baz = function() { | |
boundFoo(); | |
boundBar(); | |
} | |
runTest(baz, ["foo", "bound foo", "baz"]); | |
runTest(baz, ["bar", "bound bar", "baz"]); | |
} |