platform/upstream/nodejs.git
13 years agoAdded support for multiple listeners to DNS multicast datagrams.
Rasmus Andersson [Wed, 11 Aug 2010 21:03:56 +0000 (23:03 +0200)]
Added support for multiple listeners to DNS multicast datagrams.

Some platforms require SO_REUSEPORT to be set for the socket.

13 years agoFix http and net tests failing due to race condition
Bert Belder [Wed, 11 Aug 2010 23:38:42 +0000 (01:38 +0200)]
Fix http and net tests failing due to race condition

Plus some minor cosmetic corrections

13 years agoFirst pass at tab-completion in the REPL
Trent Mick [Mon, 9 Aug 2010 09:18:32 +0000 (02:18 -0700)]
First pass at tab-completion in the REPL

13 years agoImplement process.title for linux
Ryan Dahl [Wed, 11 Aug 2010 19:44:35 +0000 (12:44 -0700)]
Implement process.title for linux

13 years agoStub out process.title
Ryan Dahl [Fri, 18 Jun 2010 07:26:49 +0000 (00:26 -0700)]
Stub out process.title

13 years agoCygwin: process.execPath fix
Fedor Indutny [Wed, 11 Aug 2010 16:27:41 +0000 (23:27 +0700)]
Cygwin: process.execPath fix

13 years agoRemove -Werror from v8 SConstruct
Ryan Dahl [Wed, 11 Aug 2010 07:23:12 +0000 (00:23 -0700)]
Remove -Werror from v8 SConstruct

13 years ago[dgram] only look up hostname for the requested address family
Rasmus Andersson [Mon, 9 Aug 2010 00:53:55 +0000 (02:53 +0200)]
[dgram] only look up hostname for the requested address family

- [lib/dns.js] dns.lookup takes a new optional argument "family" which
  should be the integer 4, 6, dns.AF_INET or dns.AF_INET6. Passing a
  non-false "family" argument makes c-ares explicitly look up addresses for
  the specified family.

- [test/simple/test-c-ares.js] test explicit address family lookups

13 years agoFix race conditions in tests
Ryan Dahl [Wed, 11 Aug 2010 00:37:30 +0000 (17:37 -0700)]
Fix race conditions in tests

13 years agoClose fd on readFile(emptyfile)
Ryan Dahl [Tue, 10 Aug 2010 21:47:40 +0000 (14:47 -0700)]
Close fd on readFile(emptyfile)

13 years agoUpgrade V8 to 2.3.6
Ryan Dahl [Tue, 10 Aug 2010 16:17:11 +0000 (09:17 -0700)]
Upgrade V8 to 2.3.6

13 years agouppercase request methods
Ryan Dahl [Tue, 10 Aug 2010 04:23:52 +0000 (21:23 -0700)]
uppercase request methods

13 years agoIf no options are given to child_process.spawn, env should default to process.env
Bert Belder [Mon, 9 Aug 2010 01:31:30 +0000 (03:31 +0200)]
If no options are given to child_process.spawn, env should default to process.env

Regression.

13 years agoUnset CLOEXEC on spawn's customFds
Ryan Dahl [Mon, 9 Aug 2010 22:33:57 +0000 (15:33 -0700)]
Unset CLOEXEC on spawn's customFds

13 years agoignore test/fixtures/hello.txt created by some test(s)
Rasmus Andersson [Mon, 9 Aug 2010 00:40:54 +0000 (02:40 +0200)]
ignore test/fixtures/hello.txt created by some test(s)

13 years agoMisc. corrections and consistency changes to documentation.
Brian [Sat, 7 Aug 2010 14:11:59 +0000 (10:11 -0400)]
Misc. corrections and consistency changes to documentation.

13 years agoAdd TODO list items
Ryan Dahl [Sun, 8 Aug 2010 20:12:21 +0000 (13:12 -0700)]
Add TODO list items

13 years agoRemove completed TODO task
Ryan Dahl [Sun, 8 Aug 2010 19:13:20 +0000 (12:13 -0700)]
Remove completed TODO task

13 years agoExport Interface from readline.js
Ryan Dahl [Sun, 8 Aug 2010 18:52:31 +0000 (11:52 -0700)]
Export Interface from readline.js

