简体   繁体   English

我在node.js源代码中找不到方法的定义

[英]I cannot find the definition of a method in node.js source code

I see 'env->context()' scattered throughout the node.js source code, where the variable 'env' is of a pointer to some Environment object (which I believe is defined in env.h). 我看到'env-> context()'散布在整个node.js源代码中,其中的变量'env'指向某个环境对象的指针(我相信它是在env.h中定义的)。 I cannot find the definition of this context() method associated with the Environment object anywhere in the source code. 我在源代码中的任何地方都找不到与Environment对象关联的context()方法的定义。 Can someone please point me in the right direction? 有人可以指出正确的方向吗? I am looking for this simply out of curiosity. 我只是出于好奇而寻找这个。

It is generated via this macro: https://github.com/nodejs/node/blob/5fab50bdaf6d82abc8a15bc55685211431ef3b75/src/env.h#L331 它是通过以下宏生成的: https : //github.com/nodejs/node/blob/5fab50bdaf6d82abc8a15bc55685211431ef3b75/src/env.h#L331

The function declaration is here: https://github.com/nodejs/node/blob/5fab50bdaf6d82abc8a15bc55685211431ef3b75/src/env.h#L837 函数声明在这里: https : //github.com/nodejs/node/blob/5fab50bdaf6d82abc8a15bc55685211431ef3b75/src/env.h#L837

You'll find the implementation if you look for further uses of the ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES macro. 如果您需要进一步使用ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES宏,则将找到实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM