Fix for `error` events emitting only once when reconnecting
a single instance of net.Socket.
Fixesjoyent/node#7888
Signed-off-by: Fedor Indutny <fedor@indutny.com>
A udp packet can have 0 content. In that case nread will be equal to 0,
but addr != NULL.
Add test case for empty data gram packets and fixed test that checked
for OOB when length == 0.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
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>
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>
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>
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>
Instrumentation code might need to find out the entry point of the
process in a global context.
Documenting the existing process.mainModule to officially support this.
Fixes#7808
Signed-off-by: Fedor Indutny <fedor@indutny.com>
Currently child_process.exec() assumes that cmd.exe is on the PATH,
and fails with a spawn ENOENT error if it is not.
The Windows 'comspec' environment variable contains the full filepath
to the default command interpreter, eg "C:\Windows\System32\cmd.exe".
Should it not be set, we fall-back to using 'cmd.exe' from PATH, as
before.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
Building MSIs for different arch's can sometimes confuse MSBuild and
Wix, isntead run the toolchain externally so we don't have to worry
about which arch cmd.exe is running as.
This features comes from the need of adding extra options when displaying
the object using console.dir().
console.dir() accepts now a second parameter that is passed to util.inspect()
in order to provide extra options to the output. These options are: depth, color
and showHidden. More information about these options in util.inspect() documentation.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
WriteItem callback may add new item to the `pending_write_items`. Ensure
that this item won't be called in the same `InvokeQueued` call, as it
may result in way-to-early `finish` event on js-side.
fix#7733
Signed-off-by: Fedor Indutny <fedor@indutny.com>
Tests for the behaviour in v0.10.x which allows process.argv changes
to be honoured by cluster.setupMaster().
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
In v0.10.x, process.argv and process.execArgv would only be
evaluated and copied into cluster.settings on the first call to
cluster.setupMaster() (either directly or via cluster.fork()),
allowing them to be modified as needed before initializing the
settings.
In 41b75ca the behaviour was changed so that these values are
initialized at the time of the first require('cluster').
Fixes#7670.
Signed-off-by: Trevor Norris <trev.norris@gmail.com>