13 years agospelling correction
Trent Mick [Fri, 6 Aug 2010 18:17:45 +0000 (11:17 -0700)]
spelling correction

13 years agoExpose cwd option to child_process.exec()
Bert Belder [Thu, 5 Aug 2010 04:06:46 +0000 (06:06 +0200)]
Expose cwd option to child_process.exec()

13 years agoNew api for child_process.spawn; ability to set cwd for spawn()ed process
Bert Belder [Thu, 5 Aug 2010 02:15:20 +0000 (04:15 +0200)]
New api for child_process.spawn; ability to set cwd for spawn()ed process

Tests for child_process.spawn() use new API

Test for deprecated child_process.spawn() API

13 years agoRemove module.js - put code into src/node.js
Ryan Dahl [Fri, 6 Aug 2010 19:31:41 +0000 (12:31 -0700)]
Remove module.js - put code into src/node.js

13 years agoAdded console.trace()
Tj Holowaychuk [Thu, 5 Aug 2010 17:47:26 +0000 (10:47 -0700)]
Added console.trace()

13 years agoAdded console.{time,timeEnd}()
Tj Holowaychuk [Thu, 5 Aug 2010 17:32:13 +0000 (10:32 -0700)]
Added console.{time,timeEnd}()

13 years agoconsole formatter appends extra arguments
Tj Holowaychuk [Thu, 5 Aug 2010 17:15:22 +0000 (10:15 -0700)]
console formatter appends extra arguments

This makes the console methods more "browser-like",
for example:

  console.log("foo", "bar", "baz");
  // foo bar baz

but still works with formatting

  console.log("hey %s", "tj", "whats up");

  // hey tj whats up

13 years agoquerystring.parse: handle undefined value properly
cloudhead [Thu, 5 Aug 2010 07:13:40 +0000 (03:13 -0400)]
querystring.parse: handle undefined value properly

13 years agoSupport inspecting objects with console.log
Felix Geisendörfer [Thu, 5 Aug 2010 09:38:11 +0000 (11:38 +0200)]
Support inspecting objects with console.log

If the first parameter passed into console.log() is not a string, all
parameters will be printed as formated by sys.inspect. This change
also affects console.info and console.warn.

13 years agoUpdate AUTHORS
Ryan Dahl [Wed, 4 Aug 2010 23:50:59 +0000 (16:50 -0700)]
Update AUTHORS

13 years agoPrint warning when OpenSSL not found
Ryan Dahl [Wed, 4 Aug 2010 23:07:10 +0000 (16:07 -0700)]
Print warning when OpenSSL not found

13 years agoStandardise module load order for native and registered file extensions.
Nick Stenning [Wed, 4 Aug 2010 21:55:24 +0000 (22:55 +0100)]
Standardise module load order for native and registered file extensions.

This patch standardises the load order for modules. Highest priority is trying to load exactly the file the user specified, followed by native extensions, followed by registered extra extensions, etc.

In full, if we require('foo') having registered '.coffee' as an alternative extension, we try and load the following files in order:

    foo
    foo.js
    foo.node
    foo.coffee
    foo/index.js
    foo/index.node
    foo/index.coffee

13 years agoDon't attempt to load a directory.
Nick Stenning [Wed, 4 Aug 2010 20:45:52 +0000 (21:45 +0100)]
Don't attempt to load a directory.

This patch replaces the path.exists check for module loading with a call to
fs.statSync (or fs.stat for require.async) which ensures that it's not trying
to load a directory.

13 years agobump version v0.1.103
Ryan Dahl [Wed, 4 Aug 2010 19:04:12 +0000 (12:04 -0700)]
bump version

13 years agoUpgrade V8 to 2.3.5
Ryan Dahl [Wed, 4 Aug 2010 18:46:42 +0000 (11:46 -0700)]
Upgrade V8 to 2.3.5

13 years agoFix toString('base64') bug
Ryan Dahl [Wed, 4 Aug 2010 18:38:42 +0000 (11:38 -0700)]
Fix toString('base64') bug

Thanks to Stepan Stolyarov for the test case.

