0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
Commit Graph

10298 Commits

Author SHA1 Message Date
Trevor Norris
f2a78de6ec doc: fix optional parameter parsing
The parameter parser specifically looked for the old bracket syntax.
This generated a lot of warnings when building the docs. Those warnings
have been fixed by changing the parsing logic.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-09-29 16:32:34 -07:00
Rasmus Christian Pedersen
734fb49a2a src: fix VC++ warning C4244
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-29 13:47:17 -07:00
James Ferguson
f4df80584d readme: grammer fix
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-29 13:42:41 -07:00
Trevor Norris
979d0ca874 http: cleanup setHeader()
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>
2014-09-29 12:32:42 -07:00
Trevor Norris
de312cfd7c timer_wrap: remove HandleScopes, check return size
Calls from JS to C++ have an implicit HandleScope. So there is no need
to instantiate a new HandleScope in these basic cases.

Check if the returned int64_t is an SMI and cast the return value to
uint32_t instead of a double. Prevents needing to box the return value,
and saves a small amount of execution time.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-09-29 10:13:35 -07:00
Fedor Indutny
2122a77f51 crypto: lower RSS usage for TLSCallbacks
Don't allocate any BIO buffers initially, do this on a first read from
the TCP connection. Allocate different amount of data for initial read
and for consequent reads: small buffer for hello+certificate, big buffer
for better throughput.

see #8416
2014-09-26 08:21:36 +04:00
cjihrig
9d95774722 child_process: improve spawn() argument handling
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>
2014-09-25 15:13:14 -07:00
Jicheng Li
f3473d7db6 readline: fix performance issue when large line
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>
2014-09-25 12:17:11 -07:00
Trevor Norris
51b6b6844e doc: fix brackets for optional parameters
Documentation incorrectly used bracket notation for optional parameters.
This caused inconsistencies in usage because of examples like the
following:

    fs.write(fd, data[, position[, encoding]], callback)

This simply fixes all uses of bracket notation in documentation.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
2014-09-25 11:26:15 -07:00
Timothy J Fontaine
8e4fc88c79 Now working on 0.11.15 2014-09-24 17:15:10 -07:00
Timothy J Fontaine
fd896d5acf 2014.09.24, Version 0.11.14 (Unstable)
* uv: Upgrade to v1.0.0-rc1

* http_parser: Upgrade to v2.3.0

* npm: Upgrade to v2.0.0

* openssl: Upgrade to v1.0.1i

* v8: Upgrade to 3.26.33

* Add fast path for simple URL parsing (Gabriel Wicke)

* Added support for options parameter in console.dir() (Xavi Magrinyà)

* Cluster: fix shared handles on Windows (Alexis Campailla)

* buffer: Fix incorrect Buffer.compare behavior (Feross Aboukhadijeh)

* buffer: construct new buffer from buffer toJSON() output (cjihrig)

* buffer: improve Buffer constructor (Kang-Hao Kenny)

* build: linking CoreFoundation framework for OSX (Thorsten Lorenz)

* child_process: accept uid/gid everywhere (Fedor Indutny)

* child_process: add path to spawn ENOENT Error (Ryan Cole)

* child_process: copy spawnSync() cwd option to proper buffer (cjihrig)

* child_process: do not access stderr when stdio set to 'ignore' (cjihrig)

* child_process: don't throw on EAGAIN (Charles)

* child_process: don't throw on EMFILE/ENFILE (Ben Noordhuis)

* child_process: use full path for cmd.exe on Win32 (Ed Morley)

* cluster: allow multiple calls to setupMaster() (Ryan Graham)

* cluster: centralize removal from workers list. (Julien Gilli)

* cluster: enable error/message events using .worker (cjihrig)

* cluster: include settings object in 'setup' event (Ryan Graham)

* cluster: restore v0.10.x setupMaster() behaviour (Ryan Graham)

* cluster: support options in Worker constructor (cjihrig)

* cluster: test events emit on cluster.worker (Sam Roberts)

* console: console.dir() accepts options object (Xavi Magrinyà)

* crypto: add `honorCipherOrder` argument (Fedor Indutny)

* crypto: allow padding in RSA methods (Fedor Indutny)

* crypto: clarify RandomBytes() error msg (Mickael van der Beek)

* crypto: never store pointer to conn in SSL_CTX (Fedor Indutny)

* crypto: unsigned value can't be negative (Brian White)

* dgram: remove new keyword from errnoException (Jackson Tian)

* dns: always set variable family in lookup() (cjihrig)

* dns: include host name in error message if available (Maciej Małecki)

