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

10298 Commits

Author SHA1 Message Date
Chris Dickinson
03bae7bded doc: remove tls.createSecurePair deprecation
pending tls.TLSSocket growing the ability to work
with streams, createSecurePair will remain.

PR-URL: https://github.com/joyent/node/pull/8695
Reviewed-by: Fedor Indutny <fedor@indutny.com>
2014-11-07 14:33:05 -08:00
Trevor Norris
5845a6bcd5 uv: revert change causing build failures
Revert uv_thread_self() to return unsigned long instead of uv_thread_t.
This was causing a build failure on Windows and is only a temporary fix
until the proper patch lands upstream.

Reverts: https://github.com/joyent/libuv/commit/59658a8
Fixes: ce112c2 "deps: update uv to v1.0.0-rc2"
2014-11-07 13:44:09 -08:00
Saúl Ibarra Corretgé
e46cbaa06d core: fix usage of uv_cwd
It was modified in libuv to be consistent with uv_exepath and not
include the trailing NULL byte in the returned size.

PR-URL: https://github.com/joyent/node/pull/8566
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-05 16:51:12 -08:00
Saúl Ibarra Corretgé
a5f1307e45 core: replace uv_fs_readdir with uv_fs_scandir
PR-URL: https://github.com/joyent/node/pull/8566
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-05 16:50:58 -08:00
Saúl Ibarra Corretgé
ce112c27c6 deps: update uv to v1.0.0-rc2
PR-URL: https://github.com/joyent/node/pull/8566
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-05 16:49:57 -08:00
Timothy J Fontaine
28ae70ebad npm: Upgrade to v2.1.6 2014-11-05 10:35:43 -08:00
Forrest L Norvell
272aa589af test: more thorough tests for npm 2014-11-05 10:35:42 -08:00
Julien Gilli
3589a62104 build: fix build for SmartOS
This change in V8: https://code.google.com/p/v8/source/detail?r=22210
has introduced a method named OS::GetCurrentThreadId which fails to
compile on OSes where a "gettid" syscall does not exist.

This build issue has been fixed upstream by several changes:
- https://code.google.com/p/v8/source/detail?r=23459.
- https://codereview.chromium.org/649553002
- https://codereview.chromium.org/642223003

Another minor fix to the upstream changes was also necessary.
See https://code.google.com/p/v8/issues/detail?id=3620 for
more information.

The other build issue was due to the fact that alloca.h is not included
by other system includes on SmartOS, which is assumed by V8.

Built and tested on Linux, MacOS X, Windows and SmartOS.
2014-11-05 10:35:42 -08:00
Vladimir Kurchatkin
f65a5cbcde smalloc: check if obj has external data
PR-URL: https://github.com/joyent/node/pull/8655
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-05 00:33:00 -08:00
Vladimir Kurchatkin
849fcdeca0 smalloc: fix copyOnto optimization
copyOnto is broken when one argument has 1 byte size and the other > 1
byte.

PR-URL: https://github.com/joyent/node/pull/8637
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-10-30 15:49:02 -07:00
cjihrig
c2b4f4809b net: add pauseOnConnect option to createServer()
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>
2014-10-27 14:11:20 -07:00
Vladimir Kurchatkin
15aa47e261 docs: fix smalloc.dispose() example
Also couple of additions about dispose and limitations of smalloc'ed
objects.

Fixes: https://github.com/joyent/node/pull/8625
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-10-27 12:58:05 -07:00
Trevor Norris
6a68d64629 lint: fix whitespace issues
Fixes: f6e5740 "path: resolve normalize drive letter to lower case"
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-10-25 14:27:23 -07:00
dead-horse
f6e5740180 path: resolve normalize drive letter to lower case
make path.resolve work the same as path.normalize
2014-10-20 20:48:00 +02:00
Alexis Campailla
d22637c36c build: vcbuild fix "The input line is too long."
vcbuild.bat is calling vcvars.bat, which doesn't detect if the environment
has already been set. This causes repeated entries to be added to the PATH,
which after a few invocations will lead to an error:
The input line is too long.
2014-10-10 15:14:47 +02:00
Brian White
874dd590cf streams: make setDefaultEncoding() throw
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>
2014-10-09 16:48:59 -07:00
Wang Xinyong
db7df57e03 doc: correct createSecureContext
Remove incorrect stablity indication of tls.createSecureContext, and
format stablity indication of crypto.createCredentials.

