Commit Graph

1070 Commits

Author SHA1 Message Date
isaacs
4c514a723c Let exit listeners know the exit code 2010-10-27 16:54:10 -07:00
Jorge Chamorro Bieling
fd70d30a9c make "node --eval" eval in the global scope. 2010-10-27 16:52:53 -07:00
Tim-Smart
79ecc8e9b7 Style changes. 2010-10-26 18:47:46 -07:00
Ryan Dahl
79944006e2 Move setTimeout and friends into timers module 2010-10-26 14:53:17 -07:00
Ryan Dahl
dcc4fffe4d Add C++ API for constructing fast buffer from string 2010-10-26 13:43:58 -07:00
Paul Querna
6ea61acf29 remove old todo. 2010-10-25 17:26:44 -07:00
Paul Querna
1ce4684a27 Centralize error handling in SecureStream
and add a start method, to kick off SSL handshaking, without writing a zero
byte buffer
2010-10-25 17:26:03 -07:00
Micheil Smith
8da020d39e Update node_net.cc to make us of node_constants.cc
also affects dgram which uses a constant from node_net.cc
2010-10-25 12:14:47 -07:00
Ryan Dahl
bb85e7751f Now working on v0.3.1 2010-10-23 16:01:37 -07:00
Ryan Dahl
1582cfebd6 bump version to 0.3.0 2010-10-23 16:00:15 -07:00
Stéphan Kochen
dd52737476 Provide a C++ Buffer constructor for external storage.
In order to do this, buffer data management was moved out of the
JS entry-point New, and into Replace.

Secondly, the constructor makes an immediate call to Replace, and
in order for ArrayData calls to work, wrapping must already be set
up. Now, the constructor takes the wrappee as a parameter.
2010-10-22 16:52:14 -07:00
Stéphan Kochen
b3e60c7b25 Generalize Buffer::Copy to work with all unsigned byte external data. 2010-10-22 13:47:10 -07:00
Stéphan Kochen
d5e966154c Simplify things by using *ArrayData everywhere. 2010-10-22 13:32:48 -07:00
Stéphan Kochen
d9b08d66d6 Remove old interface remains from Buffer.
These were all lacking implementation, so deprecating wouldn't help.
2010-10-22 13:32:31 -07:00
Ryan Dahl
b2969a9155 Don't call AtExit twice 2010-10-22 10:17:38 -07:00
Vitali Lovich
fb8830a64f Fix parsing of linux memory
If process name contains a space, this parsing fails for no good reason.
2010-10-22 10:14:19 -07:00
Jorge Chamorro Bieling
99e19aa398 Remove unneeded function wrappers 2010-10-21 17:11:59 -07:00
Ryan Dahl
2629296c25 Add isatty for isaacs 2010-10-21 12:34:37 -07:00
Ryan Dahl
ceb5331a64 Force exit on SIGINT but still reset flags on stdio fds
Add test that one can ctrl+c out of a script spinning infinitely.
2010-10-21 12:28:04 -07:00
Tom Hughes
78da9cb052 Add --max-stack-size flag.
v8 doesn't expose a command-line flag to set the stack size, so this
adds a new flag that node understands how to handle and uses v8's
ResourceConstraints API.
2010-10-20 15:57:13 -07:00
isaacs
5e14c8bec0 Add ~/.node_modules as well as ~/.node_libraries 2010-10-20 15:46:13 -07:00
isaacs
b0adaff67e require looks in node_modules folders
for modules starting with the __dirname and moving up.

This makes it much easier to localize dependencies to a particular program.
2010-10-20 15:45:47 -07:00
isaacs
492fc0d752 Split out modulePaths and defaultPaths
This way, the "default" paths of ~/.node_libraries and {prefix}/lib/node are only checked *after* anything that the user has placed into the NODE_PATHS environ, or pushed onto require.paths.