13 years agoAdd node_version.h to install
Samuel Shull [Wed, 4 Aug 2010 05:25:17 +0000 (01:25 -0400)]
Add node_version.h to install

13 years agoRevert "Expose the V8 debug object process.debug"
Ryan Dahl [Wed, 4 Aug 2010 17:38:19 +0000 (10:38 -0700)]
Revert "Expose the V8 debug object process.debug"

This reverts commit d9fbb8a58071e339711e8c0ceeb31de5a645fd42.

13 years agoAllow null context in Script
Ryan Dahl [Wed, 4 Aug 2010 17:20:40 +0000 (10:20 -0700)]
Allow null context in Script

13 years agoSetBlocking should set blocking, not toggle it
isaacs [Wed, 4 Aug 2010 01:39:43 +0000 (18:39 -0700)]
SetBlocking should set blocking, not toggle it

13 years agoWhen the parent's stdio FDs are passed to a child, make them temporarily blocking.
isaacs [Tue, 3 Aug 2010 22:57:44 +0000 (15:57 -0700)]
When the parent's stdio FDs are passed to a child, make them temporarily blocking.

Many programs do not handle non-blocking stdio very well.  In particular,
man and less have serious problems with this, and since stdout isn't being
flushed after each write, the output jumps about on the screen as you page
down.  Programs that do use non-blocking stdio will set that flag themselves
(as node does).

This puts the stdio file descriptors into blocking mode before sharing them
with the child process, so that one could spawn a vim subprocess, or some
other program that depends on blocking IO.

13 years agoUpgrade V8 to 2.3.4
Ryan Dahl [Tue, 3 Aug 2010 17:33:16 +0000 (10:33 -0700)]
Upgrade V8 to 2.3.4

13 years agoClient.onend: Anticipate that the HTTP parser object is uninitialized when the client...
Ben Noordhuis [Mon, 2 Aug 2010 09:59:58 +0000 (11:59 +0200)]
Client.onend: Anticipate that the HTTP parser object is uninitialized when the client setup failed.

13 years agoExpose the V8 debug object process.debug
Ryan Dahl [Mon, 2 Aug 2010 07:39:09 +0000 (00:39 -0700)]
Expose the V8 debug object process.debug

Add one duplicate test from V8, just to make sure it works.

13 years agoImplement keep-alive for http.Client
Mikeal Rogers [Mon, 2 Aug 2010 05:22:20 +0000 (22:22 -0700)]
Implement keep-alive for http.Client

Send the 'Connection: keep-alive' header in your request to enable.

13 years agoAllow signals to be used with process.on in addition to process.addListener.
Brian [Sun, 1 Aug 2010 00:13:47 +0000 (20:13 -0400)]
Allow signals to be used with process.on in addition to process.addListener.

13 years agoDon't let path.normalize get above the root.
isaacs [Sun, 1 Aug 2010 00:55:28 +0000 (17:55 -0700)]
Don't let path.normalize get above the root.

Any path.join or path.normalize that starts with a / will not go "above" that after normalization.  This is important because /../foo is almost *always* some sort of error, and doesn't match the corollary in sh: `cd $p; pwd`

At the worse, this can be a vector for exploits, since a static file server might do path.join(docroot, path.normalize("/"+req)) to get the file.  If the normalized request path could be something like "/../../../etc/passwd" then bad things could happen.

13 years agoremove node::CheckBreak in favor of using the v8 debugger js object
Danny Coates [Sun, 1 Aug 2010 22:46:48 +0000 (16:46 -0600)]
remove node::CheckBreak in favor of using the v8 debugger js object

13 years agoUpgrade http-parser for clang compat
Ryan Dahl [Sat, 31 Jul 2010 21:32:59 +0000 (14:32 -0700)]
Upgrade http-parser for clang compat

13 years ago[v8] Remove global.print from v8natives.js (fixes issue 791)
Ryan Dahl [Fri, 30 Jul 2010 19:20:32 +0000 (12:20 -0700)]
[v8] Remove global.print from v8natives.js (fixes issue 791)

Review URL: http://codereview.chromium.org/3045016

13 years agoFix style
Ryan Dahl [Fri, 30 Jul 2010 17:54:43 +0000 (10:54 -0700)]
Fix style

