For some reason, though, it looks like EnvGetter is not called for the
key `__proto__`, so I can't make the info->Data() accessible. However,
putting the Object.prototype keys there, in such a way that they are not
OwnProperties, and are supersceded by environs, makes process.env much
less weird.
There is no need for fs.readFile() to be using pread rather than read.
The default semantics of read() are such that subsequent reads are where
we want them anyway.
On Windows, full pathnames are stored in the Error object when
a file i/o error happens. This is not the case on Unix. Before
this fix the test would break because of these full paths.
Fix#3455.
The remoteAddress and remotePort properties are
dynamically retrieved from _getpeername().
While _getpeername() checks if the _handle is
null, it is also possible for the tcp_wrapped
_handle.getpeername() to return null on error.
Such a condition happens when the remote closes
and one of these properties is accessed before
_handle is set to null.
The error message is slightly different on windows. However there was no
need to verify the exact error message - there are assert()s that check
all the properties of the error object.
When removeAllListeners is called, the listeners array
is deleted to maintain compatibility with v0.6.
Reverts "events: don't delete the listeners array"
This reverts commit 78dc13fbf9.
Conflicts:
test/simple/test-event-emitter-remove-all-listeners.js
Also, in the process, fix a bug in fs.realpath on Windows.
If the user has permission to create symlinks, then use symlinks. If
not, then skip over all the tests that cannot be run using Junctions
instead.
This implements server.listen({ fd: <filedescriptor> }). The fd should
refer to an underlying resource that is already bound and listening, and
causes the new server to also accept connections on it.
Not supported on Windows. Raises ENOTSUP.
The test would fail if the child process writes anything to the stdout.
This doesn't happen on unix, since `cat` is spawned. However, on Windows
`cmd` is started, which *does* write stuff to it's stdout. This
meanlingless assert is now removed.
In Windows the callbacks arrive in slightly different order. A bunch
of write operations complete immediately, and after that there is a
gap of a few hundred ms. This causes the timeout timer to fire, which
is not really warranted; the first few write operations just finished a
little quicker than expected.
Callbacks that were passed to the binding layer ran in the context of the
(internal) binding object. Make sure they run in the global context.
Before:
fs.symlink('a', 'b', function() {
console.log(this); // prints "{ oncomplete: [Function] }"
});
After:
fs.symlink('a', 'b', function() {
console.log(this); // prints "{ <global object> }"
});