0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

1620 Commits

Author SHA1 Message Date
Tj Holowaychuk
528c28587f cluster: Add some docs, improve cluster.isWorker()
Fixes #1949.
2011-10-26 16:42:00 -07:00
Ryan Dahl
c5d54010bc node cluster is now a module instead of CLI interface
This is to make room for master process plugins instead of adding CLI
options as proposed in #1879.
2011-10-26 13:50:53 -07:00
Nathan Rajlich
ebefe77bc0 More bulletproof util.inspect() function.
Use the *real* versions of the Date and RegExp functions, from the
prototype. This defends against code like:

  var d = new Date()
  d.toUTCString = null
  util.inspect(d)
    // TypeError: toUTCString is not a function

Fixes #1944.
2011-10-27 04:58:34 +09:00
Nathan Rajlich
2dbb470ea1 Don't use instanceof in lib/util.js "is" checks.
While using `instanceof`, these functions could easily be faked with something
like:  Object.create(Date.prototype)

So let's just not use it at all. A little slower, but these functions are only
used in the REPL / for debugging so it's OK.

Fixes #1941.
Fixes #1942.
2011-10-27 04:33:24 +09:00
Nathan Rajlich
b8f3e18a5d Export the type checking functions from util.js.
As per discussion at:
http://groups.google.com/group/nodejs-dev/browse_thread/thread/b08970166e4670cf
2011-10-27 03:38:29 +09:00
koichik
cbcaeedba9 tls: add address(), remoteAddress/remotePort
Fixes #758.
Fixes #1055.
2011-10-27 00:28:16 +09:00
koichik
0e8a55d2a2 tls: does not emit 'end' from EncryptedStream
de09168 and 4cdf9d4 breaks `test/pummel/test-https-large-response.js`.
It is never finished.

Fixes #1936.
2011-10-27 00:18:29 +09:00
Nathan Rajlich
58cb0fa639 Directly export the Stream constructor.
Also setting up a circular reference back to the
stream as `Stream.Stream`, for backwards-compatibility.

Fixes #1933
2011-10-24 15:45:35 -07:00
Ryan Dahl
239b3d62de Remove resume and pause events
Too complex; unnecessary.
2011-10-24 13:23:59 -07:00
isaacs
4c5751ba97 Close #1929 zlib Respond to 'resume' events properly 2011-10-24 12:55:45 -07:00
Maciej Małecki
7ee29d1d5b net: Server.listen, Server.close and Socket.connect return this
Just a syntactic sugar for doing, for example:

    var server = net.createServer(function (c) {
      c.end('goodbye, cruel world!\r\n');
      server.close().on('close', function () {
        console.log('really, goodbye!');
      });
    }).listen(1337);

Fixes #1922.
2011-10-24 22:19:42 +09:00
seebees
216570b5e1 Lint 2011-10-22 14:14:40 +09:00
seebees
1ead20f274 remove auth from host
Fixes #1626
2011-10-22 14:14:40 +09:00
seebees
005d607aed http.request(url.parse(x))
http2.js

protocols object to store defaults for http and https, and use as a switch for supported protocols.
options.hostname > options.host > 'localhost'
if I have an options.auth element and I do not have an Authorization header, I do basic auth.
http.request collapses to new ClientRequest since the defaults are handled by the protocol object

test-http-url.parse*

Fixes #1390

Conflicts:

	lib/http2.js
2011-10-22 14:14:40 +09:00
seebees
be4576de7a url.resolveObject(url.parse(x), y) == url.parse(url.resolve(x, y));
added a .path property = .pathname + .search for use with http.request

And tests to verify everything.
With the tests, I changed over to deepEqual, and I would note the comment on the test
['.//g', 'f:/a', 'f://g'], which I think is a fundamental problem

This supersedes pull 1596
2011-10-22 14:14:39 +09:00
Nathan Rajlich
bdb9d09aef Print out undefined on the REPL when returned.
util.inspect() has a special case for "undefined", so it's nice to be able to
distinguish visually that undefined is the result of an expression.
2011-10-22 14:02:35 +09:00
Ben Noordhuis
ac379b3be1 net: bring back .setNoDelay() and .setKeepAlive() 2011-10-21 18:09:23 -07:00
Ryan Dahl
493d3b9f7c Merge remote branch 'origin/v0.4'
Conflicts:
	ChangeLog
	Makefile
	deps/libev/wscript
	doc/index.html
	doc/template.html
	lib/net.js
	src/node_version.h
	src/platform_cygwin.cc
	test/pummel/test-net-write-callbacks.js
	test/simple/test-buffer.js
2011-10-21 18:02:30 -07:00
Ryan Dahl
d5a21a29f8 getaddrinfo returns ENOTFOUND for invalid domain names
change test-http-dns-error to reflect this.
2011-10-21 15:19:53 -07:00
Ryan Dahl
de09168e5a Emit 'end' from crypto streams on close
Fixes test/simple/test-tls-peer-certificate.js on Windows

Patch from bnoordhuis.