* dns: introduce lookupService function (Saúl Ibarra Corretgé)

* dns: send lookup c-ares errors to callback (Chris Dickinson)

* dns: throw if hostname is not string or falsey (cjihrig)

* events: Output the event that is leaking (Arnout Kazemier)

* fs: close file if fstat() fails in readFile() (cjihrig)

* fs: fs.readFile should not throw uncaughtException (Jackson Tian)

* http: add 308 status_code, see RFC7238 (Yazhong Liu)

* http: don't default OPTIONS to chunked encoding (Nick Muerdter)

* http: fix bailout for writeHead (Alex Kocharin)

* http: remove unused code block (Fedor Indutny)

* http: write() after end() emits an error. (Julien Gilli)

* lib, src: add vm.runInDebugContext() (Ben Noordhuis)

* lib: noisy deprecation of child_process customFds (Ryan Graham)

* module: don't require fs several times (Robert Kowalski)

* net,dgram: workers can listen on exclusive ports (cjihrig)

* net,stream: add isPaused, don't read() when paused (Chris Dickinson)

* net: Ensure consistent binding to IPV6 if address is absent (Raymond Feng)

* net: add remoteFamily for socket (Jackson Tian)

* net: don't emit listening if handle is closed (Eli Skeggs)

* net: don't prefer IPv4 addresses during resolution (cjihrig)

* net: don't throw on net.Server.close() (cjihrig)

* net: reset `errorEmitted` on reconnect (Ed Umansky)

* node: set names for prototype methods (Trevor Norris)

* node: support v8 microtask queue (Vladimir Kurchatkin)

* path: fix slice OOB in trim (Lucio M. Tato)

* path: isAbsolute() should always return boolean (Herman Lee)

* process: throw TypeError if kill pid not a number (Sam Roberts)

* querystring: custom encode and decode (fengmk2)

* querystring: do not add sep for empty array (cjihrig)

* querystring: remove prepended ? from query field (Ezequiel Rabinovich)

* readline: fix close event of readline.Interface() (Yazhong Liu)

* readline: fixes scoping bug (Dan Kaplun)

* readline: implements keypress buffering (Dan Kaplun)

* repl: fix multi-line input (Fedor Indutny)

* repl: fix overwrite for this._prompt (Yazhong Liu)

* repl: proper `setPrompt()` and `multiline` support (Fedor Indutny)

* stream: don't try to finish if buffer is not empty (Vladimir Kurchatkin)

* stream: only end reading on null, not undefined (Jonathan Reem)

* streams: set default hwm properly for Duplex (Andrew Oppenlander)

* string_bytes: ucs2 support big endian (Andrew Low)

* tls, crypto: add DHE support (Shigeki Ohtsu)

* tls: `checkServerIdentity` option (Trevor Livingston)

* tls: add DHE-RSA-AES128-SHA256 to the def ciphers (Shigeki Ohtsu)

* tls: better error reporting at cert validation (Fedor Indutny)

* tls: support multiple keys/certs (Fedor Indutny)

* tls: throw an error, not string (Jackson Tian)

* udp: make it possible to receive empty udp packets (Andrius Bentkus)

* url: treat  the same as / (isaacs)
2014-09-24 17:15:10 -07:00
Timothy J Fontaine
9fad8958df deps: upgrade npm to 2.0.0 2014-09-24 17:15:10 -07:00
Patrick Mooney
b26dd4e5ab net: Make server.connections un-enumerable
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>
2014-09-24 16:06:46 -07:00
Robert Kowalski
efa47e593d benchmark: add test for module loader
Adds a test for benchmarking the module loader, needed for benchmarking
changes / refacortings in the module loader.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-09-24 15:48:55 -07:00
Timothy J Fontaine
f773fb41cc test: disable dgram-bind-shared-ports on win32
Windows currently doesn't support clustered dgram sockets, when it does
re-enable this test
2014-09-24 14:17:42 -07:00
Julien Gilli
2f7234d89c tests: add test for buffer.slice.
4c9b30d introduced a regression in buffer.slice that 7c3c51b fixed, but
no test had been added to make sure that a similar regression is caught
by the tests suite in the future.
2014-09-24 09:48:41 -07:00
Fedor Indutny
4dbb84fc52 tls_wrap: ensure that TLSCallbacks are gc-able
Call `MakeWeak()` to destruct TLSCallbacks when the js-object dies.

