Commit Graph

285 Commits

Author SHA1 Message Date
Paul Querna
8dbfe5ea8f Use the top level check for the bindings cache
(rather than each potential module having its own if check)
2010-07-14 10:23:24 -07:00
Paul Querna
30dadfc033 Register builtin extensions via a macro, rather than a manual strcmp
Set the stage for making the builtin modules more dynamic.

Note: this only converts crypto and net, I will add more extensions in a
later commit.

* node.h: Add utility macro for converting macro values to strings.

* node.h: Include the actual module name inside the module structure, not
  just the file it was built from.

* node.h: New Macro, NODE_MODULE_DECL, for declaring an external reference
  to a module structure.

* node_extensions.cc: New File, implements get_builtin_module, which
  iterates over the module structures that are compiled into node.

* node.cc(node::Binding): Use the new module lookup function to find
  modules.

* node_{net,crypto}.c: Add NODE_MODULEs to generate the module structure.
2010-07-14 10:17:25 -07:00
Paul Querna
367b87d26d Add support for the module structure to process.dlopen. 2010-07-13 07:08:08 -07:00
Peter Griess
ac2404283e Coverity stack size warnings in DefineConstants(). 2010-07-12 16:37:17 -07:00
Peter Griess
4e3c5d88b3 Coverity fixes: src/node.cc 2010-07-12 13:20:26 -07:00
Ryan Dahl
8a52fb7aeb Revert "Fix 'uncaughtException' for top level exceptions"
This reverts commit 8f8dcf8ed6.
2010-07-01 11:10:22 -07:00
Ryan Dahl
8f8dcf8ed6 Fix 'uncaughtException' for top level exceptions
Done by not evaluating the code in the first tick.

This breaks one test in test-error-reporting.js but I believe this to be a
V8 error and I have reported it in
http://code.google.com/p/v8/issues/detail?id=764
2010-06-30 15:04:40 -07:00
Blake Mizerany
8c8534046c fix whitespace errors 2010-06-29 23:59:24 -07:00
Ryan Dahl
e2db605308 Use EVBACKEND_POLL on Solaris; select() is just a wrapper anyway 2010-06-28 15:37:29 -07:00
Ruben Rodriguez
242161bef2 Added new API to Script, and implemented it in the REPL 2010-06-28 15:16:26 -07:00
Ryan Dahl
f541043618 Remove ini.js 2010-06-22 19:37:29 -07:00
Ryan Dahl
fc175a089d Remove mjsunit from repo 2010-06-22 19:33:01 -07:00
Marshall Culpepper
ca35ba640a Initial implementation of process.execPath
Darwin, Linux, Solaris. FreeBSD still needs testing.

TODO: Amend the tests where we use spawn with argv[0].
2010-06-22 02:02:25 -07:00
Ryan Dahl
01a8d270cf Add platform files, move getmem to node::OS class. 2010-06-17 18:23:43 -07:00
Ryan Dahl
6bed15e074 Refactor: Utf8Decoder -> StringDecoder
Instead of just decoding Utf8, this will proxy requests to buffer.toString()
for other encodings. This makes for a simpler interface.
2010-06-15 18:19:27 -07:00
Paul Querna
02da5ed4a1 Implement datagram sockets
- Adds new dgram module, for all data-gram type transports
- Supports both UDP client and servers
- Supports Unix Daemon sockets in DGRAM mode too (think syslog)
- Uses a shared Buffer and slices that as needed to be reasonably
  performant.
- One supplied test program so far, test-dgram-pingpong
- Passes test cases on osx 10.6 and ubuntu 9.10u
2010-06-12 02:41:45 -07:00
isaacs
94be898fbc Remove "uri" module.
The deprecation warning was broken, so clearly no one is using this thing.
2010-06-11 13:19:50 -07:00
Raffaele Sena
b3b81d67ff Port to cygwin 2010-06-09 15:08:46 -07:00
Ryan Dahl
0c3b6aba7a Do not output \n on stderr on output, breaks tests 2010-06-07 16:23:48 -07:00
Ryan Dahl
6056d2ea2c node without arguments starts the REPL 2010-06-07 16:15:41 -07:00
Ryan Dahl
41f213be18 Add binding to termios, implement readline for repl 2010-06-07 15:24:21 -07:00
Ryan Dahl
9e8df0e836 More dynamic linking options (again)
Original commit: 75f0cf471a
2010-06-04 11:42:34 -07:00
Peter Griess
78d33f4fd5 Fix options parsing
The current node has a bug where it will fail to pass the option argument
immediately preceding the first non-option argument to V8. That is the
--perf flag will be ignored by V8 when running 'node --perf script.js'.
2010-06-04 08:29:10 -07:00
Ryan Dahl
501136b999 Revert "More dynmaic linking options"
Broke the build. Will fix and reapply soon.