See also 75a0cf970f
2011-10-21 13:16:41 -07:00
isaacs
2d02e6a992 Add useGlobal flag for standard node repl 2011-10-21 13:02:49 -07:00
isaacs
caf70f5e94 Revert "Don't use a separate context for the repl."
This reverts commit b70fed48a7.
2011-10-21 13:00:37 -07:00
Ben Noordhuis
84d0b1bcc5 http: improve http parser bindings
Speeds up HTTP benchmarks by 10% on average.
2011-10-20 19:19:02 -07:00
Ryan Dahl
c83dda89a4 dns.lookup uses cares_wrap::GetAddrInfo 2011-10-20 18:03:02 -07:00
Nathan Rajlich
95d530f2b4 repl: print out undefined
util.inspect() has a special case for "undefined", so it's nice to be able to
distinguish visually that undefined is the result of an expression.
2011-10-20 08:41:33 -07:00
Fedor Indutny
b43eb9678b debugger: fix backtrace err handling 2011-10-20 08:37:51 -07:00
isaacs
b70fed48a7 Don't use a separate context for the repl.
Fix #1484
Fix #1834
Fix #1482
Fix #771

It's been a while now, and we've seen how this separate context thing
works.  It constantly confuses people, and no one actually uses '.clear'
anyway, so the benefit of that feature does not justify the constant
WTFery.

This makes repl.context actually be a getter that returns the global
object, and prints a deprecation warning.  The '.clear' command is gone,
and will report that it's an invalid repl keyword.  Tests updated to
allow the require, module, and exports globals, which are still
available in the repl just like they were before, by making them global.
2011-10-18 18:18:32 -07:00
Ryan Dahl
6cc0c9e6a9 Remove superfluous nextTick during server binding
This breaks fork().send({}, server._handle) after server.listen() because
server._handle is not set.
2011-10-18 15:12:18 -07:00
Ryan Dahl
d77ce4b998 Fixes #1860. Remove process.writeError
Breaks a few tests in "make test-message"
2011-10-18 13:12:50 -07:00
Yoshihiro Kikuchi
f90ba61478 http: tiny fix in http.js
Fixes #1885.
2011-10-17 01:14:45 +09:00
koichik
d6191f593d net: fix error handling in listen()
Fixes #1894.
2011-10-16 01:30:19 +09:00
koichik
68cc173c6d tls: The TLS API is inconsistent with the TCP API
Add 'secureConnect' event to tls.CleartextStream.

Fixes #1467.
2011-10-15 19:27:21 +09:00
Ben Noordhuis
0b92fa0e93 net: fix connect queue bugs
This commit fixes two bugs in the handling of write requests when the connect()
call is still in progress.

1. The deferred write request's size was counted twice towards `.bytesWritten`.

2. The callback was not called. After connecting, `Socket.write()` was called
   with three arguments (data, encoding, cb) but it ignored the third argument.

Coincidentally fixes test/simple/test-net-connect-buffer.js.
2011-10-15 03:34:09 +02:00
Ben Noordhuis
6df574b744 net: properly account multi-byte chars in .bytesWritten 2011-10-15 03:24:34 +02:00
koichik
19a855382c tls: requestCert unusable with Firefox and Chrome
Fixes #1516.
2011-10-15 00:54:46 +09:00
koichik
a09b747f30 child_process.fork: don't modify args
Fixes #1888.
2011-10-15 00:15:38 +09:00
isaacs
59a5262041 Fix #1882 zlib Update 'availOutBefore' value, and test 2011-10-13 16:47:51 -07:00
Simen Brekken
4b0e36810a net: register net.Server callback only once
Only register once for listening when passing a callback to Server.listen(),
this prevents servers recycled using close() from invoking the callback when
Server.listen() is called later.
2011-10-13 16:09:14 +02:00
Ryan Dahl
3a34972672 Fix test-http-conn-reset.js on OSX 2011-10-12 17:31:49 -07:00
Ryan Dahl
7b4370e5f8 Fix test/pummel/test-watch-file.js 2011-10-12 16:19:46 -07:00
Ryan Dahl
651b8a06d6 Fix test/pummel/test-exec.js 2011-10-12 16:12:24 -07:00
Daniel Ennis
59be975322 Improve IPC performance.
Reading of JSON data off the buffer, 10-15% performance increase.

Fixes #1864.
2011-10-12 15:06:51 -07:00
Ryan Dahl
25ff181300 Revert some changes made in 12486a6
Some of the perf improvements from many-writes-fix branch were accidentally
undone in that commit. This puts them back in.
2011-10-12 12:49:58 -07:00
Ryan Dahl
87339a22b1 introduce node cluster 2011-10-12 02:58:35 -07:00
Ryan Dahl
cdf5d91fe5 Remove tty_legacy 2011-10-11 13:41:33 -07:00
Ryan Dahl
71cce3f45b Remove dgram_legacy 2011-10-11 13:26:41 -07:00
Ryan Dahl
58e892dadd Remove dns_legacy 2011-10-11 13:21:30 -07:00
Ryan Dahl
96e423a665 Remove child_process_legacy 2011-10-11 13:16:33 -07:00
Ryan Dahl
be0bb2dc13 Remove net_legacy timers_legacy 2011-10-11 13:11:54 -07:00
Ryan Dahl
8c738fa90c child_process.fork: don't overwrite env
thanks to Malte-Thorben Bruns for pointing this out
2011-10-10 14:49:02 -07:00
Ryan Dahl
982b19dbd7 Adjust listenFD deprecation message. Remove test. 2011-10-10 14:24:56 -07:00
Ryan Dahl
e6092f337c tty.WritableStream should be writable 2011-10-10 13:41:04 -07:00
Ryan Dahl
7cf787a2d1 Upgrade libuv to 5656e3
This modifies the TTYWrap constructor to add another argument specifying if
it's a readable or writable TTY . That is stdin or stdout. If a TTYWrap is
not readable then writes to it are blocking.

