summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* events: Output the event that is leakingArnout Kazemier2014-07-011-2/+2
| | | | Signed-off-by: Fedor Indutny <fedor@indutny.com>
* repl: fix multi-line inputFedor Indutny2014-06-301-6/+15
| | | | | | | | | | | | The refactor in 3ae0b17c broke the multiline input's visual appearence. While actually switching to this mode, the `...` prefix is not displayed. Additionally, account only SyntaxErrors that are happening at the parse time, everything else should not be switching repl to the multiline mode. Signed-off-by: Fedor Indutny <fedor@indutny.com>
* stream: only end reading on null, not undefinedJonathan Reem2014-06-301-1/+1
| | | | | | | | | | | | | The [Stream documentation for .push](http://nodejs.org/api/stream.html#stream_readable_push_chunk_encoding) explicitly states multiple times that null is a special cased value that indicates the end of a stream. It is confusing and undocumented that undefined *also* ends the stream, even though in object mode there is a distinct and important difference. The docs for Object-Mode also explicitly mention null as the *only* special cased value, making no mention of undefined. Signed-off-by: Fedor Indutny <fedor@indutny.com>
* http: remove unused code blockFedor Indutny2014-06-271-18/+3
| | | | | | fix #7769 Signed-off-by: Fedor Indutny <fedor@indutny.com>
* buffer: construct new buffer from buffer toJSON() outputcjihrig2014-06-271-2/+5
| | | | | | | | Creating a new buffer from the toJSON() output of another buffer does not currently work. This commit adds that support. Closes #7849. Signed-off-by: Fedor Indutny <fedor@indutny.com>
* dns: introduce lookupService functionSaúl Ibarra Corretgé2014-06-271-0/+32
| | | | | | | Uses getnameinfo to resolve an address an port into a hostname and service. Signed-off-by: Fedor Indutny <fedor@indutny.com>
* crypto: add `honorCipherOrder` argumentFedor Indutny2014-06-252-6/+11
| | | | | | Add `honorCipherOrder` argument to `crypto.createCredentials`. fix #7249
* dns: send lookup c-ares errors to callbackChris Dickinson2014-06-241-1/+5
| | | | | | | | | | | Calling dns.lookup with arguments that generate an error from c-ares previously sent those errors back to the callback. This commit restores the ca9eb71 behavior. Fixes #7731. Signed-off-by: Trevor Norris <trev.norris@gmail.com> Signed-off-by: Fedor Indutny <fedor@indutny.com>
* module: document important methodsFred K. Schott2014-06-241-1/+14
| | | | Signed-off-by: Fedor Indutny <fedor@indutny.com>
* tls: using %StringSplit to split `cert.subjectaltname`Yazhong Liu2014-06-241-6/+9
| | | | Signed-off-by: Fedor Indutny <fedor@indutny.com>
* child_process: don't throw on EAGAINCharles2014-06-241-1/+3
| | | | Signed-off-by: Fedor Indutny <fedor@indutny.com>
* child_process: use full path for cmd.exe on Win32Ed Morley2014-06-241-1/+1
| | | | | | | | | | | | Currently child_process.exec() assumes that cmd.exe is on the PATH, and fails with a spawn ENOENT error if it is not. The Windows 'comspec' environment variable contains the full filepath to the default command interpreter, eg "C:\Windows\System32\cmd.exe". Should it not be set, we fall-back to using 'cmd.exe' from PATH, as before. Signed-off-by: Fedor Indutny <fedor@indutny.com>
* console: console.dir() accepts options objectXavi Magrinyà2014-06-121-6/+3
| | | | | | | | | | | This features comes from the need of adding extra options when displaying the object using console.dir(). console.dir() accepts now a second parameter that is passed to util.inspect() in order to provide extra options to the output. These options are: depth, color and showHidden. More information about these options in util.inspect() documentation. Signed-off-by: Fedor Indutny <fedor@indutny.com>
* Added support for options parameter in console.dir()Xavi Magrinyà2014-06-121-2/+7
| | | | Signed-off-by: Fedor Indutny <fedor@indutny.com>
* lib: remove unused variablesBrian White2014-06-1111-55/+8
| | | | Signed-off-by: Fedor Indutny <fedor@indutny.com>
* readline: remove doubled case.Roman Klauke2014-06-111-4/+0
| | | | Signed-off-by: Fedor Indutny <fedor@indutny.com>
* cluster: restore v0.10.x setupMaster() behaviourRyan Graham2014-06-111-10/+10
| | | | | | | | | | | | | | | In v0.10.x, process.argv and process.execArgv would only be evaluated and copied into cluster.settings on the first call to cluster.setupMaster() (either directly or via cluster.fork()), allowing them to be modified as needed before initializing the settings. In 41b75ca the behaviour was changed so that these values are initialized at the time of the first require('cluster'). Fixes #7670. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* Merge remote-tracking branch 'upstream/v0.10'Timothy J Fontaine2014-06-104-33/+58
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: AUTHORS ChangeLog deps/v8/src/api.cc deps/v8/src/unicode-inl.h deps/v8/src/unicode.h lib/_stream_readable.js lib/http.js src/cares_wrap.cc src/node.cc src/node_crypto.cc src/node_dtrace.cc src/node_file.cc src/node_stat_watcher.cc src/node_version.h src/process_wrap.cc src/string_bytes.cc src/string_bytes.h src/udp_wrap.cc src/util.h test/simple/test-buffer.js test/simple/test-stream2-compatibility.js
| * fs: remove duplicate checkBrian White2014-06-081-1/+1
| | | | | | | | Signed-off-by: Fedor Indutny <fedor@indutny.com>
| * string_decoder: Add more commentsFelix Geisendörfer2014-06-061-0/+25
| |
| * string_decoder: Fix failures from new test casesFelix Geisendörfer2014-06-061-25/+21
| | | | | | | | | | | | This patch simplifies the implementation of StringDecoder, fixes the failures from the new test cases, and also no longer relies on v8's WriteUtf8 function to encode individual surrogates.
| * stream: start old-mode read in a next tickFedor Indutny2014-06-052-3/+13
| | | | | | | | | | | | | | Calling `.read()` in the same tick with `.on('data', ...)` may cause users missing `error` events, because no `error` listeners were set yet. fix #7618
* | http: add 308 status_code, see RFC7238Yazhong Liu2014-06-081-0/+1
| | | | | | | | Signed-off-by: Fedor Indutny <fedor@indutny.com>
* | http: don't default OPTIONS to chunked encodingNick Muerdter2014-06-051-0/+1
| | | | | | | | | | Signed-off-by: Trevor Norris <trev.norris@gmail.com> Signed-off-by: Fedor Indutny <fedor@indutny.com>
* | Merge branch 'v0.10'Fedor Indutny2014-06-052-8/+12
|\ \ | |/ | | | | | | | | | | | | | | | | | | Conflicts: ChangeLog lib/events.js lib/tls.js src/node_constants.cc src/node_crypto.cc src/node_crypto.h src/node_version.h
| * fs: close file if fstat() fails in readFile()cjihrig2014-05-281-1/+6
| | | | | | | | | | | | | | | | Currently, if fstat() fails in readFile(), the callback is invoked without closing the file. This commit closes the file before calling back. Closes #7697
| * tls: fix performance issueAlexis Campailla2014-05-231-9/+4
| | | | | | | | | | | | | | | | | | | | | | See https://github.com/orangemocha/node-connection-drop I have pinpointed the performance degradation to https://github.com/joyent/node/commit/ac2263b77f3f346458d06fc019de27e24c63cee0 This change brings performance back to the orginal levels. Signed-off-by: Fedor Indutny <fedor@indutny.com>
| * child_process: do not set args before throwingGreg Sabia Tucker2014-05-161-2/+0
| | | | | | | | | | | | | | | | | | No point in setting args and options if TypeError is being thrown. fix #7456 Signed-off-by: Fedor Indutny <fedor@indutny.com>
| * child_process: spawn() does not throw TypeErrorGreg Sabia Tucker2014-05-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Ensure TypeError is thrown, fix a bug where `env` option was assuming the option was actually an object. This case is especially bad because it then sets `env == null` instead of using `process.env`. Fix #7456 Signed-off-by: Fedor Indutny <fedor@indutny.com>
| * lib: name EventEmitter prototype methodsBen Noordhuis2014-05-071-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit the EventEmitter methods were anonymous functions. V8 tries to infer names for anonymous functions based on the execution context but it frequently gets it wrong and when that happens, the stack trace is usually confusing and unhelpful. This commit names all methods so V8 can fall back to the method.name property. The above gotcha applies to all anonymous functions but is exacerbated for EventEmitter methods because those are invoked with a plenitude of different receivers. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | fs: close file if fstat() fails in readFile()cjihrig2014-05-281-1/+6
| | | | | | | | | | | | | | | | Currently, if fstat() fails in readFile(), the callback is invoked without closing the file. This commit closes the file before calling back. Closes #7697
* | net: Ensure consistent binding to IPV6 if address is absentRaymond Feng2014-05-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://github.com/joyent/node/issues/7675 net.server.listen() behaves inconsistently depending on whether the port number is provided. 1. port === 0 && host == '' (i.e. false-y), node creates an AF_INET socket but does not call bind(). 2. port > 0 && host == '', node creates an AF_INET6 socket and calls bind(). The fix makes 1 consistent with 2. Signed-off-by: Fedor Indutny <fedor@indutny.com>
* | lint: lib/_http_client.jsTimothy J Fontaine2014-05-221-2/+2
| |
* | child_process: don't throw on EMFILE/ENFILEBen Noordhuis2014-05-221-1/+10
| | | | | | | | | | | | | | | | | | | | EMFILE and ENFILE mean 'out of file descriptors'. It's a run-time error and as such should emit an error on the child process object, not throw an exception. Fixes #7453. Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
* | http: Optimize queued client abortsKevin Decker2014-05-221-6/+15
| | | | | | | | | | | | | | | | Avoid sending unsent data and destroying otherwise legitimate sockets for requests that are aborted while still in the agent queue. This reduces stress on upstream systems who will likely respond to the request but client app already knows that it will be dropped on the floor and also helps avoid killing keep-alive connections.
* | querystring: custom encode and decodefengmk22014-05-221-7/+16
| | | | | | | | | | | | | | Not all querystring are utf-8 encoding, make querystring can be used to encode / decode `non-utf8` encoding string if necessary. Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
* | child_process: add path to spawn ENOENT ErrorRyan Cole2014-05-221-1/+8
| | | | | | | | | | | | | | Add a file property to the ENOENT Error returned from ChildProcess's spawn function. Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
* | net: don't throw on net.Server.close()cjihrig2014-05-181-7/+11
| | | | | | | | | | | | | | | | When close() is called on a non-listening server, a synchronous error is thrown. This commit causes the error to be passed to the asynchronous callback function instead. Signed-off-by: Fedor Indutny <fedor@indutny.com>
* | readline: fixes scoping bugDan Kaplun2014-05-171-10/+9
| | | | | | | | Signed-off-by: Fedor Indutny <fedor@indutny.com>
* | fs: add consistent flag fall throughsColin Ihrig2014-05-131-2/+4
| | | | | | | | | | | | | | | | stringToFlags() has fall throughs in a case statement. However, they are not consistently implemented. This commit adds consistency. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | readline: implements keypress bufferingDan Kaplun2014-05-131-181/+191
| | | | | | | | | | | | | | | | | | | | | | There was an underlying assumption in readline.emitKeypressEvents (and by extension emitKey) that the given stream (usually process.stdin) would emit 'data' once per keypress, which is not always the case. This commit buffers the input stream and ensures a 'keypress' event is triggered for every keypress (including escape codes). Signed-off-by: Fedor Indutny <fedor@indutny.com>
* | readline: fix close event of readline.Interface()Yazhong Liu2014-05-121-5/+9
| | | | | | | | | | | | | | | | | | | | Not removing 'end' listeners for input and output on the 'close' event resulted in an EventEmitter related memory leak. This issue also might be reproduced at: https://github.com/npm/npm/issues/5203 Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | src: fix spelling mistakeTaojie2014-05-121-1/+1
| | | | | | | | Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | crypto, zlib: replace _binding with _handleNicholas Vavilov2014-05-072-78/+78
| | | | | | | | | | | | Also include whitespace fixes to appease jslint. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | url: treat \ the same as /isaacs2014-05-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | See https://code.google.com/p/chromium/issues/detail?id=25916 Parse URLs with backslashes the same as web browsers, by replacing all backslashes with forward slashes, except those that occur after the first # character. Manual rebase of 9520ade Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | buffer: Fix incorrect Buffer.compare behaviorFeross Aboukhadijeh2014-05-071-1/+1
| | | | | | | | | | | | Fixes #7551 Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | stream: don't try to finish if buffer is not emptyVladimir Kurchatkin2014-05-061-0/+1
| | | | | | | | fixes #5715
* | Merge remote-tracking branch 'upstream/v0.10'Timothy J Fontaine2014-05-011-1/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverted 9520adeb37f5ebe02a68669ec97770f4869705bb Conflicts: deps/cares/src/ares_parse_txt_reply.c deps/uv/.mailmap deps/uv/AUTHORS deps/uv/ChangeLog deps/uv/include/uv.h deps/uv/src/unix/error.c deps/uv/src/unix/process.c deps/uv/src/version.c deps/uv/src/win/pipe.c deps/uv/src/win/signal.c deps/uv/src/win/util.c deps/uv/test/test-spawn.c deps/uv/vcbuild.bat deps/v8/src/platform-posix.cc deps/v8/tools/gyp/v8.gyp lib/util.js src/node.cc test/simple/test-util-format.js test/simple/test-util.js
| * util: format as Error if instanceof ErrorRod Vagg2014-04-261-1/+2
| | | | | | | | | | | | | | | | | | | | Conflicts: lib/util.js test/simple/test-util-format.js This is a backport to fix #7253 Signed-off-by: Fedor Indutny <fedor@indutny.com>
| * url: treat \ the same as /isaacs2014-04-151-0/+6
| | | | | | | | | | | | | | | | See https://code.google.com/p/chromium/issues/detail?id=25916 Parse URLs with backslashes the same as web browsers, by replacing all backslashes with forward slashes, except those that occur after the first # character.