This reverts commit 75f0cf471a.
2010-06-02 09:16:28 -07:00
Ryan Dahl
75f0cf471a More dynmaic linking options
This adds the following options to the `configure` program

  --shared-v8           Link to a shared V8 DLL instead of static linking
  --shared-v8-includes=SHARED_V8_INCLUDES
                        Directory containing V8 header files
  --shared-v8-libpath=SHARED_V8_LIBPATH
                        A directory to search for the shared V8 DLL
  --shared-cares        Link to a shared C-Ares DLL instead of static linking
  --shared-cares-includes=SHARED_CARES_INCLUDES
                        Directory containing C-Ares header files
  --shared-cares-libpath=SHARED_CARES_LIBPATH
                        A directory to search for the shared C-Ares DLL
  --shared-libev        Link to a shared libev DLL instead of static linking
  --shared-libev-includes=SHARED_LIBEV_INCLUDES
                        Directory containing libev header files
  --shared-libev-libpath=SHARED_LIBEV_LIBPATH
                        A directory to search for the shared libev DLL

and removes --system.
2010-06-01 20:18:43 -07:00
Ryan Dahl
78e49f1c88 Rename node_net2.cc to node_net.cc 2010-05-29 13:08:05 -07:00
Peter Griess
2420f07e94 Allow process.setuid() and process.setgid() to accept string names in lieu of numeric IDs 2010-05-18 17:41:10 -07:00
Felix Geisendörfer
caba9c70c3 Implemented Utf8Decoder module
Allows to safely decode a utf8 stream into strings without breaking
on multibyte characters.
2010-05-17 22:12:30 -07:00
visionmedia
45948e054d Added better error messages for async and sync fs calls with paths 2010-05-14 19:46:16 -07:00
Ryan Dahl
da9323040f Simplify stack trace reporting using new V8 API 2010-05-14 11:48:14 -07:00
Jérémy Lal
4e40e8804b System EV compatibility fix : use EV_DEFAULT_UC 2010-05-13 16:56:13 -07:00
Ryan Dahl
c90e44e582 Just add an extra include for strings.h - don't try to be cute 2010-05-10 16:38:47 -07:00
Ryan Dahl
8e5b91c79b Revert "Check for strings.h"
This reverts commit 032f651824.
2010-05-10 16:38:14 -07:00
Ryan Dahl
032f651824 Check for strings.h 2010-05-10 16:30:31 -07:00
Ryan Dahl
b78508266b Change string.h to strings.h compile on solaris 2010-05-09 16:29:23 -07:00
Ryan Dahl
ab068db9b1 Improve error reporting
- No more single line "node.js:176:9" errors
- No more strange output when error happens on first line due to
  module wrapper function.
- A few tests to check these things
2010-05-09 13:55:42 -07:00
rentzsch
a5b132ad63 fs.Stats.size V8::Integer => V8::Number.
While VM::Integer::Value() offers an int64_t, V8::Integer::New() only
accepts an int32_t, truncating fs.Stat's size in BuildStatsObject().

I consider this a bug in V8, and we should move back to V8::Integer
when it gets a ctr that allows a int64_t. Until then, this work-around
should hold.
2010-05-08 19:52:22 -07:00
Ryan Dahl
3ac6deefa8 Change GC idle notify so that it runs along side setInterval
Doesn't appear any slower. Also checks for high memory usage and tries to
force more notifications.
2010-05-07 19:06:05 -07:00
Ryan Dahl
b6c5cf60b7 Ignore SIGPIPE
Was inadvertently removed with evcom,
c72967d335 (L10L1900)
2010-05-04 10:41:56 -07:00
Ryan Dahl
3bb21b5191 Fix signo_string for linux and solaris 2010-04-28 15:07:15 -07:00
Felix Geisendörfer
f8a3cf980f Properly handle child process exit codes
The child process 'exit' was returning the status of the process, rather than
the exit code. This patch properly deconstructs the status into the exit code
and the term signal a process may have received.

See:
http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#Watcher_Specific_Functions_and_Data_-5
and waitpid(2)
2010-04-28 13:54:17 -07:00
Ryan Dahl
9b2aac61b2 Resolve EWOULDBLOCK to string if different thatn EAGAIN 2010-04-28 12:58:51 -07:00
Ryan Dahl
c72967d335 Remove http_old tcp_old 2010-04-23 17:19:29 -07:00
Ryan Dahl
c9e27b11c5 Unify ErrnoException creation 2010-04-22 17:53:45 -07:00
Ryan Dahl
76d525b034 Remove assert for no-such-module 2010-04-22 14:43:25 -07:00
isaacs
cfd459abde Move the module loading framework into lib/module.js. Minimal changes otherwise. 2010-04-21 12:05:01 -07:00
isaacs
e0061a511d refactor path module to lib/path.js 2010-04-21 11:38:51 -07:00
isaacs
7ff53f4c6a Refactor events module to lib/events.js 2010-04-21 11:38:46 -07:00
Ryan Dahl
4ff45c264c Remove old EvalCX 2010-04-18 15:44:23 -04:00
Herbert Vojcik
c2a06725d6 Script class with eval-function-family in binding('evals') plus tests. 2010-04-18 15:01:36 -04:00