0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
Commit Graph

11891 Commits

Author SHA1 Message Date
Sakthipriyan Vairamani
ed85c95a9c doc,test: documents behaviour of non-existent file
As per the discussion in
https://github.com/nodejs/io.js/pull/2093#discussion_r34343965, this
patch documents the behavior of calling fs.watchFile() with a path that
does not yet exist.

This patch also includes a test which checks if a file not present, the
callback is invoked at least once and if the file is created after
the callback is invoked, it will be invoked again with new stat
objects.

PR-URL: https://github.com/nodejs/io.js/pull/2169
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-08-04 22:31:01 +05:30
Sakthipriyan Vairamani
ea05e760cd repl: don't clobber RegExp.$ properties
In REPL, if we evaluate the `RegExp` object's predefined properties,
and if they happen to have the same expression, for example,

    > RegExp.$1
    'RegExp.$1'

then doing `eval(RegExp.$1)` would evaluate `RegExp.$1` recursively and
eventually throw `RangeError: Maximum call stack size exceeded`.

This patch stores the old values of `RegExp`'s predefined proprties in
an array and restores them just before the current expression entered
by user is evaluated.

Fixes: https://github.com/nodejs/io.js/issues/597
PR-URL: https://github.com/nodejs/io.js/pull/2137
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-08-04 10:21:37 +05:30
Sakthipriyan Vairamani
64cf71195c test: change the hostname to an invalid name
In my Ubuntu 14.04.2 LTS machine, it tries to resolve the name
'blah.blah' and it fails with ETIMEOUT instead of ENOTFOUND. This patch
changes the hostname to "...", an invalid name, so that it will fail
immediately.

PR-URL: https://github.com/nodejs/io.js/pull/2287
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2015-08-03 23:04:47 +05:30
Sakthipriyan Vairamani
80a1cf7425 test: fix messages and use return to skip tests
This is a followup of https://github.com/nodejs/io.js/pull/2109.
The tests which didn't make it in #2109, are included in this patch.
The skip messages are supposed to follow the format

    1..0 # Skipped: [Actual reason why the test is skipped]

and the tests should be skipped with the return statement.

PR-URL: https://github.com/nodejs/io.js/pull/2290
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-08-03 21:32:48 +05:30
Bert Belder
9bac1dbae9 win,node-gyp: enable delay-load hook by default
The delay-load hook allows node.exe/iojs.exe to be renamed. See efadffe
for more background.

PR-URL: https://github.com/iojs/io.js/pull/1433
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-08-01 09:46:17 -07:00
cjihrig
2a63cf612b deps: make node-gyp work with io.js
Every npm version bump requires a few patches to be floated on
node-gyp for io.js compatibility. These patches are found in
03d199276e,
5de334c230, and
da730c76e9. This commit squashes
them into a single commit.

PR-URL: https://github.com/iojs/io.js/pull/990
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-08-01 09:46:17 -07:00
Kat Marchán
bf63266460 deps: upgrade to npm 2.13.3
PR-URL: https://github.com/nodejs/io.js/pull/2284
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-08-01 09:45:44 -07:00
Sakthipriyan Vairamani
d5ab92bcc1 test: use common.isWindows consistently
In the tests, we use "process.platform === 'win32'" in some places.
This patch replaces them with the "common.isWindows" for consistency.

PR-URL: https://github.com/nodejs/io.js/pull/2269
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-07-31 00:29:36 +05:30
Ben Noordhuis
fa98b97171 cluster: add handle ref/unref stubs in rr mode
Add ref() and unref() stub methods to the faux handle in round-robin
mode.  Fixes the following TypeError when calling `server.unref()` in
the worker:

    net.js:1521
        this._handle.unref();
                     ^
    TypeError: this._handle.unref is not a function
        at Server.unref (net.js:1521:18)

No actual reference counting is implemented.  It would effectively be
a no-op because the control channel would still keep the worker alive.

Fixes: https://github.com/nodejs/node/issues/73
PR-URL: https://github.com/nodejs/io.js/pull/2274
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-07-30 18:17:53 +02:00
Johan Bergström
3cbb5870e5 tools: expose skip output to test runner
In the TAP protocol, skips are flagged as ok. Expose more
information so we can understand if the test was skipped or not.

PR-URL: https://github.com/nodejs/io.js/pull/2130
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-07-30 08:45:03 +02:00
Ali Ijaz Sheikh
24dd016deb build: produce symbol map files on windows
This produces map files as part of the build on windows. The existence of
these files enable profiling and tick-processing using the --prof command
line.
See: https://github.com/nodejs/io.js/pull/2090#issuecomment-124746673

Map files are documented here:
https://msdn.microsoft.com/en-us/library/k7xkk3e2.aspx