13 years agoBuffer: graciously handle padding in base64-encoded input.
Ben Noordhuis [Fri, 30 Jul 2010 12:01:03 +0000 (14:01 +0200)]
Buffer: graciously handle padding in base64-encoded input.

13 years agoFix email address in AUTHORS file
Ryan Dahl [Fri, 30 Jul 2010 16:42:36 +0000 (09:42 -0700)]
Fix email address in AUTHORS file

13 years agoFix ending \0 in base64 decoding
Ryan Dahl [Thu, 29 Jul 2010 21:48:07 +0000 (14:48 -0700)]
Fix ending \0 in base64 decoding

13 years agoBuffer: adjust buffer size so the base64-decoded input fits snugly.
Ben Noordhuis [Wed, 28 Jul 2010 12:20:23 +0000 (14:20 +0200)]
Buffer: adjust buffer size so the base64-decoded input fits snugly.

Stops Valgrind from complaining about uninitialized memory access.

13 years agoFix --debug-brk; hacky solution
Ryan Dahl [Wed, 28 Jul 2010 03:36:58 +0000 (20:36 -0700)]
Fix --debug-brk; hacky solution

13 years agoAdd todos
Ryan Dahl [Tue, 27 Jul 2010 19:19:08 +0000 (12:19 -0700)]
Add todos

13 years agoClarify string encoding docs
Ryan Dahl [Tue, 27 Jul 2010 19:16:48 +0000 (12:16 -0700)]
Clarify string encoding docs

13 years agoGlobalize the Buffer object
Ryan Dahl [Tue, 27 Jul 2010 17:58:45 +0000 (10:58 -0700)]
Globalize the Buffer object

13 years agoOnly one line break before stacktrace
Ryan Dahl [Tue, 27 Jul 2010 02:08:21 +0000 (19:08 -0700)]
Only one line break before stacktrace

13 years agoUse kqueue on recent macintosh builds
Ryan Dahl [Tue, 27 Jul 2010 02:07:31 +0000 (19:07 -0700)]
Use kqueue on recent macintosh builds

13 years agoCheck for socket on Unix domain connect.
Matt Ranney [Tue, 27 Jul 2010 01:38:49 +0000 (18:38 -0700)]
Check for socket on Unix domain connect.

Change scope to context in REPL docs.

13 years agoUpgrade http-parser
Ryan Dahl [Mon, 26 Jul 2010 22:01:54 +0000 (15:01 -0700)]
Upgrade http-parser

support for
- long messages
- spaces in header fields

13 years agoUpgrade V8 to 2.3.3
Ryan Dahl [Mon, 26 Jul 2010 21:26:42 +0000 (14:26 -0700)]
Upgrade V8 to 2.3.3

13 years agoConstify read-only global data
Benjamin Kramer [Sat, 24 Jul 2010 13:29:11 +0000 (15:29 +0200)]
Constify read-only global data

Also silences a compiler warning about deprecated conversion from const
char* to char*.

13 years agoAdd missing parentheses
Benjamin Kramer [Fri, 23 Jul 2010 20:20:18 +0000 (22:20 +0200)]
Add missing parentheses

& has higher precedence than ==, making this a noop. Use the less
error-prone S_IS* macros instead. Found by clang.

13 years agoFix addrlen for unix_dgram sockets
Benjamin Kramer [Sat, 17 Jul 2010 15:45:47 +0000 (17:45 +0200)]
Fix addrlen for unix_dgram sockets

The old definition was off by one byte on BSD. Also simplify
ADDRESS_TO_JS because sun_path is always zero-terminated now.

13 years agoAdd write() callback TODO item
Ryan Dahl [Mon, 26 Jul 2010 19:42:59 +0000 (12:42 -0700)]
Add write() callback TODO item

13 years agoSupport for HOME and END in REPL.
Chandra Sekar S [Mon, 26 Jul 2010 06:38:37 +0000 (12:08 +0530)]
Support for HOME and END in REPL.

13 years agoFix DNS example in docs
Ryan Dahl [Mon, 26 Jul 2010 17:35:45 +0000 (10:35 -0700)]
Fix DNS example in docs

