Friday, 19 May 2017

Is it possible to watch object creation via the V8 debugging protocol?

When creating an object in JavaScript via a user-defined constructor, it's easy enough to "hook" (e.g. do something before or after) the creation of the object at runtime as the constructor is just a function. In fact, multiple Aspect Oriented Programming libraries exist to provide this functionality.

However, when creating an object via the object literal notation, the object seems to be automagically created by the runtime. Can the creation of these objects, or any other object in fact, be watched via the debugging protocol of V8?

My motivation here is to be able to trace data flow in an application.



via cubrr

No comments:

Post a Comment