summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'v0.10' into merge-review2merge-review2Trevor Norris2014-12-1911-18/+172
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverted caeb6773 for being unable to port the change to deps/v8. The change will be ported directly in a later commit. Conflicts: ChangeLog configure doc/api/child_process.markdown doc/api/tls.markdown doc/api/url.markdown lib/assert.js lib/child_process.js lib/crypto.js lib/dgram.js lib/http.js lib/net.js lib/timers.js lib/tls.js src/node.cc src/node.h src/node.js src/node_crypto.cc src/node_version.h test/common.js test/simple/test-child-process-spawn-typeerror.js tools/certdata.txt
| * timers: fix unref() memory leakTrevor Norris2014-11-261-1/+10
| | | | | | | | | | | | | | The destructor isn't being called for timers that have been unref'd. Fixes: https://github.com/joyent/node/issues/8364 Signed-off-by: Trevor Norris <trev.norris@gmail.com>
| * lint: fix lint issuesTrevor Norris2014-11-181-4/+2
| | | | | | | | | | | | Forgot to fix these before landing the patch. Fixes: e17c5a72
| * child_process: check fork args is an arraySam Roberts2014-11-181-0/+2
| | | | | | | | | | | | | | | | Optional fork args should be type-checked with same behaviour as the equivalent argument to spawn. PR-URL: https://github.com/joyent/node/pull/8454 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
| * child_process: check execFile args is an arraySam Roberts2014-11-181-10/+20
| | | | | | | | | | | | | | | | | | execFile and spawn have same API signature with respect to optional arg array and optional options object, they should have same behaviour with respect to argument validation. PR-URL: https://github.com/joyent/node/pull/8454 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
| * repl: Private Buffer object in lib/* filesEmmanuel Odeke2014-10-2510-1/+11
| | | | | | | | | | | | | | | | | | | | | | Fixes usage of global object 'Buffer' in lib/* files by ensuring that each file does an explicit require('buffer').Buffer. Previously, when running a repl, due to usage of global 'Buffer', any redefinition of Buffer would cause a crash eg var Buffer = {}. Fixes: https://github.com/joyent/node/issues/8588 PR-URL: https://github.com/joyent/node/pull/8603 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
| * tls: enforce secureOptions on incoming clientsTimothy J Fontaine2014-10-231-1/+6
| | | | | | | | | | Reuse the secureProtocol and secureOptions of the server when creating the secure context for incoming clients.
| * tls: honorCipherOrder should not degrade defaultsTimothy J Fontaine2014-10-232-20/+36
| | | | | | | | | | | | | | Specifying honorCipherOrder should not change the SSLv2/SSLv3 defaults for a TLS server. Use secureOptions logic in both lib/tls.js and lib/crypto.js
| * crypto: allow forcing SSLv2/v3 via secureProtocolFedor Indutny2014-10-201-2/+8
| | | | | | | | | | | | | | Force-enable SSLv2/v3 when `secureProtocol` is explicitly set to `SSLv2_method` or `SSLv3_method`. see discussion at #8551
| * crypto: move disaling SSLv2/3 into JavaScriptTimothy J Fontaine2014-10-171-1/+18
| |
| * child_process: properly support optional argscjihrig2014-09-171-1/+1
| | | | | | | | | | | | | | | | Currently, a TypeError is incorrectly thrown if the second argument is an object. This commit allows the args argument to be properly omitted. Fixes: https://github.com/joyent/node/issues/6068 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | lib,src: fix spawnSync ignoring its 'env' optionJuanjo2014-12-111-0/+1
| | | | | | | | | | PR-URL: https://github.com/joyent/node/pull/8546 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* | src: all wrap's now use actual FunctionTemplateTrevor Norris2014-12-055-56/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of simply creating a new v8::Object to contain the connection information, instantiate a new instance of a FunctionTemplate. This will allow future improvements for debugging and performance probes. Additionally, the "provider" argument in the ReqWrap constructor is no longer optional. PR-URL: https://github.com/joyent/node/pull/8110 Signed-off-by: Trevor Norris <trev.norris@gmail.com> Reviewed-by: Fedor Indutny <fedor@indutny.com> Reviewed-by: Alexis Campailla <alexis@janeasystems.com> Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
* | src: remove Async ListenerTrevor Norris2014-12-053-447/+4
| | | | | | | | | | | | | | | | | | | | | | | | Async Listener was the name of the user-facing JS API, and is being completely removed. Instead low level hooks directly into the mechanism that AL used will be introduced in a future commit. PR-URL: https://github.com/joyent/node/pull/8110 Signed-off-by: Trevor Norris <trev.norris@gmail.com> Reviewed-by: Fedor Indutny <fedor@indutny.com> Reviewed-by: Alexis Campailla <alexis@janeasystems.com> Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
* | url: change hostname regex to negate invalid charsJonathan Johnson2014-12-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Regarding joyent/node#8520 This changes hostname validation from a whitelist regex approach to a blacklist regex approach as described in https://url.spec.whatwg.org/#host-parsing. url.parse misinterpreted `https://good.com+.evil.org/` as `https://good.com/+.evil.org/`. If we use url.parse to check the validity of the hostname, the test passes, but in the browser the user is redirected to the evil.org website.
* | url: support `path` for url.formatYazhong Liu2014-12-021-5/+26
| | | | | | | | | | | | | | | | | | this adds support for a "path" field that overrides "query", "search", and "pathname" if given. Fixes: https://github.com/joyent/node/issues/8722 PR-URL: https://github.com/joyent/node/pull/8755 Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
* | smalloc: don't allow to dispose typed arraysVladimir Kurchatkin2014-11-261-0/+2
| | | | | | | | | | PR-URL: https://github.com/joyent/node/pull/8743 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | path: refactor normalizeArray()Nathan Woltman2014-11-261-41/+23
| | | | | | | | | | | | | | | | | | | | The normalizeArray() function now avoids using the slow Array#splice() method to improve performance and now also filters out empty path parts. Code that pre-filtered empty parts has been removed. PR-URL: https://github.com/joyent/node/pull/8724 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | path: added parse() and format() functionsRory Bradford2014-11-201-11/+106
| | | | | | | | | | | | | | | | | | | | | | The parse() function splits a path and returns an object with the different elements. The format() function is the reverse of this and adds an objects corresponding path elements to make up a string. Fixes #6976. Fixes: https://github.com/joyent/node/issues/6976 PR-URL: https://github.com/joyent/node/pull/8750 Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
* | path: allow calling platform specific methodsTimothy J Fontaine2014-11-201-372/+407
| | | | | | | | | | | | | | | | | | Add path.posix and path.win32 which have the specific methods like resolve and normalize so you can specifically normalize or resolve based on the target platform. PR-URL: https://github.com/joyent/node/pull/5661 Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
* | module: correct the order of the assertionshaoxin2014-11-131-1/+1
| | | | | | | | | | | | | | | | | | this puts the type-checking assertions in require into proper order. PR-URL: https://github.com/joyent/node/pull/8333 Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-by: Fedor Indutny <fedor@indutny.com>
* | tls: remove tls.createSecurePair code deprecationJackson Tian2014-11-091-5/+1
| | | | | | | | | | | | | | | | In https://github.com/joyent/node/pulls/8695, the deprecation was removed from doc. This removes the deprecation from the code. PR-URL: https://github.com/joyent/node/pull/8700 Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
* | smalloc: check if obj has external dataVladimir Kurchatkin2014-11-051-0/+2
| | | | | | | | | | PR-URL: https://github.com/joyent/node/pull/8655 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | net: add pauseOnConnect option to createServer()cjihrig2014-10-271-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently when a server receives a new connection the underlying socket handle begins reading data immediately. This causes problems when sockets are passed between processes, as data can be read by the first process and thus never read by the second process. This commit allows sockets that are constructed with a handle to be paused initially. PR-URL: https://github.com/joyent/node/pull/8576 Fixes: https://github.com/joyent/node/issues/7905 Fixes: https://github.com/joyent/node/issues/7784 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | lint: fix whitespace issuesTrevor Norris2014-10-251-4/+5
| | | | | | | | | | Fixes: f6e5740 "path: resolve normalize drive letter to lower case" Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | path: resolve normalize drive letter to lower caseorangemocha-deadhorseresolvedead-horse2014-10-201-0/+5
| | | | | | | | make path.resolve work the same as path.normalize
* | streams: make setDefaultEncoding() throwBrian White2014-10-091-5/+3
| | | | | | | | | | | | | | PR-URL: https://github.com/joyent/node/pull/8529 Fixes: f04f3a0 "streams: set default encoding for writable streams" [trev.norris@gmail.com: update tests to check if throws] Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | crypto: createDiffieHellman throw for bad argsTrevor Norris2014-10-081-0/+5
| | | | | | | | | | | | | | | | Previously crypto.createDiffieHellman() would fail silently when a bad argument was passed for prime/prime_length. Now throws TypeError. Fixes: https://github.com/joyent/node/issues/8480 Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | cluster: do not signal children in debug modeFedor Indutny2014-10-081-5/+23
| | | | | | | | | | | | | | | | | | Do not send signal to children if they are already in debug mode. Node.js on Windows does not register signal handler, and thus calling `process._debugProcess()` will throw an error. Reviewed-By: Trevor Norris <trevnorris@gmail.com> PR-URL: https://github.com/joyent/node/pull/8476
* | deps: re-implement debugger-agentFedor Indutny2014-10-081-0/+4
| | | | | | | | | | Reviewed-By: Trevor Norris <trevnorris@gmail.com> PR-URL: https://github.com/joyent/node/pull/8476
* | buffer, doc: misc. fix and cleanupTrevor Norris2014-10-081-24/+37
| | | | | | | | | | | | | | | | | | | | * Add official documentation that a Buffer instance is a viable argument when instantiating a new Buffer. * Properly set the poolOffset when a buffer needs to be truncated. * Add comments clarifying specific peculiar coding choices. * Remove a level of unnecessary indentation. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | src: fix jslint warningTrevor Norris2014-10-081-1/+2
| | | | | | | | Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | smalloc: update use of ExternalArrayType constantsTrevor Norris2014-10-081-1/+2
| | | | | | | | | | | | | | The constants in enum v8::ExternalArrayType have been changed. The old values are there for legacy reasons, but it's best to update anyway. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | streams: set default encoding for writable streamsJohnny Ray2014-10-071-0/+11
| | | | | | | | | | | | | | | | Add API Writable#setDefaultEncoding(). PR-URL: https://github.com/joyent/node/pull/8483 Fixes: https://github.com/joyent/node/issues/7159 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | url: fixed encoding for slash switching emulation.Evan Rutledge Borden2014-10-061-4/+8
| | | | | | | | | | | | Fixes: https://github.com/joyent/node/issues/8458 Reviewed-by: Trevor Norris <trev.norris@gmail.com> Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
* | util: add es6 Symbol support for `util.inspect`gyson2014-10-031-0/+4
| | | | | | | | | | | | | | | | | | * `util.inspect` cannot accept es6 symbol primitive * It will throw exception if do `util.inspect(Symbol())` * This also affects repl, console.log, etc. Reviewed-by: Trevor Norris <trev.norris@gmail.com> Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
* | buffer: add generic functions for (u)int opsYazhong Liu2014-10-031-0/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add generic functions for (U)Int read/write operations on Buffers. These support up to and including 48 bit reads and writes. Include documentation and tests. Additional work done by Trevor Norris to include 40 and 48 bit write support. Because bitwise operations cannot be used on values greater than 32 bits, the operations have been replaced with mathematical calculations. Regardless, they are still faster than floating point operations. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | buffer: mv floating point read/write checks to JSTrevor Norris2014-10-011-0/+80
| | | | | | | | | | | | | | | | | | | | Performance improvement by moving checks for floating point operations to JS and doing the operation on a protected internal function that assumes all arguments are correct. Still abort if the operation overflows memory. This can only be caused if the Buffer's length property isn't the same as the actual internal length. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | readline: should not require an output stream.Julien Gilli2014-10-011-14/+40
| | | | | | | | | | | | | | | | | | Passing null as the output stream to readline.Interface()'s constructor is now supported. Any output written by readline is just discarded. It makes it easier to use readline just as a line parser. Fixes: https://github.com/joyent/node/issues/4408 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | url: make query() consistentGabriel Wicke2014-10-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | Match the behavior of the slow path by setting url.query to an empty object when the url contains no query, but query parsing is requested. Also add a test for this case, and update the documents to clearly reflect this behavior. Fixes: https://github.com/joyent/node/issues/8332 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | http: Improve _addHeaderLines methodJackson Tian2014-09-301-1/+2
| | | | | | | | | | Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* | buffer: fix and cleanup fill()Trevor Norris2014-09-291-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running fill() with an empty string would cause Node to hang indefinitely. Now it will return without having operated on the buffer. User facing function has been pulled into JS to perform all initial value checks and coercions. The C++ method has been placed on the "internal" object. Coerced non-string values to numbers to match v0.10 support. Simplified logic and changed a couple variable names. Added tests for fill() and moved them all to the beginning of buffer-test.js since many other tests depend on fill() working properly. Fixes: https://github.com/joyent/node/issues/8469 Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | http: cleanup setHeader()Trevor Norris2014-09-291-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several fields on OutgoingMessage were set after instantiation. These have been included in the constructor to prevent mutation of the object map after instantiation. "name" is now explicitly checked to be a string. Where before if a non-string was passed the following cryptic error was thrown: _http_outgoing.js:334 var key = name.toLowerCase(); ^ TypeError: undefined is not a function Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | child_process: improve spawn() argument handlingcjihrig2014-09-251-22/+18
| | | | | | | | | | | | | | | | | | | | | | | | Add stricter argument type checking to normalizeSpawnArguments(). Removes a number of extraneous checks in spawn(). Fix regression in handling of the optional args argument. Add more thorough testing of spawn() arguments. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | readline: fix performance issue when large lineJicheng Li2014-09-251-1/+4
| | | | | | | | | | | | | | Only run lineEnding.test() on the newly acquired chunk of string instead of on the entire line buffer. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | net: Make server.connections un-enumerablePatrick Mooney2014-09-241-1/+1
| | | | | | | | | | | | | | | | | | The property server.connections should no longer be enumerable because it has been deprecated. This will prevent deprecation warnings when server objects are accessed by functions such as JSON.stringify. Fixes: https://github.com/joyent/node/issues/8373 Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | buffer: fix map and set parent to undefinedTrevor Norris2014-09-231-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | In 4c9b30d removal of the prototype attributes meant NativeBuffer() no longer had the same object map as Buffer(). By now setting the same properties in the same order both constructors will produce the same map. The same commit changed "parent" from undefined to null. This caused a failure in Buffer#slice() where it was checked if parent === undefined. Causing the incorrect parent to be set. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* | http: write() after end() emits an error.Julien Gilli2014-09-231-0/+12
| | | | | | | | | | | | | | | | | | | | When calling write() after end() has been called on an OutgoingMessage, an error is emitted and the write's callback is called with an instance of Error. Fix #7477. Reviewed-By: Fedor Indutny <fedor@indutny.com>
* | buffer: improve Buffer constructorKang-Hao Kenny2014-09-191-5/+1
| | | | | | | | | | | | | | Increase the performance of new Buffer construction by initializing all properties before SetIndexedPropertiesToExternalArrayData call. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
* | Merge remote-tracking branch 'upstream/v0.10' into v0.12Timothy J Fontaine2014-09-163-15/+12
|\ \ | |/ | | | | | | | | | | | | | | | | | | Conflicts: ChangeLog deps/v8/src/hydrogen.cc lib/http.js lib/querystring.js src/node_crypto.cc src/node_version.h test/simple/test-querystring.js