This makes process.stdout blocking.
2011-10-10 13:33:45 -07:00
Ryan Dahl
12486a6437 Change API for sending handles
Does not support sending net.Server objects only raw TCPWrap objects.
2011-10-07 16:43:55 -07:00
Ryan Dahl
26c08a3f35 Do load balancing test in test-child-process-fork2. 2011-10-07 13:58:55 -07:00
Bert Belder
153629c99a Some small optimizations 2011-10-07 13:38:23 -07:00
Ryan Dahl
29ec850478 Simplify arg parsing in String.write 2011-10-07 13:38:23 -07:00
Ben Noordhuis
1bb820a339 net: remove unconditional getpeername() call
Speeds up http_simple benchmark by about 1.0%
2011-10-07 13:38:23 -07:00
Bert Belder
ed65b7b375 Simplify writeReq handling in net_uv 2011-10-07 13:38:23 -07:00
talltyler
10f97f9424 Fixing #1774 about issues when running node with --harmony_block_scoping v8 option
Fixes #1837.
2011-10-08 04:33:10 +09:00
Bert Belder
fcad5e35fd Black hole tcp reads after destroy() 2011-10-07 19:03:23 +02:00
Ryan Dahl
899358e797 Add test-child-process-fork2 and fixes to make it work 2011-10-07 04:03:47 -07:00
Ryan Dahl
b413c77583 Support sending handles to other processes
Needs test.
2011-10-07 01:30:28 -07:00
Ryan Dahl
26c5905a99 Reimplement child_process.fork
Fixes test/simple/test-child-process-fork.js
2011-10-07 00:57:41 -07:00
Colton Baker
87286cc737 Fixed a lot of jslint errors.
Fixes #1831
2011-10-05 18:51:06 -07:00
Ben Noordhuis
bc7cfd7cd7 http: remove legacy http library 2011-10-04 20:51:34 +02:00
Maciej Małecki
8c8d518723 assert: Make assert module an assert.ok function
Code can be written:

    var assert = require('assert');
    assert(true);

instead of:

    var assert = require('assert');
    assert.ok(true);
