module: don't require fs several times

As we are going to need fs in any case, just require it at the
beginning of the file.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
readme: added g++ requirement

Signed-off-by: Fedor Indutny <fedor@indutny.com>
contextify: remove useless header file

fix #7910
streams: set default hwm properly for Duplex

Default highWaterMark is now set properly when using stream Duplex's
writableObjectMode and readableObjectMode options.

Added condition to the already existing split objectMode test to ensure
the highWaterMark is being set to the correct default value on both the
ReadableState and WritableState for readableObjectMode and
writableObjectMode.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
lib: noisy deprecation of child_process customFds

Use a util.deprecate wrapper to issue warnings like any other
deprecated API. The option has been marked as deprecated in the docs
since v0.5.11.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
doc: remove customFds mentions

The feature has been marked as deprecated since v0.5.11.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
test: Remove references to customFds

Option has been deprecated since v0.5.11

Signed-off-by: Fedor Indutny <fedor@indutny.com>
doc: re-org child_process into async/sync

Cleaner separation between the traditional non-blocking functions and
the new blocking variants.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
child_process: copy spawnSync() cwd option to proper buffer

The spawnSync() cwd option was being copied to the incorrect
location. This commit copies to the correct location.

Closes #7824

Signed-off-by: Fedor Indutny <fedor@indutny.com>
src: pass the v8::Context to CreateEnvironment

Pass in the v8::Context, instead of creating it
within CreateEnvironment.  This allows callers
to use a pre-existing context.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
test: fix regress-GH-1726
cluster: allow multiple calls to setupMaster()

Only attributes of 'cluster.settings' will be modified after the first
call, leaving all other cluster initialization alone. Each call that
includes a 'settings' argument triggers a 'setup' event to be emitted.

Instead of each call resetting all values to their defaults, use the
current settings (if any) as the default. This retains setupMaster's
support how cluster.fork() uses setupMaster() to ensure
cluster.settings has been populated.

Update example in docs to use current node coding style and include
an example of progressive configuration.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
cluster: include settings object in 'setup' event

Emits on every call to cluster.setupMaster(), even if no new settings
are given. This is because calling cluster.setupMaster() without
arguments (or with an empty options object) results in the settings
being restored to their defaults.

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

Closes #7957.
gyp: fix post-mortem in v0.11

Expose missing constants and keep symbols on OSX.
src: export additional startup functions

This allows embedders enough control to initialize node, run the
event loop, and cleanly exit (including calling handlers).

Signed-off-by: Fedor Indutny <fedor@indutny.com>
deps: update http_parser to 2.3.0
child_process: do not access stderr when stdio set to 'ignore'

Currently, checkExecSyncError() attempts to access the contents
of stderr. When stdio is set to 'ignore', this causes a crash.
This commit adds a check on the access of stderr. Closes #7966.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
gyp: fix ARM build

According to V8 changelog, `armv7` config variable was replaced by
`arm_version`, with value either '7', '6' or 'default'.

Detect ARMv7 and ARMv6 CPUs and default to 'default'.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
tls: fix to send TLS Alert before socket destroyed

When TLS Alert is occured in handshake, ClearOut only write it into
wbio and does not flush to socket. TLS Alert should be written to
socket with EncOut before socket is destroyed within its error
callback.

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