doc: fix a typo

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
src: add --throw-deprecation entry to --help
doc: add spec for util.deprecate()

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
crypto, zlib: replace _binding with _handle

Also include whitespace fixes to appease jslint.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
src: fix StringBytes::Write if string is external

Signed-off-by: Fedor Indutny <fedor@indutny.com>
node: remove duplicate tickInfo assignment

When process._setupNextTick() was introduced as the means to properly
initialize the mechanism behind process.nextTick() a chunk of code was
left behind that assigned memory to process._tickInfo. This code is no
longer needed.
src: fix spelling mistake

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
readline: fix close event of readline.Interface()

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>
buffer: remove Buffer#toArrayBuffer()

A recent change to v8's API now makes it impossible to memcpy to a
v8::ArrayBuffer without causing it to be externalized. This means that
the garbage collector will not automatically free the memory when the
object is collected.

When/If the necessary API is included to allow the above
Buffer#toArrayBuffer() will be reintroduced.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
test: fixes test/disabled/test-readline.js

This test is still in test/disabled because it requires a tty, however
when executed directly this test now passes.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
tls_wrap: remove unused variable
readline: implements keypress buffering

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>
fs: add consistent flag fall throughs

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>
docs: Update docs on TEST single test run.

The Contributing docs now clarify how to run a single test.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
crypto: check protocol version at handshake header

Signed-off-by: Fedor Indutny <fedor@indutny.com>
crypto: fix version check in hello parser

This is a follow up for 89cb740fc31f3be1c3af9fe787c7a405429ccac4
readline: fixes scoping bug

Signed-off-by: Fedor Indutny <fedor@indutny.com>
net: don't throw on net.Server.close()

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>
test: rewrite spawnsync test

The spawnsync test was written wrong, the timeout can never fire before
the sync process has returned, the delta is immaterial and times when
it was succeeding are not reliable cases.

Instead verify that the timeout doesn't fire while the sync process is
happening.
tls_wrap: do not store TLSCallbacks in SSL_CTX

Storing it in SSL_CTX is incorrect as it may go away and get destructed
earlier, also it'll yield invalid results in SelectSNIContextCallback.

Use `SSL_get_app_data()` instead.

fix #7484

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>