FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node/src/node.js at master · jmarksharkey/node · GitHub
jmarksharkey
/
node
Public
forked from
nodejs/node-v0.x-archive
Notifications
You must be signed in to change notification settings
Fork
1
Star
2
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
node
/
src
/
node.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
167 lines (131 loc) · 4.99 KB
Breadcrumbs
node
/
src
/
node.js
Copy path
File metadata and controls
167 lines (131 loc) · 4.99 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
(
function
(
process
)
{
process
.
global
.
process
=
process
;
process
.
global
.
global
=
process
.
global
;
global
.
GLOBAL
=
global
;
/** deprecation errors ************************************************/
function
removed
(
reason
)
{
return
function
(
)
{
throw
new
Error
(
reason
)
}
}
GLOBAL
.
__module
=
removed
(
"'__module' has been renamed to 'module'"
)
;
GLOBAL
.
include
=
removed
(
"include(module) has been removed. Use require(module)"
)
;
GLOBAL
.
puts
=
removed
(
"puts() has moved. Use require('sys') to bring it back."
)
;
GLOBAL
.
print
=
removed
(
"print() has moved. Use require('sys') to bring it back."
)
;
GLOBAL
.
p
=
removed
(
"p() has moved. Use require('sys') to bring it back."
)
;
process
.
debug
=
removed
(
"process.debug() has moved. Use require('sys') to bring it back."
)
;
process
.
error
=
removed
(
"process.error() has moved. Use require('sys') to bring it back."
)
;
process
.
watchFile
=
removed
(
"process.watchFile() has moved to fs.watchFile()"
)
;
process
.
unwatchFile
=
removed
(
"process.unwatchFile() has moved to fs.unwatchFile()"
)
;
process
.
mixin
=
removed
(
'process.mixin() has been removed.'
)
;
GLOBAL
.
node
=
{
}
;
node
.
createProcess
=
removed
(
"node.createProcess() has been changed to process.createChildProcess() update your code"
)
;
process
.
createChildProcess
=
removed
(
"childProcess API has changed. See doc/api.txt."
)
;
node
.
exec
=
removed
(
"process.exec() has moved. Use require('sys') to bring it back."
)
;
node
.
inherits
=
removed
(
"node.inherits() has moved. Use require('sys') to access it."
)
;
process
.
inherits
=
removed
(
"process.inherits() has moved to sys.inherits."
)
;
node
.
http
=
{
}
;
node
.
http
.
createServer
=
removed
(
"node.http.createServer() has moved. Use require('http') to access it."
)
;
node
.
http
.
createClient
=
removed
(
"node.http.createClient() has moved. Use require('http') to access it."
)
;
node
.
tcp
=
{
}
;
node
.
tcp
.
createServer
=
removed
(
"node.tcp.createServer() has moved. Use require('tcp') to access it."
)
;
node
.
tcp
.
createConnection
=
removed
(
"node.tcp.createConnection() has moved. Use require('tcp') to access it."
)
;
node
.
dns
=
{
}
;
node
.
dns
.
createConnection
=
removed
(
"node.dns.createConnection() has moved. Use require('dns') to access it."
)
;
process
.
assert
=
function
(
x
,
msg
)
{
if
(
!
(
x
)
)
throw
new
Error
(
msg
||
"assertion error"
)
;
}
;
process
.
evalcx
=
process
.
binding
(
'evals'
)
.
Script
.
runInNewContext
;
// nextTick()
var
nextTickQueue
=
[
]
;
process
.
_tickCallback
=
function
(
)
{
var
l
=
nextTickQueue
.
length
;
while
(
l
--
)
{
var
cb
=
nextTickQueue
.
shift
(
)
;
cb
(
)
;
}
}
;
process
.
nextTick
=
function
(
callback
)
{
nextTickQueue
.
push
(
callback
)
;
process
.
_needTickCallback
(
)
;
}
;
// Module System
var
module
=
{
}
process
.
compile
(
"(function (exports) {"
+
process
.
binding
(
"natives"
)
.
module
+
"\n})"
,
"module"
)
(
module
)
;
// TODO: make sure that event module gets loaded here once it's
// factored out of module.js
// module.require("events");
// Signal Handlers
function
isSignal
(
event
)
{
return
event
.
slice
(
0
,
3
)
===
'SIG'
&&
process
.
hasOwnProperty
(
event
)
;
}
;
process
.
addListener
(
"newListener"
,
function
(
event
)
{
if
(
isSignal
(
event
)
&&
process
.
listeners
(
event
)
.
length
===
0
)
{
var
b
=
process
.
binding
(
'signal_watcher'
)
;
var
w
=
new
b
.
SignalWatcher
(
process
[
event
]
)
;
w
.
addListener
(
"signal"
,
function
(
)
{
process
.
emit
(
event
)
;
}
)
;
}
}
)
;
// Timers
function
addTimerListener
(
callback
)
{
var
timer
=
this
;
// Special case the no param case to avoid the extra object creation.
if
(
arguments
.
length
>
2
)
{
var
args
=
Array
.
prototype
.
slice
.
call
(
arguments
,
2
)
;
timer
.
callback
=
function
(
)
{
callback
.
apply
(
timer
,
args
)
;
}
;
}
else
{
timer
.
callback
=
callback
;
}
}
global
.
setTimeout
=
function
(
callback
,
after
)
{
var
timer
=
new
process
.
Timer
(
)
;
addTimerListener
.
apply
(
timer
,
arguments
)
;
timer
.
start
(
after
,
0
)
;
return
timer
;
}
;
global
.
setInterval
=
function
(
callback
,
repeat
)
{
var
timer
=
new
process
.
Timer
(
)
;
addTimerListener
.
apply
(
timer
,
arguments
)
;
timer
.
start
(
repeat
,
repeat
)
;
return
timer
;
}
;
global
.
clearTimeout
=
function
(
timer
)
{
if
(
timer
instanceof
process
.
Timer
)
{
timer
.
stop
(
)
;
}
}
;
global
.
clearInterval
=
global
.
clearTimeout
;
var
stdout
;
process
.
__defineGetter__
(
'stdout'
,
function
(
)
{
if
(
stdout
)
return
stdout
;
var
net
=
module
.
requireNative
(
'net'
)
;
stdout
=
new
net
.
Stream
(
process
.
binding
(
'stdio'
)
.
stdoutFD
)
;
return
stdout
;
}
)
;
var
stdin
;
process
.
openStdin
=
function
(
)
{
if
(
stdin
)
return
stdin
;
var
net
=
module
.
requireNative
(
'net'
)
;
var
fd
=
process
.
binding
(
'stdio'
)
.
openStdin
(
)
;
stdin
=
new
net
.
Stream
(
fd
)
;
stdin
.
resume
(
)
;
stdin
.
readable
=
true
;
return
stdin
;
}
;
process
.
exit
=
function
(
code
)
{
process
.
emit
(
"exit"
)
;
process
.
reallyExit
(
code
)
;
}
;
module
.
runMain
(
)
;
// All our arguments are loaded. We've evaluated all of the scripts. We
// might even have created TCP servers. Now we enter the main eventloop. If
// there are no watchers on the loop (except for the ones that were
// ev_unref'd) then this function exits. As long as there are active
// watchers, it blocks.
process
.
loop
(
)
;
process
.
emit
(
"exit"
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL