Commit Graph

579 Commits (d5214b3627fb317349736757263c86804a057149)

Author SHA1 Message Date
Ryan Dahl 635986e433 Add failing uncaughtException test
FIXME
2010-08-30 12:02:22 -07:00
Johan Euphrosine e49be4768b add readline support for meta-d 2010-08-30 10:26:51 -07:00
Russell Haering 37b6e10684 Pass an error to the sys.pump callback if one occurs
- Add test case for pumping from unreadable stream.
- Document the sys.pump error handling behavior
2010-08-30 10:23:48 -07:00
Benjamin Thomas 57642e2349 Fix process.nextTick so thrown errors don't confuse it.
If the function for a process.nextTick throws an error, then the
splice() never removes that function from the nextTickQueue array.  This
makes sure the functions that have been run in _tickCallback get removed
regardless of errors.

Also add a test for this.
2010-08-27 22:13:50 -07:00
Ryan Dahl 4fdebab005 Safe constructor: net.Server, net.Stream 2010-08-27 15:38:46 -07:00
Ryan Dahl f86ad1693f Safe Constructor: Buffer 2010-08-27 15:23:51 -07:00
Ryan Dahl 44a287987e Safe constructors: http.Server and http.Client 2010-08-27 13:58:52 -07:00
Johan Euphrosine 51224f12ca add test for readline putty support 2010-08-23 10:25:55 -07:00
Johan Euphrosine 748469c71c add readline support for meta-f and meta-b 2010-08-23 01:47:41 -07:00
Johan Euphrosine fd3e84499e add home/end support in rxvt and readline tests 2010-08-23 01:46:14 -07:00
Johan Euphrosine bedca2e7a9 add tests for console.log arguments handling 2010-08-22 12:34:00 -07:00
Ryan Dahl 2982e75a0b set-cookies header is an array of values. always 2010-08-21 16:34:38 -07:00
Ryan Dahl 60b93cca6d Fix race conditions in test-dgram-multicast.js 2010-08-19 18:49:27 -07:00
Herbert Vojčík 28b21d15c3 Fix undefined_reference_in_new_context test for own-context module loader. 2010-08-18 14:06:30 -07:00
Herbert Vojčík 2b126da395 Tests for behaviour of 'global'. 2010-08-18 12:08:39 -07:00
Herbert Vojčík 9253333850 Fix registerExtension for NODE_MODULE_CONTEXTS
Fix of registerExtension-produced non-string module loading with own
context. Plus finishing touches to the test.
2010-08-18 11:46:37 -07:00
Herbert Vojčík cf2b206a8e More changes to tests so they really work under context module loader.
Plus, getting rid of test/common.js defining things in global.
2010-08-17 08:41:05 -07:00
Herbert Vojčík 32e309440f Fix of 'sys.common.debug' calls in tests. 2010-08-17 08:08:36 -07:00
Marco Rogers 6744e59e46 detect 0 length fs writes with tests 2010-08-16 23:57:01 -07:00
Ryan Dahl 4593c04959 Implement net.Server.maxConnections
Simplify EMFILE behavior.
2010-08-15 14:01:55 -07:00
Ryan Dahl a8c2bb41af Fix tests 2010-08-13 08:55:42 -07:00
Ryan Dahl 03123435e0 Remove platform specific asserts 2010-08-13 08:13:54 -07:00
Bert Belder 0e8d858aba One more test with a race condition fixed 2010-08-13 07:18:38 -07:00
Rasmus Andersson 758f12f34c added read and write support for process.title Darwin
This will only manipulate the OS X-level process name, not the title shown
in e.g. ps.
2010-08-12 16:23:41 -07:00
Rasmus Andersson 8d5e05668b Added support for multiple listeners to DNS multicast datagrams.
Some platforms require SO_REUSEPORT to be set for the socket.
2010-08-11 19:02:20 -07:00
Bert Belder 7059be19ec Fix http and net tests failing due to race condition
Plus some minor cosmetic corrections
2010-08-11 17:27:44 -07:00
Ryan Dahl 9395786d11 Fix race conditions in tests 2010-08-10 17:48:37 -07:00
Bert Belder aaa1f451e6 Expose cwd option to child_process.exec() 2010-08-06 13:38:41 -07:00
Bert Belder 94914135df 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
2010-08-06 13:37:30 -07:00
Ryan Dahl d408de87fc Remove module.js - put code into src/node.js 2010-08-06 12:34:02 -07:00
cloudhead fe3e419687 querystring.parse: handle undefined value properly 2010-08-05 10:46:28 -07:00
Nick Stenning 0a3eff8021 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
2010-08-04 16:03:08 -07:00
Nick Stenning 78520ba482 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.
2010-08-04 15:55:47 -07:00
Ryan Dahl 7db5c8a10d Fix toString('base64') bug
Thanks to Stepan Stolyarov for the test case.
2010-08-04 11:38:48 -07:00
Ryan Dahl adec544fdd Revert "Expose the V8 debug object process.debug"
This reverts commit d9fbb8a580.
2010-08-04 10:38:19 -07:00
Ryan Dahl 31b59400f8 Allow null context in Script 2010-08-04 10:20:40 -07:00
Ryan Dahl d9fbb8a580 Expose the V8 debug object process.debug
Add one duplicate test from V8, just to make sure it works.
2010-08-02 00:46:09 -07:00
Mikeal Rogers 3214116be6 Implement keep-alive for http.Client
Send the 'Connection: keep-alive' header in your request to enable.
2010-08-01 22:34:17 -07:00
isaacs 65037eeb32 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.
2010-08-01 20:20:17 -07:00
Ben Noordhuis f72ac17c89 Buffer: graciously handle padding in base64-encoded input. 2010-07-30 10:49:00 -07:00
Ryan Dahl f291fbc8a7 Fix ending \0 in base64 decoding 2010-07-29 14:52:40 -07:00
Ben Noordhuis 95638c9b0d Buffer: adjust buffer size so the base64-decoded input fits snugly.
Stops Valgrind from complaining about uninitialized memory access.
2010-07-28 11:37:23 -07:00
Dmitry Baranovskiy 8ab3c3e7c3 Added ability to pass offset to buffer write and toString methods as a string, i.e. '2' and encoding as anything 2010-07-25 20:16:37 -07:00
Ryan Dahl 2c1ca4078d Implement buffer.write for base64
There might be an off-by-one on the returned value.
2010-07-23 16:36:52 -07:00
Ryan Dahl 528015e0d8 Implement buffer.toString('base64') 2010-07-23 13:52:44 -07:00
isaacs f0f247d7e5 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.
2010-07-23 09:08:49 -07:00
Chandra Sekar S f5f7cb9264 Support for reading byte ranges from files using fs.createReadStream. 2010-07-21 11:33:35 -07:00
Peter Griess 56f200af5d 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.
2010-07-20 15:38:10 -07:00
isaacs d75b63bc3c 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.
2010-07-20 10:26:24 -07:00
Ryan Dahl 7067a7155f Specify env differently in execFile
Callbacks should always be the last argument.
2010-07-19 20:08:35 -07:00