fix #8416

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-24 14:02:40 +04:00
Trevor Norris
7c3c51b8ff buffer: fix map and set parent to undefined
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>
2014-09-23 17:10:36 -07:00
Fedor Indutny
7fd35e6ea4 uv: apply floating patch 2f54947b 2014-09-24 00:19:39 +04:00
Fedor Indutny
c5f5d4cd11 deps: update uv to v1.0.0-rc1 2014-09-23 08:18:41 -07:00
Fedor Indutny
6e08bb94e8 crypto: export externals to internal structs
Export External getters for a internal structs: SSL, SSL_CTX.
2014-09-23 13:54:03 +04:00
Julien Gilli
64d6de9f34 http: write() after end() emits an error.
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>
2014-09-23 11:54:26 +04:00
Kang-Hao Kenny
4c9b30db67 buffer: improve Buffer constructor
Increase the performance of new Buffer construction by initializing all
properties before SetIndexedPropertiesToExternalArrayData call.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-19 17:11:10 -07:00
Andrew Teich
d66adf0c85 doc: corrected typo in vm docs
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-19 16:55:25 -07:00
Vladimir Kurchatkin
30bd7b672c node: support v8 microtask queue
When V8 started supporting Promises natively it also introduced a
microtack queue. This feature operates similar to process.nextTick(),
and created an issue where neither knew when the other had run. This
patch has nextTick() call the microtask queue runner at the end of
processing callbacks in the nextTickQueue.

Fixes: https://github.com/joyent/node/issues/7714
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-18 14:13:06 -07:00
Julien Gilli
9c992bdb75 test: add test for cluster.worker.destroy()
Add a simple test to cover workers' implementation of
Worker.prototype.destroy(). Before adding this test, this code wouldn't
be covered by the tests suite, and any regression introduced in workers'
implementation of Worker.prototype.destroy wouldn't be caught.

Fixes: https://github.com/joyent/node/issues/8223
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-18 14:06:21 -07:00
Fedor Indutny
cb4ed3c78f crypto: never store pointer to conn in SSL_CTX
SSL_CTX is shared between multiple connections and is not a right place
to store per-connection data.

fix #8348

Reviewed-By: Trevor Norris
2014-09-18 02:31:47 +04:00
Mickael van der Beek
c615545416 crypto: clarify RandomBytes() error msg
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-17 14:40:01 -07:00
Alexis Campailla
03e93526e6 win: manifest node.exe for Windows 8.1
Adding a compatibility section to node.exe embedded manifest so that
Node is declared explicitly compatible with Windows 8.1. Required so
that os.release() can return the correct version on Windows 8.1.

See http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-17 14:26:35 -07:00
Guilherme de Souza
378d9723f2 doc: console example improvement
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
2014-09-17 14:16:29 -07:00
Guilherme de Souza
468fb547bb doc: http.request() improved code example
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
2014-09-17 12:19:05 -07:00
Timothy J Fontaine
7ca5af87a0 Merge remote-tracking branch 'upstream/v0.10' into v0.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
2014-09-16 17:48:09 -07:00
Timothy J Fontaine
84952da241 Now working on 0.10.33 2014-09-16 16:53:10 -07:00
Timothy J Fontaine
1a8b0e807f Merge branch 'v0.10.32-release' into v0.10 2014-09-16 16:52:57 -07:00
Timothy J Fontaine
0fe0d12155 2014.09.16, Version 0.10.32 (Stable)
* npm: Update to 1.4.28

* v8: fix a crash introduced by previous release (Fedor Indutny)

* configure: add --openssl-no-asm flag (Fedor Indutny)

* crypto: use domains for any callback-taking method (Chris Dickinson)

* http: do not send `0rnrn` in TE HEAD responses (Fedor Indutny)

* querystring: fix unescape override (Tristan Berger)

* url: Add support for RFC 3490 separators (Mathias Bynens)
2014-09-16 15:47:52 -07:00
Timothy J Fontaine
daca803e9e npm: Update to 1.4.28 2014-09-16 15:38:50 -07:00
Fedor Indutny
1fddc1fee8 http: do not send 0\r\n\r\n in TE HEAD responses
When replying to a HEAD request, do not attempt to send the trailers and
EOF sequence (`0\r\n\r\n`). The HEAD request MUST not have body.

Quote from RFC:

The presence of a message body in a response depends on both the
request method to which it is responding and the response status code
(Section 3.1.2).  Responses to the HEAD request method (Section 4.3.2
of [RFC7231]) never include a message body because the associated
response header fields (e.g., Transfer-Encoding, Content-Length,
etc.), if present, indicate only what their values would have been if
the request method had been GET (Section 4.3.1 of [RFC7231]).

