Edit Chrome JS compiler

I want to edit the Chrome JS compiler such that I can emit an event when each expression in console is compiled so as to store the result in an array later on. How can I do it? I’m not asking for code but direction?

> console.log(1)

I want to store the console result in an array without compiling it again.