5
  • node.js の C++ ソース コードのどこで、JavaScript オブジェクトが定義されているかを調べるにはどうすればよいprocess.binding('eval')ですか? - この特殊なケースに含まれていることは既にわかっていますが、ディレクトリの概要を確認しただけで、そのモジュールがどこ/src/node_script.ccにあるのかを知るにはどうすればよいですか? モジュールを探すためにすべてのファイルを調べたくありません。/src//src/
  • sの内部に関する深い情報はどこで見つけることができますかprocess.binding()?

ありがとう。

4

1 に答える 1

2

I was looking for the same myself today. I cannot guarantee that there isn't more to it, but this is what I discovered.

src/node_extensions.h contains a list of built-in modules, defined like:

ITEM(node_module_name)

where module_name is the name of the module (obviously)

You can find out which file defines that module by searching for which file has a line that starts with

NODE_MODULE(node_module_name, 

So, to find the file that defines the 'evals' module for process.bindings:

$ grep "NODE_MODULE(node_evals" src/*.cc
src/node_script.cc:NODE_MODULE(node_evals, node::InitEvals)
于 2013-08-09T22:51:58.450 に答える