2011-10-02 02:25:52 +02:00
Fedor Indutny
360ce526fd debugger: watch, unwatch, watchers
Fixes #1800.
2011-09-30 13:22:56 -07:00
koichik
4cdf9d4158 tls: Improve TLS flow control
Fixes #1775.
2011-09-30 15:44:45 +09:00
Ryan Dahl
dea49e3d19 net: Fix string-concat hot path bug
Also removes functionality added in f9fec3a2d6
because it changes API. (That patch shouldn't have been added anyway.)
2011-09-28 17:49:33 -07:00
Fedor Indutny
1b8b097fad debugger: refactor, no more res.success checks
Fixes #1779.
2011-09-28 11:40:51 -07:00
Bert Belder
81425598db Enable console colors on windows by default 2011-09-27 13:03:29 -07:00
Ryan Dahl
e1dc6e6d73 Bind uv_tty_get_winsize 2011-09-27 13:03:28 -07:00
Ryan Dahl
74b6426ec6 Initial pass at new TTY js layer
This breaks Windows.
2011-09-27 13:02:11 -07:00
Fedor Indutny
95866a6445 debugger: export port
Fixes test-debugger-client.js

Fixes #1782.
2011-09-27 12:49:03 -07:00
Ben Noordhuis
c4eaf7e5a9 crypto: implement randomBytes() and pseudoRandomBytes() 2011-09-27 20:27:53 +02:00
Fedor Indutny
67706b8bb7 Export disableColors from repl, share with debugger 2011-09-27 11:58:02 +02:00
Fedor Indutny
f4124e18cb debugger: setBreakpoint('fn()')
Fixes #1777
2011-09-27 00:26:16 -07:00
Ryan Dahl
fa2eaeafda write-only streams should not shutdown
See
https://github.com/joyent/node/issues/1726#issuecomment-2207602
2011-09-26 23:25:50 -07:00
isaacs
c828ded0c2 zlib: Typo. s/opt/opts/ 2011-09-26 11:50:20 -07:00
Fedor Indutny
c26cf84a08 debugger: fix backtrace with no frames
Fixes #1768
2011-09-26 10:57:19 -07:00
Fedor Indutny
9b6acc27aa handle backtrace errors 2011-09-25 11:58:22 -07:00
Fedor Indutny
9e09fc0508 more cli options
* node debug localhost:5858 - connects to remote debugger
* node debug -p `pgrep node` - connects to running process
* Fixed double-run of debugger on SIGUSR1
2011-09-25 11:58:22 -07:00
Eric Lovett
f9fec3a2d6 net: callback to socket.write should always be called asynchronously 2011-09-25 00:23:27 +02:00
Ben Noordhuis
f6bce20e5e buffers: handle bad length argument in constructor
Coerce fractional, negative and non-numeric length arguments to numbers.
Fractional numbers are rounded up, negative numbers and non-numeric values
are set to zero.
2011-09-24 18:31:56 +02:00
Ben Noordhuis
d157131439 buffers: handle bad length argument in constructor
Coerce fractional, negative and non-numeric length arguments to numbers.
Fractional numbers are rounded up, negative numbers and non-numeric values
are set to zero.
2011-09-24 18:27:03 +02:00
Fedor Indutny
43cb4ec76b debugger fix for #1707 2011-09-23 13:42:41 -07:00
Fedor Indutny
39fec6003e debugger: remove useless clearlines, updated test
* remove useless clearline call at Interface start
* silence after .handleBreak()
* output '\b' if this.stdout is not a tty (debugger)
* add '\b' checks for clearline (test)
2011-09-23 13:42:41 -07:00
Fedor Indutny
78d91ff074 don't use global vars 2011-09-23 13:42:41 -07:00
Fedor Indutny
2010071339 readline: custom streams support 2011-09-23 13:42:41 -07:00
Ben Leslie
a4e10cdb07 Raise an error when a malformed package.json file is found.
The current behaviour will silently ignore any parsing errors
that may occur when loading a package.json file. This makes
debugging errors in the package.json file very difficult.

This changes the behaviour that that errors opening and reading
the file package.json file continue to be ignored, but errors
in parsing will throw an exception.
2011-09-23 12:00:26 -07:00
Fedor Indutny
1e37efb08b initial tests
* Don't buffer command, before it's execution (repl)
* `quit` command, custom streams for .start, stubbed out test, disable
  history repeation for non-tty (debugger)
2011-09-23 09:38:24 -07:00
Igor Zinkovsky
66293f6e98 fix spelling 2011-09-23 09:20:15 -07:00
Igor Zinkovsky
8fe5712477 fs watcher binding 2011-09-22 22:32:33 -07:00
Fedor Indutny
8efe7a8304 [debugger] shorten break message 2011-09-21 13:27:24 -07:00
Fedor Indutny
79fd1f7f0b [debugger] optimize context's properties initialization, make 'list' a function, not a getter 2011-09-21 13:27:24 -07:00
Fedor Indutny
3148f1400e [debugger] fix 'debug> connecting...', fixed autostart (XXX figure out why it wasn't working in some cases), fixed highlighting for first line of module's code 2011-09-21 13:27:23 -07:00
isaacs
e06ce7562c Fix #1707 hasOwnProperty usage
If hasOwnProperty is overridden, then calling `obj.hasOwnProperty(prop)`
can fail.  Any time a dictionary of user-generated items is built, we
cannot rely on hasOwnProperty being safe, so must call it from the
Object.prototype explicitly.
2011-09-15 10:54:08 -07:00
isaacs
98990b9779 Fix #1707 hasOwnProperty usage 2011-09-15 09:46:30 -07:00
koichik
fdbfc9ceb7 net: Socket write encoding case sensitivity
Fixes #1586.
2011-09-04 13:53:38 +09:00
Nathan Rajlich
0c91a835ff util: isRegExp() should not call toString() on its argument
An overloaded toString() method may have side effects
so don't call it for a simple type check.

Back-port of 54b409d to the v0.4 branch.
2011-08-25 19:23:31 +02:00
Ryan Dahl
827b9c5f1f net: fix throw error
Thanks Tobi
2011-08-23 14:30:12 -07:00
Ryan Dahl
9cd510846e Fixes #1546. Remove expensive debug call. 2011-08-17 13:21:15 -07:00
Fedor Indutny
b20c98e427 fix 'null' mirroring 2011-09-20 08:35:16 -07:00
Fedor Indutny
a0556fcbe1 repeat last command if empty line was entered 2011-09-20 08:35:15 -07:00
Fedor Indutny
41a41825f6 micro-refactor, use rli.output.write instead of rli.write ('line' event was emitted for those writes) 2011-09-20 08:35:15 -07:00
Fedor Indutny
292e2ea5ad fix breakpoint prefixing in list() 2011-09-20 08:35:15 -07:00
Fedor Indutny
c8ffbcd9f1 added comments, spawn child process automatically at debugger's start 2011-09-20 08:35:15 -07:00
Fedor Indutny
4ff15512f5 remove arrow from current source line 2011-09-20 08:35:15 -07:00
Fedor Indutny
ff05beeef3 fix inspection of zero 2011-09-20 08:35:15 -07:00
Ryan Dahl
6326b04b07 Fix test-regress-GH-819
Problem was exposed in 12798c6.
2011-09-19 13:41:48 -07:00
Ben Noordhuis
243c218c7a tls: remove superfluous setOptions() call 2011-09-19 16:28:22 +02:00
isaacs
f90264d246 zlib: lint 2011-09-17 23:03:36 -07:00
isaacs
d104bfd5a6 zlib: Fix test so that it's not trivially passing, then pass it.
Regression from the refactor to move more things into JS.
2011-09-17 23:03:23 -07:00
isaacs
5b8e1dabbc Initial pass at zlib bindings 2011-09-17 18:22:09 -07:00
Fedor Indutny
145fac7fb1 setBreakpoint w/o arguments should set one on a current line 2011-09-16 17:53:20 -07:00
Fedor Indutny
4a537c1b88 restore breakpoints after restart, fix message handling 2011-09-16 17:53:19 -07:00
Fedor Indutny
d6088b2667 fix spawn call, customFds ain't supported yet 2011-09-16 17:53:19 -07:00
Ryan Dahl
5cb1fd2e32 net.Socket(fd) should start readable and writable 2011-09-15 13:35:29 -07:00
Ryan Dahl
a1bafc5566 Merge remote branch 'origin/v0.4'
Conflicts:
	deps/http_parser/http_parser.c
	deps/http_parser/test.c
	lib/repl.js
2011-09-15 11:48:37 -07:00
Ryan Dahl
70966002c0 Forward customFds to ChildProcess.spawn
Fixes #1695
2011-09-14 12:33:42 -07:00
Fedor Indutny
d2dadf32db [debugger] added setBreakpoint and clearBreakpoint to help message
group commands in help message, added shortcuts info
2011-09-14 10:17:17 -07:00
Fedor Indutny
1dd3b68c4f [debugger] separate history of control and debug, make scripts command getter 2011-09-14 23:05:04 +07:00
Fedor Indutny
19194f87c5 [debugger] setBreakpoint, clearBreakpoint, fix reqSource error handling, show breakpoints in list() 2011-09-14 23:05:04 +07:00
Fedor Indutny
3a7713ff10 [debugger] synonym=>shortcut, added shortcut for backtrace (as in gdb), simplify regexp 2011-09-14 23:05:04 +07:00
Fedor Indutny
f2ec46a7a7 [debugger] color mark in _debugger, kill child on Ctrl+D 2011-09-14 23:05:01 +07:00
Ben Noordhuis
92d4ed397b readline: handle null completer graciously
Fixes #1698.
2011-09-14 17:33:07 +02:00
Fedor Indutny
9fb186892c [debugger] requireConnection() returns bool, break UI
Stepping commands will overwrite output of previous step command
2011-09-13 20:40:26 -07:00
Fedor Indutny
57388d8b2e [repl] add error handling for async scope fetching 2011-09-13 20:40:21 -07:00
Ryan Dahl
8c87250816 Do not load readline from util.inspect
This causes all modules using console.log() to load readline which seems
unnecessary.
2011-09-12 18:25:23 -07:00
Ryan Dahl
0aad61e802 Use net_uv instead of net_legacy for stdio
Also temporary hack to prevent process.stdout from keeping event loop alive
by calling uv_unref on process.stdout initialization.
2011-09-12 17:32:52 -07:00
Ryan Dahl
caaa59c559 Wrap uv_pipe_open, implement net.Stream(fd);
Fixes simple/test-child-process-ipc on unix.
2011-09-12 15:09:44 -07:00
Thomas Shinnick
7dc2c492e9 fs: unguarded fs.watchFile cache statWatchers checking fixed
Use hasOwnProperty to check filepath cache; previous code could fail if
a filepath duplicated a chained property name.

Fixes #1637.
2011-09-12 15:59:00 +09:00
Thomas Shinnick
e58c036c27 fs: add positioned file writing feature to fs.WriteStream
Patterned on same feature in ReadStream; a small bit of new code added
plus two refactorings of previous code; added two test files.

Fixes #1645.
2011-09-12 14:57:49 +09:00
Thomas Shinnick
e4ebeb630e fs: minor corrections from examining stream read positioning
Fix minor typos, one small refactor, and change emit() in a constructor
to a throw
2011-09-12 14:57:43 +09:00
koichik
389e2a07e6 util: Fix inspection for Error
Fixes #1634.
2011-09-11 23:13:06 +09:00
Fedor Indutny
df480e0357 fix syntax error handling for 'throw ...', fix return value assertion 2011-09-11 02:19:42 -07:00
Ryan Dahl
67cc5c9218 Merge remote branch 'indutny/feature-debugger'
Fixes #1667
2011-09-10 17:46:14 -07:00
Fedor Indutny
fe4b0f40d6 [debugger] fixed piping from stdout of child process, fixed eval in debug repl (when not on breakpoint) 2011-09-10 23:55:38 +07:00
Fedor Indutny
54520981a4 [debugger] implemented setBreakpoint, etc
Lift prototype methods not only as accessors, but as properties too.
this.print() supports javascript objects inspection
this.error() implemented, don't throw error at callbacks and commands
Fixed list() invokation, when script is not on a breakpoint
Removed obsolete process.nextTick from `step` commands
2011-09-10 19:18:36 +07:00
Fedor Indutny
db6526f962 [debugger] deep cloning (depth = 3) 2011-09-10 18:39:34 +07:00
Fedor Indutny
69fa7ef65d [debugger] fix slow repl evals inside async callbacks 2011-09-10 18:19:47 +07:00
Fedor Indutny
79265fe389 [debugger] rename function, add it to ignore list 2011-09-10 17:57:55 +07:00
Fedor Indutny
5a3639985a [debugger] print data from child process' stdout and stderr 2011-09-10 17:43:22 +07:00
Fedor Indutny
3dd573e858 [debugger] nicier output, clear line before writing 2011-09-10 17:33:07 +07:00
Fedor Indutny
03adceec62 [debugger] more informative break message (reverting back partially) 2011-09-10 12:48:21 +07:00
Bert Belder
b5db0767d5 net_uv: fix 'set is undefined' error 2011-09-09 14:59:54 +02:00
Ryan Dahl
26834b0524 Revert "vm context with accessors"
This reverts commit 4527de8cba.

Causes segfault in test/message/undefined_reference_in_new_context.js
2011-09-08 13:30:52 -07:00
Fedor Indutny
8d7aade663 [debugger] call silent resume in debugEval to prevent incorrect cursor position after repl autocompletion, small refactor in readline 2011-09-09 03:05:21 +07:00
Igor Zinkovsky
65e6ba9cce Enable link, symlink, and readlink on windows 2011-09-08 12:52:08 -07:00
Fedor Indutny
01349bbd70 [debugger] added synonyms for run, cont, next, step, out, shorten breakpoint message and do not output explicit debug> on breaks 2011-09-09 02:33:28 +07:00
Fedor Indutny
46382a728a [debugger] resume stdin at right time when running code remotely 2011-09-09 02:06:07 +07:00
Fedor Indutny
d36d5c34df [debugger] revert to using getter 2011-09-09 02:06:07 +07:00
Fedor Indutny
199f90b138 [debugger] fix messages 2011-09-09 02:06:07 +07:00
Fedor Indutny
22eb2d5084 [debugger] pause stdin on debugEval 2011-09-09 02:06:07 +07:00
Fedor Indutny
3b593c9ec5 [debugger] handle lookup error, no more need to handle SyntaxErrors 2011-09-09 02:06:07 +07:00
Fedor Indutny
e13ed4a8d0 [repl, readline] refactor async completion and execution 2011-09-09 02:06:07 +07:00
Fedor Indutny
2c2397d333 [debugger] simulate getters 2011-09-09 02:06:07 +07:00
Fedor Indutny
00343a9af0 [debugger] display message on repl(), do not display warnings on Ctrl+C 2011-09-09 02:06:07 +07:00
Fedor Indutny
77eb8eabe2 [debugger] use newly added eval argument for REPLServer 2011-09-09 02:06:06 +07:00
Fedor Indutny
0d4dc3a8b5 [repl] let self.eval be configurable on REPLServer initialization 2011-09-09 02:06:06 +07:00
Fedor Indutny
f549f2bf1d [debugger] Fix help message 2011-09-09 02:06:06 +07:00
Fedor Indutny
3b2577b4fe [debugger] restructurize code, eval control repl asynchronously
Move commands closer to each other, use .debugEval and .controlEval for
controlling repl output (no more incorrect 'debug>' prints).
2011-09-09 02:06:06 +07:00
Fedor Indutny
e01635eb9b [debugger] port all commands 2011-09-09 02:06:06 +07:00
Fedor Indutny
eab65e214e [repl] Async global completion 2011-09-09 02:06:06 +07:00
Fedor Indutny
134ab61131 [debugger] two repls, initial 2011-09-09 02:06:06 +07:00
Fedor Indutny
71a9aefa0f [readline, repl] Fix completion grouping, fix parens eval results
handling
2011-09-09 02:06:06 +07:00
Fedor Indutny
42b8b77d9f [repl, readline] async interface
Add async completion and execution interface for repl and readline
2011-09-09 02:06:06 +07:00
Fedor Indutny
bd69afbc83 [debugger] readline => repl
Started porting to high-level javascript API and repl.
2011-09-09 02:06:05 +07:00
Fedor Indutny
4527de8cba vm context with accessors
true copy of sandbox properties

catch sealed errors, pass global's prototype to CloneObject

Fixes #1673
2011-09-08 11:59:21 -07:00
Ben Noordhuis
bb3a1d5b67 http: set .code='ECONNRESET' on socket hang up errors
Fixes #1672.
2011-09-08 20:47:16 +02:00
koichik
6139459d45 util: Fix inspection for sparse array
Fixes #1651.
2011-09-09 00:57:42 +09:00
koichik
98b64422bb util: Divide inspect() into some subroutines 2011-09-09 00:53:37 +09:00
koichik
526c54c979 buffer: write() should always set _charsWritten.
Fixes #1633.
2011-09-08 11:47:32 +09:00
Sean Cunningham
eb99083d0b tls: add client-side session resumption support 2011-09-07 20:01:14 +02:00
Maciej Małecki
d0552949b9 url: add plus sign to protocol pattern 2011-09-06 17:03:52 +02:00
Bert Belder
8153a21613 Improve path parsing on windows
Closes #650
2011-09-06 04:47:36 +02:00
Bert Belder
b5d58f11cb dgram-uv: black hole incoming messages after closing
Fixes test/simple/test-dgram-pingpong.js on windows
2011-09-05 03:30:12 +02:00
Bert Belder
e20d0c1cd0 net-uv: correctly set socket.remoteAddress and -port
closes #1345
2011-09-05 02:10:14 +02:00
Nathan Rajlich
44574bc39b util: improve util.isDate() function
The old implementation was fragile. i.e. node-time is an example of a user-land
module that exports an extended Date object (with a few added functions on it's
own Date object's prototype). In that case, the old check fails.
2011-09-02 17:29:20 +02:00
Nathan Rajlich
cf24f561a3 repl: don't eval twice when an Error is thrown 2011-09-01 17:15:07 +02:00
Maciej Małecki
8d70cc607c Show warning when using lib/sys.js 2011-08-31 19:26:34 +02:00
koichik
6f60683802 tls: x509 certificate subject parsing fail
Fixes #1568.
2011-08-31 03:47:23 +09:00
Mikeal Rogers
7c87e092fb Sockets should never be attached to a ClientRequest before nextTick().
This way the API for interacting directly with the socket object is
consistent before and after the Agent pool is exhausted.

Fixes #1601.
2011-08-29 12:22:19 -07:00
Peter Lyons
a4eee3d28f http: remove 'headers sent?' check in OutgoingMessage.getHeader()
Fixes #752.
2011-08-28 23:47:10 +02:00
Ryan Dahl
16b3f2c3ff Fix dns_uv.lookup order 2011-08-26 10:31:42 -07:00
Ryan Dahl
2876141c42 dns_uv: add localhost hack for windows 2011-08-24 13:43:05 -07:00
Ben Noordhuis
bba432f00e dgram: add socket.fd compatibility hack to dgram_uv.js 2011-08-24 22:27:25 +02:00
Ben Noordhuis
cbd4033619 dgram: integrate libuv UDP support 2011-08-24 22:27:24 +02:00
Nathan Rajlich
8ec31a3362 Use Object.getPrototypeOf() on the object in the REPL tab-completion.
Some people use __proto__ to augment an Object's prototype after it's been created.
This patch helps make the "new" prototype properties visible if necessary.

This is also more consistent with the while logic below.
2011-08-23 15:35:36 -07:00
Ryan Dahl
ea156359e9 net_legacy: Fix throw typo
Thanks Tobi
2011-08-23 14:27:50 -07:00
koichik
485d5b5dff dns: Force the DNS module to invoke callbacks asynchronously.
Fixes #1164.
2011-08-24 03:01:41 +09:00
Ryan Dahl
e3413f08fd net_uv: throw when people construct net.Socket(fd)
Easier to catch compatibility errors.
2011-08-23 02:31:22 -07:00
Ryan Dahl
c4454d2efc net_uv: Don't error on ECONNRESET
Fixes #1571.
2011-08-22 19:11:38 -07:00
Ryan Dahl
cf2e68d960 net_uv: handle read errors 2011-08-22 15:03:27 -07:00
Mikeal Rogers
103990b640 Fixes #1531 2011-08-22 14:31:25 -07:00
Ben Noordhuis
8e8f36f958 Fix #1546 some more. Remove expensive debug call. 2011-08-17 22:53:42 +02:00
Ryan Dahl
8320af7ef3 Merge remote branch 'origin/v0.4'
Conflicts:
	doc/api/tls.markdown
2011-08-17 13:25:44 -07:00
koichik
4cf931db17 http: improve compatibility of legacy API
In http1, legacy http.Client shares one connection with multiple requests.
But in http2, it uses concurrent connections.
With --use-http1, test/simple/test-http-legacy.js passes.
However, it fails without --use-http1 (use http2).

This improves compatibility of legacy http.Client API between http1 and http2.

Fixes #1530.
2011-08-17 00:19:55 +09:00
Mikeal Rogers
584ae7b084 Remove http.cat. fixes #1447 2011-08-16 01:24:41 +02:00
Nathan Rajlich
54b409d650 util: isRegExp() should not call toString() on its argument
An overloaded toString() method may have side effects
so don't call it for a simple type check.
2011-08-15 17:22:48 +02:00
Thomas Shinnick
a5d90c435c path.js: correct three harmless .length typos
lib/path.js routines normalizeArray() and resolve() have for loops that
count down from end of an array.  The loop indexes are initialized using
"array.length" rather than "array.length-1".  The initial array element
accessed is always beyond the end of array and the value is 'undefined'.
Strangely, code exists that acts to ignore undefined values so that the
typos are unnoticeable.

Existing tests emit no errors either before or after changing to "length-1".
Tests _do_ start failing at "length-2". (Actually it is node that starts
to fail at "length-2" - that's a valid enough test...)
2011-08-14 04:10:42 +02:00
Glen Low
04122ad2d3 crypto: PBKDF2 function from OpenSSL 2011-08-12 16:23:11 +02:00
Brian White
b7c23ac3f5 Incorporate endianness into buffer.read* function names instead of passing in a boolean flag 2011-08-12 15:49:57 +02:00
Ben Noordhuis
4e204f37fd net: defer DNS lookup error events to next tick
net.createConnection() creates a net.Socket object
and immediately calls net.Socket.connect() on it.

There are no event listeners registered yet so
defer the error event to the next tick.

Fixes #1202.
2011-08-12 15:42:45 +02:00
Ben Noordhuis
fa378ee4d8 net: defer DNS lookup error events to next tick
net.createConnection() creates a net.Socket object
and immediately calls net.Socket.connect() on it.

There are no event listeners registered yet so
defer the error event to the next tick.

Fixes #1202.
2011-08-12 15:22:56 +02:00
Ryan Dahl
3a219de586 net_uv: resume on closed net.Socket shouldn't crash 2011-08-11 17:25:54 -07:00
isaacs
ac4791393e Fix #1497 querystring: Replace 'in' test with 'hasOwnProperty' 2011-08-11 15:36:02 -07:00
isaacs
3210809d0a Fix #1497 querystring: Replace 'in' test with 'hasOwnProperty' 2011-08-11 15:31:29 -07:00
Ben Noordhuis
eb09b0644b http: destroy socket on error
Needs further investigation, the test passed without `--use-uv`.

Fixes failing test:
  test/simple/test-http-dns-fail.js
2011-08-11 23:39:38 +02:00
Ryan Dahl
3d4ae3ab4d net_uv: pipes don't have getsockname 2011-08-11 10:44:20 -07:00
Ben Noordhuis
79f064f565 net: properly export remoteAddress to user land
Fixes failing test:
  test/simple/test-net-remote-address-port.js
2011-08-11 17:51:03 +02:00
Ben Noordhuis
460614125b tcp: propagate libuv tcp accept() errors to net_uv.js 2011-08-11 00:36:58 +02:00
Ryan Dahl
72c412767d net_uv: Handle failed shutdown req 2011-08-10 14:09:39 -07:00
Ryan Dahl
4f03f1bead net_uv: fix test/simple/test-pipe-file-to-http.js 2011-08-10 13:27:11 -07:00
Fedor Indutny
942f8b5afb Add NPN and SNI documentation.
Fixes #1420.
Fixes #1426.
2011-08-10 09:44:35 -07:00
Ryan Dahl
0696e78d64 Improve assert error messages
1. actual and expected should be displayed in the same order they were given

2. long values should be truncated.
2011-08-09 14:20:06 -07:00
Ryan Dahl
2689d262ec Make buffer.INSPECT_MAX_BYTES public for mscdex 2011-08-08 19:04:34 -07:00
Ryan Dahl
7332c4022f Truncate Buffer.inspect at 50 bytes 2011-08-08 17:50:43 -07:00
Ryan Dahl
2126989a32 Fix test-http-upgrade-server and test-http-parser
Problem was introduced in last http-parser upgrade which fixed a long
standing bug with the upgrade event and removed several callbacks.
2011-08-08 17:12:26 -07:00
Robert Mustacchi
0df08c6a0c Endian argument should be a boolean. Signed integers shouldn't run through checks for unsigned integers. Clean up jslint. Provide unchecked uint entry points. 2011-08-08 17:01:57 -07:00
Ben Noordhuis
f69822c70e http2: reword confusing comment 2011-08-08 17:38:50 +02:00
koichik
d439c092c2 Improve util.format() compatibility with browser.
Fixes #1434.
2011-08-08 23:24:05 +09:00
Mikeal Rogers
24a1f6ecc5 Fixes https host header default port handling. 2011-08-07 17:37:56 -07:00
Bert Belder
567470b136 Child processes: support windowsVerbatimArguments option 2011-08-05 22:57:45 +02:00
Ben Noordhuis
5a49522ba7 child process: don't send signal if process is already terminated
Fixes failing test test/simple/test-exec-max-buffer.js
2011-08-04 21:28:49 +02:00
Ben Noordhuis
b8c8e9c113 net_uv: add listenFD shim that throws when called 2011-08-04 21:05:42 +02:00
Ben Noordhuis
2bbb468428 child process: bind to libuv's kill process API
Fixes failing test test/simple/test-child-process-kill.js
2011-08-04 18:40:41 +02:00
Ben Noordhuis
ac722bbed6 module: strip byte order marker when loading *.js and *.json files
BOMs make V8 raise a 'SyntaxError: Unexpected token ILLEGAL' exception.

Fixes #1440.
2011-08-04 16:52:55 +02:00
Ryan Dahl
6d5218bc7d Merge branch 'v0.4'
Conflicts:
	doc/api/crypto.markdown
	doc/api/modules.markdown
	src/platform_win32.cc
2011-08-01 21:52:03 -07:00
Ryan Dahl
2908f323e1 win: fix test-child-process-exec-cwd 2011-08-01 17:40:57 -07:00
Ryan Dahl
e3ac47771c child_process_uv: fix test-child-process-stdin and -ipc 2011-08-01 15:40:44 -07:00
Ryan Dahl
9166f85285 Remove debug code 2011-08-01 10:28:32 -07:00
Ryan Dahl
b30ad11b59 child_process_uv: Handle spawn errors 2011-08-01 10:22:24 -07:00
Ryan Dahl
624dd38d89 child_process_uv: fix test/simple/test-child-process-env 2011-07-31 17:51:43 -07:00
Ryan Dahl
19a62589b2 child_process_uv: add exec, fix simple/test-child-process-exec-cwd 2011-07-31 16:24:29 -07:00
Ryan Dahl
4ac633bf21 Forgot to add child_process_uv.js 2011-07-31 16:00:47 -07:00
Ryan Dahl
7772f21b60 initial pass at lib/child_process_uv.js 2011-07-31 15:58:10 -07:00
koichik
d3d8f1b972 Add %% escape to util.format()
Fixes #1273.
2011-07-30 23:56:17 +09:00
Ben Noordhuis
874260b40f util: add sprintf-like format() function
Fixes #1407.
2011-07-30 02:11:31 +02:00
Fedor Indutny
9010f5fbab Add support for TLS SNI
Fixes #1411
2011-07-29 16:57:28 -07:00
Robert Mustacchi
de0b8d601c jslint cleanup: path.js, readline.js, repl.js, tls.js, tty_win32.js, url.js 2011-07-29 11:58:02 -07:00
isaacs
703a1ffe52 Revert "AMD compatibility for node"
This reverts commit 9967c369c9.

Conflicts:

	test/simple/test-module-loading.js
2011-07-29 11:56:38 -07:00
koichik
bffb758243 Fix http.ClientRequest crashes if end() was called twice
Fixes #1417.
Fixes #1223.
2011-07-30 00:47:54 +09:00
koichik
62aaf56d1b Fix http.ClientRequest crashes if end() was called twice
Fixes #1417.
Fixes #1223.
2011-07-30 00:47:17 +09:00
koichik
8b3ba47f88 Fix http.ClientRequest crashes if end() was called twice
Fixes #1417.
Fixes #1223.
2011-07-30 00:07:37 +09:00
Ryan Dahl
8527f00c3c Lazy load a few modules 2011-07-27 19:54:31 -07:00
Igor Zinkovsky
187fe27a6e stdio binding + javascript to enable process.stdin.listen() 2011-07-27 03:59:33 +02:00
Ben Noordhuis
2ed23314c3 http: make http and http2 co-exist
http2 is currently disabled pending addition of a --use-http2 switch
2011-07-26 17:00:53 +02:00
Mikeal Rogers
2b929c7f19 http: http2 implementation 2011-07-26 16:59:52 +02:00