PR-URL: https://github.com/nodejs/io.js/pull/2243
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-07-29 09:36:25 -07:00
Ben Noordhuis
bc733f7065 test: fix fs.readFile('/dev/stdin') tests
The tests were creating the temp fixture file in both the parent
and the child process, leading to interesting race conditions on
the slower buildbots.

Rod notes that the tests started failing after putting the build
directory on a NFS mount.

Fixes: https://github.com/nodejs/io.js/issues/2261
PR-URL: https://github.com/nodejs/io.js/pull/2265
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-07-29 13:57:14 +02:00
Sakthipriyan Vairamani
d168d01b04 doc: properly inheriting from EventEmitter
There are so many buggy code out there, just because not inheriting
properly from `EventEmitter`. This patch gives an official
recommendation.

PR-URL: https://github.com/nodejs/io.js/pull/2168
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-07-29 14:57:58 +05:30
Sam Roberts
500f2538cc doc: a listener, not "an" listener
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: https://github.com/nodejs/io.js/pull/1025
2015-07-28 11:06:14 -07:00
Sam Roberts
54627a919d doc: server close event does not have an argument
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: https://github.com/nodejs/io.js/pull/1025
2015-07-28 11:06:02 -07:00
cjihrig
a4b46001e8 Working on v2.5.1
PR-URL: https://github.com/nodejs/io.js/pull/2239
2015-07-28 11:22:37 -04:00
cjihrig
3ce020b7ba 2015-07-28 io.js v2.5.0 Release
Notable changes

* **https**: TLS sessions in Agent are reused (Fedor Indutny)
https://github.com/nodejs/io.js/pull/2228.
* **src**: base64 decoding is now 50% faster (Ben Noordhuis)
https://github.com/nodejs/io.js/pull/2193.
* **npm**: Upgraded to v2.13.2, release notes can be found in
<https://github.com/npm/npm/releases/tag/v2.13.2> (Kat Marchán)
https://github.com/nodejs/io.js/pull/2241.

PR-URL: https://github.com/nodejs/io.js/issues/2239
2015-07-28 11:08:18 -04:00
Ali Ijaz Sheikh
ab479659c7 util: delay creation of debug context
We need the debug context to be able to inspect promises. However, this is
very expensive and should not be done on default startup.

PR-URL: https://github.com/nodejs/io.js/pull/2248
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Christopher Monsanto <chris@monsan.to>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-07-27 17:14:08 -07:00
Rich Trott
c786d6341d test: do not use public IPs for timeout testing
PR-URL: https://github.com/nodejs/io.js/pull/2057
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-07-27 17:07:54 -07:00
Ben Noordhuis
543dabb609 timers: improve Timer.now() performance
Record the start time so we can make the return value of Timer.now()
relative to it, increasing the chances that it fits in a tagged integer
instead of a heap-allocated double, at least for the first one or two
billion milliseconds.

PR-URL: https://github.com/nodejs/io.js/pull/2256
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-07-28 00:13:30 +02:00
Ben Noordhuis
3663b124e6 timers: remove unused Timer.again()
PR-URL: https://github.com/nodejs/io.js/pull/2256
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-07-28 00:13:29 +02:00
Ben Noordhuis
bcce5cf9bb timers: remove unused Timer.getRepeat()
PR-URL: https://github.com/nodejs/io.js/pull/2256
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-07-28 00:13:27 +02:00
Ben Noordhuis
f2c83bd202 timers: remove unused Timer.setRepeat()
PR-URL: https://github.com/nodejs/io.js/pull/2256
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-07-28 00:13:02 +02:00
Evan Lucas
503b089dd8 net: don't throw on immediately destroyed socket
Fixes regression introduced in af249fa8a1.

With connect being deferred to the next tick, Socket.destroy could be
called before connect. Socket.destroy sets _connecting to false which
would cause an assertion error.

Fixes: https://github.com/nodejs/io.js/issues/2250
PR-URL: https://github.com/nodejs/io.js/pull/2251
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-07-27 16:23:21 -05:00
Fedor Indutny
2ca5a3db47 https: reuse TLS sessions in Agent
Fix: #1499
PR-URL: https://github.com/nodejs/io.js/pull/2228
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-07-27 11:48:36 -07:00
Sakthipriyan Vairamani
4e78cd71c0 test: skip IPv6 part before testing it
PR-URL: https://github.com/nodejs/io.js/pull/2226
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-07-27 23:24:03 +05:30
Trevor Norris
93660c8b8e node: remove bad fn call and check
These two lines exist because of a screw up on my part while combining
MakeCallback() and MakeDomainCallback().

The reason it never broke core tests is because any paths it would have
broken were rerouted to AsyncWrap::MakeCallback(). The only case that
node::MakeCallback() handles anymore is setImmediate().