13 years agobump version v0.1.102
Ryan Dahl [Mon, 26 Jul 2010 06:39:58 +0000 (23:39 -0700)]
bump version

13 years agoAdd reference to base64 encoding
Ryan Dahl [Mon, 26 Jul 2010 06:21:39 +0000 (23:21 -0700)]
Add reference to base64 encoding

13 years agoAdded ability to pass offset to buffer write and toString methods as a string, i...
Dmitry Baranovskiy [Thu, 22 Jul 2010 11:51:26 +0000 (21:51 +1000)]
Added ability to pass offset to buffer write and toString methods as a string, i.e. '2' and encoding as anything

13 years agoFixed format, so it wouldn’t blow up if %d argument is null or undefined + ensure...
Dmitry Baranovskiy [Thu, 22 Jul 2010 11:26:55 +0000 (21:26 +1000)]
Fixed format, so it wouldn’t blow up if %d argument is null or undefined + ensure that numbers will be numbers

14 years agoImplement buffer.write for base64
Ryan Dahl [Fri, 23 Jul 2010 23:36:47 +0000 (16:36 -0700)]
Implement buffer.write for base64

There might be an off-by-one on the returned value.

14 years agoImplement buffer.toString('base64')
Ryan Dahl [Fri, 23 Jul 2010 20:52:44 +0000 (13:52 -0700)]
Implement buffer.toString('base64')

14 years agoFix case in docs
Ryan Dahl [Fri, 23 Jul 2010 19:14:51 +0000 (12:14 -0700)]
Fix case in docs

14 years agoFix dirname so that dirname('/a/b/') -> '/a', like sh's does.
isaacs [Fri, 23 Jul 2010 07:41:28 +0000 (00:41 -0700)]
Fix dirname so that dirname('/a/b/') -> '/a', like sh's does.

Before there was this comment:
  Can't strip trailing slashes since module.js incorrectly
  thinks dirname('/a/b/') should yield '/a/b' instead of '/a'.
But now, such thinking is corrected.

14 years agoBuffer for Cipher, Decipher, Hmac, Sign and Verify
Andrew Naylor [Fri, 23 Jul 2010 00:20:02 +0000 (01:20 +0100)]
Buffer for Cipher, Decipher, Hmac, Sign and Verify

14 years agoRemove Werror from SConstruct
Ryan Dahl [Wed, 21 Jul 2010 19:43:19 +0000 (12:43 -0700)]
Remove Werror from SConstruct

14 years agoUpgrade V8 to 2.3.2
Ryan Dahl [Wed, 21 Jul 2010 19:31:43 +0000 (12:31 -0700)]
Upgrade V8 to 2.3.2

14 years agoTODO items
Ryan Dahl [Wed, 21 Jul 2010 18:44:47 +0000 (11:44 -0700)]
TODO items

14 years agoSupport for reading byte ranges from files using fs.createReadStream.
Chandra Sekar S [Tue, 20 Jul 2010 12:46:27 +0000 (18:16 +0530)]
Support for reading byte ranges from files using fs.createReadStream.

14 years agoFix Buffer.toString() on 0-length slices.
Peter Griess [Tue, 20 Jul 2010 22:23:30 +0000 (17:23 -0500)]
Fix Buffer.toString() on 0-length slices.

- Buffer.toString('ascii', 0, 0) incorrectly returns the entire contents
  of the buffer. Fix this.
- Provide similar behavior to Buffer.write() and Buffer.copy() when
  dealing with 0-length in valid and invalid byte ranges.

14 years agoAdd parenthesis to NODE_VERSION_AT_LEAST
Sam Shull [Tue, 20 Jul 2010 19:41:39 +0000 (12:41 -0700)]
Add parenthesis to NODE_VERSION_AT_LEAST

14 years agoAdded process.binding('stdio').getRows()
Robert Keizer [Tue, 20 Jul 2010 19:30:33 +0000 (14:30 -0500)]
Added process.binding('stdio').getRows()

14 years agoSupport including modules that don't have an extension.
isaacs [Tue, 20 Jul 2010 00:54:49 +0000 (17:54 -0700)]
Support including modules that don't have an extension.

This way, require("/foo") will work if there is a "foo.js", or a file named
simply "foo" with no extension.