Fixes: e50749 "doc: document `tls.createSecureContext`"
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-10-09 11:46:58 -07:00
Alexis Campailla
61dd74bc5d test: fix test-child-process-spawn-typeerror
You cannot spawn 'dir' on Windows because it's not an executable.  Also,
some people might have 'ls' on their path on Windows, so I changed
invalidCmd to something that's highly unlikely to exist.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-10-09 09:38:17 -07:00
Stiliyan Lazarov
47f119cabf doc: fix wording and punctuation in modules
[trev.norris@gmail.com: break lines at 80 characters]
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-10-08 16:48:31 -07:00
Trevor Norris
1a4a189578 crypto: createDiffieHellman throw for bad args
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>
2014-10-08 15:38:46 -07:00
Fedor Indutny
d87480beb2 test: fix debug-signal-cluster after da update
The cluster children are hitting breakpoint at `cluster.onread` and
hanging on a Semaphore wait now. This prevents them from disconnecting
gracefully. Considering that the test is checking different thing, the
cluster children needs to be force killed from the grand parent process.

Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
2014-10-08 15:44:40 +04:00
Fedor Indutny
685ac099e9 src, test: fixup after v8 update
Because of behavior change of some V8 APIs (they mostly became more
    strict), following modules needed to be fixed:

* crypto: duplicate prototype methods are not allowed anymore
* contextify: some TryCatch trickery, the binding was using it
incorrectly
* util: maximum call stack error is now crashing in a different place

Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
2014-10-08 15:44:40 +04:00
Fedor Indutny
42ecd48c7f cluster: do not signal children in debug mode
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
2014-10-08 15:44:40 +04:00
Fedor Indutny
7a0cfe9b11 deps: re-implement debugger-agent
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/8476
2014-10-08 15:44:40 +04:00
Refael Ackermann
8efcc7f456 deps: fix postmortem-metadata generator in v8
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
2014-10-08 15:44:40 +04:00
Fedor Indutny
270e998c90 deps: apply floating irhydra patch to v8
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
2014-10-08 15:44:40 +04:00
Refael Ackermann
9116b240c9 deps: update v8 to 3.28.73
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8476
2014-10-08 15:44:38 +04:00
Fedor Indutny
a2a3fd4893 tls_wrap: ignore ZERO_RETURN after close_notify
Do not call SSL_read() and ignore ZERO_RETURN if the connection was
shutdown and there could not be any reads.

Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/joyent/node/pull/8519
2014-10-08 15:32:55 +04:00
Trevor Norris
6462519d3c buffer, doc: misc. fix and cleanup
* 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>
2014-10-08 02:24:32 -07:00
Trevor Norris
bdc2ea4d52 src: update use of ExternalArrayType constants
Continuation of 4809c7a to update the use of v8::ExternalArrayType.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-10-08 01:34:46 -07:00
Refael Ackermann
573e6afc09 tools: fix for testing openssl integrations
Windows doesn't resolve ".." the way we expect it for symlinks and
junctions.

PR-URL: https://github.com/joyent/node/pull/8489
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
2014-10-08 01:19:25 -07:00
Trevor Norris
7b4a540422 src: fix jslint warning
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-10-08 01:13:43 -07:00
Trevor Norris
4809c7aa4f smalloc: update use of ExternalArrayType constants
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>
2014-10-08 01:06:06 -07:00
Steve Mao
6e4bd494a5 doc: add missing semicolons
PR-URL: https://github.com/joyent/node/pull/8498
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-10-07 23:30:42 -07:00
Johnny Ray
f04f3a0d01 streams: set default encoding for writable streams
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>
2014-10-07 17:04:10 -07:00
Steven R. Loomis
0a22ed4cc8 build: i18n: py27 -> py26 dependency
Move from argparse to optparse for dependency management.

Fixes: https://github.com/joyent/node/pull/7719#issuecomment-56868172
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-10-07 15:24:02 -07:00
Steven R. Loomis
f769d133b7 build: i18n: move noisy variables to separate gypi
Fixes: https://github.com/joyent/node/issues/7676#issuecomment-57535890
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-10-07 15:17:44 -07:00
Evan Rutledge Borden
640ad632e3 url: fixed encoding for slash switching emulation.
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>
2014-10-06 19:25:25 -05:00
Victor Widell
8392e8cdfb doc: improve readLine.pause()
The docs for readLine.pause are misleading. I seriously spent hours on this. If
it isn't a bug, at least it should be well documented.

Someone else stumbled on this too:
http://stackoverflow.com/questions/21341050/pausing-readline-in-node-js

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-10-06 19:24:29 -05:00
Steve Sharp
87ce067636 doc: Update net.markdown
Associates link to dns.lookup() with proper URL.