Fix: a1da024 "node, async-wrap: remove MakeDomainCallback"
PR-URL: https://github.com/nodejs/io.js/pull/2157
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-07-27 11:41:07 -06:00
Nathan Woltman
99d9d7e716 benchmark: add remaining path benchmarks & optimize
As a follow-up to 0d15161, this commit adds benchmarks for the rest
of the path functions and also forces V8 to optimize the functions
before starting the benchmark test.

PR-URL: https://github.com/nodejs/io.js/pull/2103
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-07-26 22:17:41 -07:00
Ben Noordhuis
ac70bc8240 test: fix valgrind uninitialized memory warning
parallel/test-buffer called `Buffer.prototype.toString()` on a buffer
with uninitialized memory.  Call `Buffer.prototype.fill()` on it first.

PR-URL: https://github.com/nodejs/io.js/pull/2193
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-07-25 19:08:22 +02:00
Ben Noordhuis
8fd3ce100e src: make base64 decoding 50% faster
Make the inner loop execute fewer compare-and-branch executions per
processed byte, resulting in a 50% or more speedup.

This coincidentally fixes an out-of-bounds read:

    while (unbase64(*src) < 0 && src < srcEnd)

Should have read:

    while (src < srcEnd && unbase64(*src) < 0)

But this commit removes the offending code altogether.

Fixes: https://github.com/nodejs/io.js/issues/2166
PR-URL: https://github.com/nodejs/io.js/pull/2193
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-07-25 19:07:23 +02:00
Bert Belder
b148c0dff3 win,node-gyp: enable delay-load hook by default
The delay-load hook allows node.exe/iojs.exe to be renamed. See efadffe
for more background.

PR-URL: https://github.com/iojs/io.js/pull/1433
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-07-24 18:21:19 -07:00
cjihrig
fef190cea6 deps: make node-gyp work with io.js
Every npm version bump requires a few patches to be floated on
node-gyp for io.js compatibility. These patches are found in
03d199276e,
5de334c230, and
da730c76e9. This commit squashes
them into a single commit.

PR-URL: https://github.com/iojs/io.js/pull/990
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-07-24 18:21:19 -07:00
Kat Marchán
b73a7465c5 deps: upgrade to npm 2.13.2
PR-URL: https://github.com/nodejs/io.js/pull/2241
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-07-24 18:19:40 -07:00
Jeremiah Senkpiel
68b06e94e3 tools: use local or specified $NODE for test-npm
PR-URL: https://github.com/nodejs/io.js/pull/1984
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-07-24 17:58:49 -07:00
Sakthipriyan Vairamani
afd7e37ee0 repl: better empty line handling
In REPL, if we try to evaluate an empty line, we get `undefined`.

    > process.version
    'v2.3.4'
    >
    undefined
    >
    undefined
    >

This patch prevents `undefined` from printing if the string is empty.

    > process.version
    'v2.3.5-pre'
    >
    >
    >

PR-URL: https://github.com/nodejs/io.js/pull/2163
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-07-25 00:34:06 +05:30
Sakthipriyan Vairamani
81ea52aa01 repl: improving line continuation handling
As it is, REPL doesn't honour the line continuation feature very well.
This patch

 1. keeps track of the beginning of the string literals and if they
    don't end or current line doesn't end with line continuation, then
    error out.

 2. monitors if the line continuation character is used without the
    string literal and errors out if that happens.

PR-URL: https://github.com/nodejs/io.js/pull/2163
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-07-25 00:33:50 +05:30
Sakthipriyan Vairamani
30edb5aee9 repl: preventing REPL crash with inherited properties
When an inherited property is used as a REPL keyword, the REPL crashes.

    ➜  Desktop  iojs
    > process.version
    'v2.3.4'
    > .toString
    readline.js:913
            stream[ESCAPE_DECODER].next(r[i]);
                                    ^
    TypeError: Cannot read property 'call' of undefined
        at REPLServer.parseREPLKeyword (repl.js:746:15)
        at REPLServer.<anonymous> (repl.js:284:16)
        at emitOne (events.js:77:13)
        at REPLServer.emit (events.js:169:7)
        at REPLServer.Interface._onLine (readline.js:210:10)
        at REPLServer.Interface._line (readline.js:549:8)
        at REPLServer.Interface._ttyWrite (readline.js:826:14)
        at ReadStream.onkeypress (readline.js:105:10)
        at emitTwo (events.js:87:13)
        at ReadStream.emit (events.js:172:7)
    ➜  Desktop

This patch makes the internal `commands` object inherit from `null` so
that there will be no inherited properties.

    > process.version
    'v2.3.5-pre'
    > .toString
    Invalid REPL keyword
    >