14 years agoSpecify env differently in execFile
Ryan Dahl [Tue, 20 Jul 2010 03:08:33 +0000 (20:08 -0700)]
Specify env differently in execFile

Callbacks should always be the last argument.

14 years agoConsistency changes in api docs
Brian [Mon, 19 Jul 2010 20:59:09 +0000 (16:59 -0400)]
Consistency changes in api docs

14 years agoCache modules based on filename rather than ID
isaacs [Thu, 15 Jul 2010 17:41:40 +0000 (10:41 -0700)]
Cache modules based on filename rather than ID

This is ever so slightly less efficient than caching based on ID, since the
filename has to be looked up before we can check the cache.  However, it's
the most minimal approach possible to get this change in place.  Since
require() is a blocking startup-time operation anyway, a bit of slowness is
not a huge problem.

A test involving require.paths modification and absolute loading. Here's the
gist of it.

Files: /p1/foo.js /p2/foo.js

  1. Add "/p1" to require.paths.
  2. foo1 = require("foo")
  3. assert foo1 === require("/p1/foo") (fail)
  4. Remove /p1 from require.paths.
  5. Add /p2 to require.paths.
  6. foo2 = require("foo")
  7. assert foo1 !== foo2 (fail)
  8. assert foo2 === require("/p2/foo") (fail)

It's an edge case, but it affects how dependencies are mapped by npm.
If your module requires foo-1.2.3, and my module requires foo-2.3.4,
then you should expect to have require("foo") give you foo-1.2.3, and
I should expect require("foo") to give me foo-2.3.4.  However, with
module ID based caching, if your code loads *first*, then your "foo"
is THE "foo", so I'll get your version instead of mine.

It hasn't yet been a problem, but only because there are so few
modules, and everyone pretty much uses the latest version all the
time.  But as things start to get to the 1.x and 2.x versions, it'll
be an issue, I'm sure.  Dependency hell isn't fun, so this is a way to
avoid it before it strikes.

14 years agoDocument setuid/setgid sync resolution capability.
Peter Griess [Mon, 19 Jul 2010 15:48:58 +0000 (10:48 -0500)]
Document setuid/setgid sync resolution capability.

14 years agoquerystring: Removing typecasting of numeric strings to numbers
Micheil Smith [Mon, 19 Jul 2010 08:55:11 +0000 (18:55 +1000)]
querystring: Removing typecasting of numeric strings to numbers

The tests did not accurately test for a strict equality, meaning that the
number == to the string.

14 years agoquerystring.js: JSLint warnings fixed
Jan Kassens [Sun, 18 Jul 2010 19:09:13 +0000 (21:09 +0200)]
querystring.js: JSLint warnings fixed

14 years agoquerystring doc fix
Jan Kassens [Sat, 17 Jul 2010 11:20:20 +0000 (13:20 +0200)]
querystring doc fix

14 years agoquerystring.stringify is now more solid
Jan Kassens [Sun, 18 Jul 2010 20:16:43 +0000 (22:16 +0200)]
querystring.stringify is now more solid

* handles NaN and Infinity
* works with arrays from other contexts

14 years agoAdd todo item
Ryan Dahl [Mon, 19 Jul 2010 17:35:59 +0000 (10:35 -0700)]
Add todo item

14 years agoFix for issue #214
Ryan Dahl [Mon, 19 Jul 2010 17:32:56 +0000 (10:32 -0700)]
Fix for issue #214

14 years agoadded test for Issue #214
Benjamin Fritsch [Mon, 19 Jul 2010 06:04:22 +0000 (08:04 +0200)]
added test for Issue #214

14 years agoFix style in readline
Ryan Dahl [Mon, 19 Jul 2010 17:16:20 +0000 (10:16 -0700)]
Fix style in readline

14 years agoSupport DEL in the REPL.
Jérémy Lal [Sun, 18 Jul 2010 23:12:27 +0000 (01:12 +0200)]
Support DEL in the REPL.

14 years agoApple's SUN_LEN is broken, override
Ryan Dahl [Sun, 18 Jul 2010 06:26:58 +0000 (23:26 -0700)]
Apple's SUN_LEN is broken, override