Tuesday, 25 April 2017

Nodejs: How to find cc file that is behind process binding

I'm currently trying to learn nodejs code. I found myself stuck at the line (inside node.js):

NativeModule._source = process.binding('natives');
.....
NativeModule.exists = function(id) {
   return NativeModule._source.hasOwnProperty(id);
};

After checking similar questions like: What is `process.binding('fs')` in `fs.js`?. I understand how it works in nodejs to bind javascript and c++ file.

My question is how do we find the c++ file that binds with the code in javascript? For the code above, what's the way to find the c++ file that binds with "natives" and the definition of function hasOwnProperty()?



via Toby Zhou

No comments:

Post a Comment