Fixes: https://github.com/joyent/node/issues/8018
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-10-06 19:24:21 -05:00
gyson
cb97bcd6f9 util: add es6 Symbol support for util.inspect
* `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>
2014-10-03 10:12:00 -07:00
Yazhong Liu
83d7d9e6d8 buffer: add generic functions for (u)int ops
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>
2014-10-03 01:31:20 -07:00
Trevor Norris
e9ca7b9d8d buffer: mv floating point read/write checks to JS
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>
2014-10-01 15:59:55 -07:00
Julien Gilli
862cc28183 readline: should not require an output stream.
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>
2014-10-01 15:00:02 -07:00
Vladimir Kurchatkin
8dc6be1747 node: avoid automatic microtask runs
Since we are taking control of the microtask queue it makes sense to
disable autorun and only run microtasks when necessary. Just setting
isolate->SetAutorunMicrotasks(false) would cause _tickCallback() not to
be called.

Automatically running the microtask queue will cause it to run:

* After callback invocation
* Inside _tickCallback()
* After _tickCallback() invocation

The third one is unnecessary as the microtask queue is guaranteed to be
empty at this point. The first only needs to be run manually when
_tickCallback() isn't going to be called by MakeCallback().

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-10-01 14:42:05 -07:00
Gabriel Wicke
b705b73e46 url: make query() consistent
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>
2014-10-01 12:23:01 -07:00
Steven R. Loomis
ac2857b12c build, i18n: improve Intl build, add "--with-intl"
The two main goals of this change are:
 - To make it easier to build the Intl option using ICU (particularly,
   using a newer ICU than v8/Chromium's version)
 - To enable a much smaller ICU build with only English support The goal
   here is to get node.js binaries built this way by default so that the
   Intl API can be used. Additional data can be added at execution time
   (see Readme and wiki)

More details are at https://github.com/joyent/node/pull/7719

In particular, this change adds the "--with-intl=" configure option to
provide more ways of building "Intl":
 - "full-icu" picks up an ICU from deps/icu
 - "small-icu" is similar, but builds only English
 - "system-icu" uses pkg-config to find an installed ICU
 - "none" does nothing (no Intl)

For Windows builds, the "full-icu" or "small-icu" options are added to
vcbuild.bat.

Note that the existing "--with-icu-path" option is not removed from
configure, but may not be used alongside the new option.

Wiki changes have already been made on
 https://github.com/joyent/node/wiki/Installation
and a new page created at
 https://github.com/joyent/node/wiki/Intl
(marked as provisional until this change lands.)

Summary of changes:

* README.md : doc updates

* .gitignore : added "deps/icu" as this is the location where ICU is
  unpacked to.

* Makefile : added the tools/icu/* files to cpplint, but excluded a
  problematic file.

* configure : added the "--with-intl" option mentioned above.
  Calculate at config time the list of ICU source files to use and data
  packaging options.

* node.gyp : add the new files src/node_i18n.cc/.h as well as ICU
  linkage.

* src/node.cc : add call into
  node::i18n::InitializeICUDirectory(icu_data_dir) as well as new
  --icu-data-dir option and NODE_ICU_DATA env variable to configure ICU
  data loading. This loading is only relevant in the "small"
  configuration.

* src/node_i18n.cc : new source file for the above Initialize..
  function, to setup ICU as needed.

* tools/icu : new directory with some tools needed for this build.

* tools/icu/icu-generic.gyp : new .gyp file that builds ICU in some new
  ways, both on unix/mac and windows.

* tools/icu/icu-system.gyp : new .gyp file to build node against a
  pkg-config detected ICU.

* tools/icu/icu_small.json : new config file for the "English-only" small
  build.

* tools/icu/icutrim.py : new tool for trimming down ICU data. Reads the
  above .json file.

* tools/icu/iculslocs.cc : new tool for repairing ICU data manifests
  after trim operation.

* tools/icu/no-op.cc : dummy file to force .gyp into using a C++ linker.

* vcbuild.bat : added small-icu and full-icu options, to call into
  configure.

* Fixed toolset dependencies, see
  https://github.com/joyent/node/pull/7719#issuecomment-54641687

Note that because of a bug in gyp {CC,CXX}_host must also be set.
Otherwise gcc/g++ will be used by default for part of the build.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Fedor Indutny <fedor@indutny.com>
2014-10-01 12:16:51 -07:00
Julien Fontanet
95726b0fce doc: note stdout and stderr special behaviors.
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-10-01 11:45:23 -07:00
Jackson Tian
1781c8b85b http: Improve _addHeaderLines method
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2014-09-30 17:00:29 -07:00
Trevor Norris
57ed3daebf buffer: fix and cleanup fill()
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>
2014-09-29 17:36:03 -07:00