This makes require.paths a much more effective write-target, albeit slightly less useful as a read-target.  However, given the existence of require.resolve(), this is less of an issue -- if you want to know what a module ID will map to, just ask that question and get an authoritative answer from the loading machinery.
2010-10-20 15:21:33 -07:00
isaacs
226eff5104 Add require.resolve.
Also, hack the repl so that it works as expected there, too.
2010-10-20 12:12:07 -07:00
Jorge Chamorro Bieling
c735b4663a unbase64 skips over *any* illegal chars 2010-10-18 15:22:10 -07:00
Ryan Dahl
cf1db4f304 base64 decode should handle whitespace 2010-10-18 11:34:35 -07:00
Tom Hughes
f61b110cf6 Add signal handlers so we clean up before exiting.
Add SIGTERM and SIGINT signal handlers so that we run the exit handlers
before exiting when getting these signals. Fixes an issue where we
couldn't run vi after CTRL+C'ing node because the stdin fd was left
non-blocking.
2010-10-12 14:01:58 -07:00
Ryan Dahl
0fcb3bd3a9 Add .js to native script's filename 2010-10-12 11:54:45 -07:00
Ryan Dahl
c4636a578c Dynamically load native scripts 2010-10-12 11:49:41 -07:00
Micheil Smith
83db91be41 Removed deprecated alias to lib/fs.js 2010-10-11 16:20:04 -07:00
Micheil Smith
e38eb0c5a4 Soft migration of sys -> util, Removal of deprecated utils module. 2010-10-11 15:21:36 -07:00
Rasmus Andersson
50443f08e0 environ symbol fix for Mac OS X 2010-10-11 11:19:55 -07:00
Ryan Dahl
cdd1d675a7 Remove old tcp module 2010-10-10 20:57:33 -07:00
Ryan Dahl
9d248f690a Fix return in Buffer::New 2010-10-10 19:24:33 -07:00
Ryan Dahl
0cf03ab800 Add char* constructor for Buffer 2010-10-10 19:08:51 -07:00
Ryan Dahl
bc695475b9 Add Stream base class with stream.pipe 2010-10-10 17:27:03 -07:00
Ryan Dahl
fe74283e1d Fix a few compiler warnings... 2010-10-09 16:04:38 -07:00
Ryan Dahl
a6017660d8 More clang fixes 2010-10-09 15:10:45 -07:00
Ryan Dahl
5dd08c6c71 Ugly fix for clang 2010-10-09 14:21:33 -07:00
Ryan Dahl
783f5019b0 Add flag to disable colors in REPL 2010-10-09 12:46:06 -07:00
Ryan Dahl
b5359e40be Warnings for new C++ buffer API 2010-10-09 12:15:16 -07:00
Ryan Dahl
54e844cf08 add require.cache 2010-10-07 09:58:08 -07:00
Joshaven Potter
3d4e4d8909 syntax fixes to pass jslint 2010-10-06 20:40:57 -07:00
TJ Holowaychuk
9481bc1009 Added -e, --eval 2010-10-06 19:09:22 -07:00
Ryan Dahl
dbf0d6bb70 ClearWeak on ObjectWraps. I /think/ this is the correct semantics 2010-10-04 12:52:46 -07:00
isaacs
e9b6b0b327 Report "weird" errors a little better.
There are a few kinds of errors that are very confusing.
1. Errors raised in nextTick
2. Errors emitted on the "error" event
3. RangeErrors that crash the program (or anything without a stack trace)

Long traces will make make these better, of course.  In the meantime, this
adds a few handy signposts (in the form of better error reporting and
comments on the otherwise inscrutable code printed to the terminal) that can
help new users find the cause, or at least, ask for help more effectively.
2010-10-02 06:44:28 -07:00
Ryan Dahl
5a4c40beea Drop reference to timer callback on clearTimeout
Reported here:
http://groups.google.com/group/nodejs-dev/browse_thread/thread/9e063d0938f99879

Would be good to test this somehow...
2010-10-01 11:16:51 -07:00
Ryan Dahl
5cc1428d5f Remove unused function 2010-09-30 12:20:33 -07:00
Ryan Dahl
1a2c1c8a96 Simplify: per-module cache thing 2010-09-30 12:18:58 -07:00
Ben Noordhuis
55c65cc2d5 Safe constructor for ObjectWrapped classes
New() methods should be invoked as constructors, not regular functions.
Corner cases like Script::New() may cause a SIGSEGV when the GC is run.

More details: http://groups.google.com/group/nodejs/browse_thread/thread/a7e5db68d4cd6356
2010-09-29 16:02:45 -07:00