PR-URL: https://github.com/nodejs/io.js/pull/2163
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-07-25 00:33:35 +05:30
Sakthipriyan Vairamani
77fa385e5d repl: fixing undefined in invalid REPL keyword error
When an invalid REPL keyword is used, we actually print `undefined` as
well in the console.

    > process.version
    'v2.3.4'
    > .invalid_repl_command
    Invalid REPL keyword
    undefined
    >

This patch prevents printing `undefined` in this case.

    > process.version
    'v2.3.5-pre'
    > .invalid_repl_command
    Invalid REPL keyword
    >

PR-URL: https://github.com/nodejs/io.js/pull/2163
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-07-25 00:33:20 +05:30
cjihrig
a3c1b9720e doc: add GPG fingerprint for cjihrig
PR-URL: https://github.com/nodejs/io.js/pull/2217
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-07-24 14:44:06 -04:00
Sakthipriyan Vairamani
d9f857df3b doc: note about custom inspect functions
See: https://github.com/nodejs/io.js/issues/1798

When an Object is printed in REPL, the actual representation can be
overriden by defining `inspect` method on the objects. This patch
includes a note about the same in the REPL documentation.

PR-URL: https://github.com/nodejs/io.js/pull/2142
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-07-25 00:09:56 +05:30
Ali Ijaz Sheikh
0a7bf81d2f deps: update V8 to 4.2.77.21
Picks up the latest patch-release on the V8 4.2 branch.
https://codereview.chromium.org/1156323004

PR-URL: https://github.com/nodejs/io.js/issues/2238
Fixes: https://github.com/nodejs/io.js/issues/2235
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-07-24 10:31:18 -07:00
Jeremiah Senkpiel
bf2cd225a8 process: resize stderr on SIGWINCH
Fixes: https://github.com/nodejs/io.js/issues/2219
PR-URL: https://github.com/nodejs/io.js/pull/2231
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-07-23 16:32:28 -07:00
Sam Roberts
66fc8ca22b cluster: emit 'message' event on cluster master
For consistency with the worker 'exit', 'online', 'disconnect', and
'listening' events which are emitted on worker and cluster, also emit
'message' on cluster.

Reviewed-by: Sam Roberts <vieuxtech@gmail.com>
Reviewed-by: Christian Tellnes <christian@tellnes.no>
Reviewed-by: Stephen Belanger <admin@stephenbelanger.com>
PR-URL: https://github.com/nodejs/io.js/pull/861
2015-07-23 14:51:10 -07:00
Fedor Indutny
e11fc67225 tls: add getTicketKeys()/setTicketKeys()
Introduce two new APIs for getting/settings the TLS Server Ticket Keys.

Fix: #1465
PR-URL: https://github.com/nodejs/io.js/pull/2227
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-07-23 11:13:26 -07:00
Yosuke Furukawa
4ef2b5fbfb doc: Replace util.debug with console.error
PR-URL: https://github.com/nodejs/io.js/pull/2214
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-07-24 02:45:32 +09:00
Fedor Indutny
eb35968de7 crypto: fix legacy SNICallback
`onselect` is set on the `sniObject_` not on the `Connection` instance.

See: https://github.com/joyent/node/pull/25109
PR-URL: https://github.com/nodejs/io.js/pull/1720
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-07-22 14:00:37 -07:00
Sakthipriyan Vairamani
9afee6785e http: Check this.connection before using it
Refer: https://github.com/joyent/node/pull/25670

PR-URL: https://github.com/nodejs/io.js/pull/2172
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-07-22 21:44:59 +05:30
Shigeki Ohtsu
ac7d3fa0d9 test: add -no_rand_screen to s_client opts on Win
RAND_screen() causes stability issues in invoking openssl-cli s_client
on win2008r2 in CI. Disable to use it by adding -no_rand_screen
options to all tls tests that use common.opensslCli.

Fixes: https://github.com/nodejs/io.js/issues/2150
PR-URL: https://github.com/nodejs/io.js/pull/2209
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Joao Reis <reis@janeasystems.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-07-22 10:17:09 +09:00
Bert Belder
f90f1e75bb win,node-gyp: enable delay-load hook by default
The delay-load hook allows node.exe/iojs.exe to be renamed. See efadffe
for more background.

PR-URL: https://github.com/iojs/io.js/pull/1433
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-07-21 11:55:15 -07:00
cjihrig
73cdcdd581 deps: make node-gyp work with io.js
Every npm version bump requires a few patches to be floated on
node-gyp for io.js compatibility. These patches are found in
03d199276e,
5de334c230, and
da730c76e9. This commit squashes
them into a single commit.

PR-URL: https://github.com/iojs/io.js/pull/990
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-07-21 11:55:15 -07:00