dns: send lookup c-ares errors to callback

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>
test: fix tls-client-default-ciphers

The test execution should not depend on the servers running locally.

fix #7832
doc: document `tls.createSecureContext`
crypto: add `honorCipherOrder` argument

Add `honorCipherOrder` argument to `crypto.createCredentials`.

fix #7249
deps: build v8 with disassembler support

Signed-off-by: Fedor Indutny <fedor@indutny.com>
dns: introduce lookupService function

Uses getnameinfo to resolve an address an port into a hostname and
service.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
deps: update libuv to v0.11.26
buffer: construct new buffer from buffer toJSON() output

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>
node: fix #7841 by overlooking the spare sourceline

Signed-off-by: Fedor Indutny <fedor@indutny.com>
http: remove unused code block

fix #7769

Signed-off-by: Fedor Indutny <fedor@indutny.com>
stream: only end reading on null, not undefined

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>
repl: fix multi-line input

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>
events: Output the event that is leaking

Signed-off-by: Fedor Indutny <fedor@indutny.com>
configure: better detect windows 'bitness' (WOW64)

Signed-off-by: Fedor Indutny <fedor@indutny.com>
docs: highlight shell-codes in CONTRIBUTING.md

Signed-off-by: Fedor Indutny <fedor@indutny.com>
test: fix multiple_line problem in match

Signed-off-by: Fedor Indutny <fedor@indutny.com>
async-wrap: fix coverage and providers

* Generalize the ASYNC_PROVIDER being passed by then category to which
  it belongs. Instead of having specialized providers for classes like
  ConnectWrap.
* When some classes are instantiated from a libuv callback there is no
  activeContext, so manually set the parent class that contains the
  context that should be used for class instantiation. This will allow
  proper propagation.
* Force before/after callbacks to run when a class is instantiated, not
  only when a callback is about to be called from MakeCallback.
* Add _removeAsyncQueue() method to handles so when there are no longer
  any items in the queue async_flags_ can be reset.
* Manually track additional states in Environment. For example: the
  length of the activeContext queue, the provider type of the
  activeContext or whether any AsyncListener callbacks are being
  processed.
asynclistener: update to match AsyncWrap changes

* Pass if the error was handled as the fourth argument to the error
  callback handler.
* Move all properties to single _async object.
* Only run callbacks for watched providers.
* Each asynchronous call chain is independent and the listener can be
  removed at any time for that specific branch in the call stack.
* Each AsyncListener tracks its own watched providers. These are
  accumulated on _async.watchedProviders for quick checks when the
  run/load/unload functions are called.
* When an AsyncListener is removed, it's removed from the activeContext
  and from every context in the contextStack.
asynclistener: only run after if before could

If an AsyncListener was added in the middle of an async execution chain
then it was possible for the after callback to run w/o the before
callback having had a chance to run.

This make sure the before callback has a chance to run, or the after
callback will be skipped.
test/doc: add remaining changes for asynclistener