fix #8361

Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
2014-09-16 15:24:19 -07:00
Chris Dickinson
6e689ece46 crypto: use domains for any callback-taking method
This adds domains coverage for pdbkdf2, pseudoRandomBytes, and randomBytes.
All others should be covered by event emitters.

Fixes #5801.

Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
2014-09-16 15:23:04 -07:00
Ben Noordhuis
21e60643b0 lib, src: add vm.runInDebugContext()
Compiles and executes source code in V8's debugger context.  Provides
a programmatic way to get access to the debug object by executing:

    var Debug = vm.runInDebugContext('Debug');

Fixes #7886.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-16 12:28:47 -07:00
Maciej Małecki
174f7d2820 dns: include host name in error message if available
This makes errors more readable and similar to FS errors, which also
include file name.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-16 15:32:04 +04:00
Maciej Małecki
0664ddc093 doc: document process.env better
Fixes #6424.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-16 02:41:38 +04:00
Adam Lippai
11d57a535c tls: fix encoding in certificate-related functions
Strings are treated as UTF8 instead of one-byte strings when
names are processed and when OpenSSL's ..._print functions are used.

This commit fixes simple/test-tls-peer-certificate-encoding test.

fix #8366
2014-09-15 17:42:20 +04:00
Mathias Schreck
7c5fabe405 doc: fix modules require.resolve documentation
The behavior of the `node_modules` lookup algorithm was
changed in #1177, but the documentation was not updated completely
to describe the new behavior.

The pseudocode of the lookup algorithm did not metion that
`index.json` is tried to be loaded if you require a folder.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-15 17:17:05 +04:00
Fedor Indutny
630f0c4660 deps: backport 60c316 from v8 trunk
Original commit message:

    Extend the interceptor setter ASSERT to support the JSGlobalProxy case.

    BUG=v8:3463
    LOG=n
    R=dcarney@chromium.org

    Review URL: https://codereview.chromium.org/415973004

    git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22589 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

    Signed-off-by: Fedor Indutny <fedor@indutny.com>

fix #7969
2014-09-09 16:52:46 -07:00
Fedor Indutny
f3836af2f8 gyp: fix post-mortem in v0.11
Expose missing constants and keep symbols on OSX.
2014-09-09 16:52:45 -07:00
Ben Noordhuis
8d9493c315 deps: cherry-pick r21466 from v8 trunk
Check for cached transition to ExternalArray elements kind.
See [1] and [2] for details.

[1] https://code.google.com/p/v8/issues/detail?id=3337
[2] https://codereview.chromium.org/291193011

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-09-09 16:52:45 -07:00
Ben Noordhuis
b8a8e5558d deps: cherry-pick r21297 from v8 trunk
Changes the return value of PropertyCallbackInfo<T>::This() from
Local<Value> back to Local<Object>.  See [1] and [2] for background.

[1] https://groups.google.com/forum/#!topic/v8-users/wP2UcQ4cBW4
[2] https://codereview.chromium.org/285643008/

Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-09-09 16:52:45 -07:00
Ben Noordhuis
6f07d2fa1b deps: fix up v8 postmortem codegen
Signed-off-by: Fedor Indutny <fedor@indutny.com>
2014-09-09 16:52:45 -07:00
Trevor Norris
f9ce97084c v8: Upgrade 3.26.33 with 14 patches
V8 3.26.31 has received 14 patches since the upgrade to 3.26.33. Since
3.26.33 is technically a tag on the 3.27 branch, reverting back to
3.26.31 would remove now default functionality like WeakMaps. Because of
that the patches have simply been cherry-picked and squashed.

Here is a summary of all patches:

* Fix index register assignment in LoadFieldByIndex for arm, arm64, and
  mips.
* Fix invalid attributes when generalizing because of incompatible map
  change.
* Skip write barriers when updating the weak hash table.
* MIPS: Avoid HeapObject check in HStoreNamedField.
* Do GC if CodeRange fails to allocate a block.
* Array.concat: properly go to dictionary mode when required.
* Keep CodeRange::current_allocation_block_index_ in range.
* Grow heap slower if GC freed many global handles.
* Do not eliminate bounds checks for "<const> - x".
* Add missing map check to optimized f.apply(...).
* In GrowMode, force the value to the right representation to avoid
  deopts between storing the length and storing the value.
* Reduce max executable size limit.
* Fix invalid condition in check elimination effects.
* Fix off-by-one error in Array.concat slow mode check.

For more information see: https://github.com/v8/v8/commits/3.26

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-09 16:52:10 -07:00
Trevor Livingston
bf5e2f246e tls: checkServerIdentity option
Allow overriding `checkServerIdentity` function, when connecting to a
TLS server.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-09 17:15:50 +01:00