如题,require方法定义都找不到,唯一能找到的就是下面一行信息
this.require { [Function: require] resolve: [Function], main: undefined, extensions: { '.js': [Function], '.json': [Function], '.node': [Function] }, registerExtension: [Function], cache: {} } console对象,也没找到
回复 (6)
Y
引用 jiyinyiyong系统内置函数, console 估计是 V8 代码里的.. require 没找到.. 代码 Github 有 https://github.com/joyent/node/tree/mast...
文档下载下来看了一天,还是没有头绪,太乱了,连个参考的说明都没有.........
J
引用 jiyinyiyong系统内置函数, console 估计是 V8 代码里的.. require 没找到.. 代码 Github 有 https://github.com/joyent/node/tree/mast...
@yy030913 语言内部实现不出现在文档感觉也挺正常的
你下载的是 Node 文档还是 JS 文档.?
console 是 JS 里的内容, require 是 CommonJS 规范的内容, 另外 Node API 是 Node..
反正都不在一个地方
L
#console定义 https://github.com/joyent/node/blob/master/src/node.js
startup.globalConsole = function() {
global.__defineGetter__('console', function() {
return NativeModule.require('console');
});
};
#console实现 https://github.com/joyent/node/blob/master/lib/console.js
L
引用 lb1064console定义 https://github.com/joyent/node/blob/master/src/node.js console实现 https://github.com/jo...
node的console和浏览器的console是不一样的
Y
exports.是导出方法吗?
J
系统内置函数, console 估计是 V8 代码里的..
require 没找到..
代码 Github 有 https://github.com/joyent/node/tree/master/src
求助会 C++ 的同学..
参与回复
登录后即可参与回复。登录