Commit Graph

1442 Commits (1a9286c6e9e5247110ddbf16684e713a1545cefa)

Author SHA1 Message Date
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