Rich Trott
fb2f449acc
tools: update ESLint to current version
...
We have been stalled on ESLint 3.8.0 for some time. Current ESLint is
3.13.0. We have been unable to upgrade because of more aggressive
reporting on some rules, including indentation.
ESLint configuration options and bugfixes are now such that we can
reasonably upgrade.
PR-URL: https://github.com/nodejs/node/pull/10561
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
2017-03-08 17:11:24 -08:00
Rich Trott
b4cf8c4036
benchmark,lib,test: adjust for linting
...
Formatting changes for upcoming linter update.
PR-URL: https://github.com/nodejs/node/pull/10561
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
2017-03-08 17:11:24 -08:00
Brian White
c8d2ca7a78
fs: improve performance for sync stat() functions
...
PR-URL: https://github.com/nodejs/node/pull/11522
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-03-08 17:11:23 -08:00
Brian White
5bfa43d8f0
os: improve loadavg() performance
...
PR-URL: https://github.com/nodejs/node/pull/11516
Reviewed-By: Jackson Tian <shyvo1987@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-03-08 17:11:23 -08:00
Brian White
b7088a9355
process: improve memoryUsage() performance
...
Creating an object in JS and using a typed array to transfer values
from C++ to JS is faster than creating an object and setting
properties in C++.
The included benchmark shows ~34% increase in performance with this
change.
PR-URL: https://github.com/nodejs/node/pull/11497
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-03-08 17:11:23 -08:00
Vse Mozhet Byt
e5d1e273d7
dgram: fix possibly deoptimizing use of arguments
...
This commit adds a guard against an out of bounds access of
arguments, and replaces another use of arguments with a named
function parameter.
Refs: https://github.com/nodejs/node/issues/10323
PR-URL: https://github.com/nodejs/node/pull/11242
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-08 17:11:23 -08:00
cjihrig
c7257e716f
dgram: remove this aliases
...
This commit removes self = this style assignments from dgram.
PR-URL: https://github.com/nodejs/node/pull/11243
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-08 17:11:22 -08:00
Luigi Pinca
b4dc7a778f
http: make request.abort() destroy the socket
...
`request.abort()` did not destroy the socket if it was called
before a socket was assigned to the request and the request
did not use an `Agent` or a Unix Domain Socket was used.
Fixes: https://github.com/nodejs/node/issues/10812
PR-URL: https://github.com/nodejs/node/pull/10818
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2017-03-08 17:11:21 -08:00
Brian White
db45bf850a
querystring: improve unescapeBuffer performance
...
PR-URL: https://github.com/nodejs/node/pull/10837
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-08 17:11:17 -08:00
Brian White
32cdbca2dc
querystring: improve stringify() performance
...
PR-URL: https://github.com/nodejs/node/pull/10852
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com >
2017-03-08 17:11:17 -08:00
Brian White
23f3f20963
querystring: improve parse() performance
...
PR-URL: https://github.com/nodejs/node/pull/10874
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-08 17:11:16 -08:00
Brian White
e397e6f94a
buffer: improve compare() performance
...
PR-URL: https://github.com/nodejs/node/pull/10927
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-08 17:11:16 -08:00
dcposch@dcpos.ch
2b52859535
buffer: fix comments in bidirectionalIndexOf
...
PR-URL: https://github.com/nodejs/node/pull/10162
Fixes: https://github.com/nodejs/node/issues/9801
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2017-03-08 17:11:16 -08:00
Sakthipriyan Vairamani
83a3aef873
tools: rename eslintrc to an undeprecated format
...
As per ESLint documentation,
http://eslint.org/docs/user-guide/configuring#configuration-file-formats
the file format .eslintrc is deprecated. This patch just renames the
files to .yaml and the structure is already in yaml format.
PR-URL: https://github.com/nodejs/node/pull/7699
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2017-03-08 17:11:11 -08:00
Brian White
f7879d98f8
buffer: improve toJSON() performance
...
PR-URL: https://github.com/nodejs/node/pull/10895
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michal Zasso <targos@protonmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-08 17:11:08 -08:00
Timothy Gu
9e6fcbb34c
url: fix surrogate handling in encodeAuth()
...
Currently, the legacy URL stringifier miscalculates the offset of an
extra surrogate, causing the high surrogate to be included unescaped:
> url.format({ auth: '\uD83D\uDE00', hostname: 'a' })
'//%F0%9F%98%80�@a'
PR-URL: https://github.com/nodejs/node/pull/11387
Backport-of: https://github.com/nodejs/node/pull/11161
2017-03-08 17:11:08 -08:00
Adam Langley
44510197dd
crypto: freelist_max_len is gone in OpenSSL 1.1.0
...
The freelist_max_len member of SSL* (and the freelist itself) has been
removed in OpenSSL 1.1.0. Thus this change will be necessary at some
point but, for now, it makes it a little easier to build with 1.1.0
without breaking anything for previous versions of OpenSSL.
PR-URL: https://github.com/nodejs/node/pull/10859
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org >
2017-03-08 17:11:06 -08:00
Jackson Tian
bde1a7e09e
lib: remove unnecessary parameter for assertCrypto()
...
The `exports` parameter is unnecessary.
PR-URL: https://github.com/nodejs/node/pull/10834
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sam Roberts <sam@strongloop.com >
2017-03-08 17:11:04 -08:00
Rich Trott
ccb6045f2d
crypto,tls: fix mutability of return values
...
If you alter the array returned by `tls.getCiphers()`,
`crypto.getCiphers()`, `crypto.getHashes()`, or `crypto.getCurves()`, it
will alter subsequent return values from those functions.
```js
'use strict';
const crypto = require('crypto');
var hashes = crypto.getHashes();
hashes.splice(0, hashes.length);
hashes.push('some-arbitrary-value');
console.log(crypto.getHashes()); // "['some-arbitrary-value']"
```
This is surprising. Change functions to return copy of array instead.
PR-URL: https://github.com/nodejs/node/pull/10795
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
2017-03-08 17:11:03 -08:00
Rich Trott
4a87aee532
test,util: remove lint workarounds
...
Remove assignments to `SIMD` that are only to pacify ESLint. Instead,
use either `global.SIMD` or provide an comment letting ESLint know in
cases where `SIMD` is guaranteed to be a defined global identifier.
PR-URL: https://github.com/nodejs/node/pull/10785
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-03-08 17:11:03 -08:00
Rich Trott
73283060ad
test,repl: add coverage for repl .clear+useGlobal
...
Add a test to cover situation where REPL is initialized with `useGlobal`
set to `true` and `.clear` is called. This adds coverage for code in
repl.js that is not currently covered.
Includes minor refactor of rocket functions in repl.js for concision.
PR-URL: https://github.com/nodejs/node/pull/10777
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-08 17:11:02 -08:00
Joyee Cheung
53213004eb
util: improve readability of normalizeEncoding
...
* Improve readability of util.normalizeEncoding
and add some comments
* Add a benchmark for util.normalizeEncoding
PR-URL: https://github.com/nodejs/node/pull/10439
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Andreas Madsen <amwebdk@gmail.com >
2017-03-08 17:11:02 -08:00
Rich Trott
a2aa2f7de4
lib: refactor bootstrap_node.js regular expression
...
* use `+` instead of `*` where one-or-more is required
* switch from String.prototype.match() to RegExp.prototype.test()
PR-URL: https://github.com/nodejs/node/pull/10749
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Jackson Tian <shyvo1987@gmail.com >
2017-03-08 17:11:01 -08:00
Jackson Tian
dc88b6572d
readline: refactor construct Interface
...
Remove the dependency on the arguments.length.
PR-URL: https://github.com/nodejs/node/pull/4740
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2017-03-08 17:11:00 -08:00
Rich Trott
797d9ee924
lib: refactor crypto cipher/hash/curve getters
...
* refactor internal util.filterDuplicateStrings() to eliminate unused
code paths
* `.indexOf()` -> `.includes()` in test
* more concise arrow functions
PR-URL: https://github.com/nodejs/node/pull/10682
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michal Zasso <targos@protonmail.com >
2017-03-08 17:10:58 -08:00
yorkie
412f380903
stream: move legacy to lib/internal dir
...
Improve readability of lib/stream.js by moving the legacy abstract
Stream into lib/internal/streams/legacy.js.
PR-URL: https://github.com/nodejs/node/pull/8197
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2017-03-08 17:10:53 -08:00
Umair Ishaq
f7c6ad2df9
readline: update 6 comparions to strict
...
PR-URL: https://github.com/nodejs/node/pull/11078
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2017-03-08 17:10:50 -08:00
Roee Kasher
28102edbc8
src: unconsume stream fix in internal http impl
...
When emitting a 'connection' event on a httpServer, the function
connectionListener is called. Then, a new parser is created, and
'consume' method is called on the socket's externalStream. However,
if this stream was already consumed and unconsumed, the process
crashes with a cpp assert from the 'Consume' method in stream_base.h.
This commit makes sure that no SIGABRT will be raised and the process
will stay alive (after emitting the socket).
PR-URL: https://github.com/nodejs/node/pull/11015
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-08 17:10:49 -08:00
asafdav2
b90a141cc7
timer: remove duplicated word in comment
...
PR-URL: https://github.com/nodejs/node/pull/11323
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
2017-03-08 17:10:41 -08:00
John Barboza
d71ebb90ec
timer,domain: maintain order of timer callbacks
...
PR-URL: https://github.com/nodejs/node/pull/10522
Fixes: https://github.com/nodejs/node/issues/1271
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2017-03-08 17:10:38 -08:00
Rich Trott
32b264c33b
assert: remove unneeded condition
...
PR-URL: https://github.com/nodejs/node/pull/11314
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-03-08 17:10:38 -08:00
Jackson Tian
4179c7050f
child_process: move anonymous class to top level
...
Move the anonymous class out of setupChannel to clarify code.
PR-URL: https://github.com/nodejs/node/pull/11147
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-03-08 17:10:37 -08:00
Shinnosuke Watanabe
e54b433c8d
util: use ES2015+ Object.is to check negative zero
...
Use `Object.is` to check whether the value is negative zero or not.
Ref: https://github.com/nodejs/node/commit/b3e4fc6a48b97b52bd19de43c76b7082dcab4988
PR-URL: https://github.com/nodejs/node/pull/11332
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-03-08 17:10:36 -08:00
James M Snell
a55af77fc5
vm: refactor vm module
...
Switch to the more efficient module.exports = {} pattern.
PR-URL: https://github.com/nodejs/node/pull/11392
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-03-08 17:10:34 -08:00
cjihrig
818cef848e
child_process: remove empty if condition
...
This commit replaces an empty if-else-if with a single if
condition.
PR-URL: https://github.com/nodejs/node/pull/11427
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
2017-03-08 17:10:34 -08:00
Arseniy Maximov
c371fdcf34
child_process: refactor internal/child_process.js
...
* Prefer === to == where possible
* Remove condition that will always be false
* Prefer for-loop statements to forEach where possible for perfomance reasons
PR-URL: https://github.com/nodejs/node/pull/11366
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2017-03-08 17:10:34 -08:00
Fedor Indutny
2a168917cb
tls: do not crash on STARTTLS when OCSP requested
...
`TLSSocket` should not have a hard dependency on `tls.Server`, since it
may be running without it in cases like `STARTTLS`.
Fix : #10704
PR-URL: https://github.com/nodejs/node/pull/10706
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2017-03-08 17:10:31 -08:00
Dmitry Tsvettsikh
1ed47d3f33
tty: avoid oob warning in TTYWrap::GetWindowSize()
...
PR-URL: https://github.com/nodejs/node/pull/11454
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-03-08 17:10:31 -08:00
JungMinu
69327f5e72
lib: rename kMaxCallbacksUntilQueueIsShortened
...
PR-URL: https://github.com/nodejs/node/pull/11473
Ref: https://github.com/nodejs/node/pull/11199#issuecomment-281184439
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-03-08 17:10:29 -08:00
Daniel Bevenius
a6b2dfa43c
lib: add constant kMaxCallbacksUntilQueueIsShortened
...
Currently the maximum number of tick is duplicated in two places. This
commit introduces a constant that both can use.
PR-URL: https://github.com/nodejs/node/pull/11199
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
2017-03-08 17:10:29 -08:00
Rich Trott
a0c705ef79
assert: apply minor refactoring
...
* Remove comment referring to the CommonJS Unit Testing 1.0 spec. This
module is no longer intended to comply with that spec.
* Remove puzzling "THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!"
comment. No doubt, it made sense at one time.
* Favor `===` over `==` in two places.
PR-URL: https://github.com/nodejs/node/pull/11511
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-03-08 17:10:28 -08:00
levsthings
02e5f5c57e
process: fix typo in comments
...
Fixing a typo in comments, the word 'remaining' had a typo.
PR-URL: https://github.com/nodejs/node/pull/11503
Fixes: https://github.com/nodejs/node/issues/11491
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-03-08 17:10:28 -08:00
Arseniy Maximov
742ec6213f
net: prefer === to ==
...
* Change === to == in one place
* Add explanation about another non-strict if-statement
PR-URL: https://github.com/nodejs/node/pull/11513
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-03-08 17:10:26 -08:00
Kai Cataldo
7ecfe4971a
assert: update comments
...
Remove the numbers from the comments to make it clear that
assert does not follow the
[CJS spec](http://wiki.commonjs.org/wiki/Unit_Testing/1.0 ).
Additionally, clean up the existing comments for consistent
formatting/language and ease of reading.
PR-URL: https://github.com/nodejs/node/pull/10579
Fixes: https://github.com/nodejs/node/issues/9063
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-03-08 17:10:25 -08:00
Ben Noordhuis
a3ad63b9b3
lib,src: support values > 4GB in heap statistics
...
We were transporting the heap statistics as uint32 values to JS land but
those wrap around for values > 4 GB. Use 64 bits floats instead, those
should last us a while.
Fixes: https://github.com/nodejs/node/issues/10185
PR-URL: https://github.com/nodejs/node/pull/10186
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2017-03-08 17:10:25 -08:00
Ben Noordhuis
d777da27bc
http: reject control characters in http.request()
...
Unsanitized paths containing line feed characters can be used for
header injection and request splitting so reject them with an exception.
There seems to be no reasonable use case for allowing control characters
(characters <= 31) while there are several scenarios where they can be
used to exploit software bugs so reject control characters altogether.
PR-URL: https://github.com/nodejs/node/pull/8923
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Fedor Indutny <fedor@indutny.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: not-an-aardvark <not-an-aardvark@users.noreply.github.com >
2017-03-08 17:10:15 -08:00
Sakthipriyan Vairamani (thefourtheye)
f83d035c50
buffer: convert offset & length to int properly
...
As per ecma-262 2015's #sec-%typedarray%-buffer-byteoffset-length,
`offset` would be an integer, not a 32 bit unsigned integer. Also,
`length` would be an integer with the maximum value of 2^53 - 1, not a
32 bit unsigned integer.
This would be a problem because, if we create a buffer from an
arraybuffer, from an offset which is greater than 2^32, it would be
actually pointing to a different location in arraybuffer. For example,
if we use 2^40 as offset, then the actual value used will be 0,
because `byteOffset >>>= 0` will convert `byteOffset` to a 32 bit
unsigned int, which is based on 2^32 modulo.
This is a redo, as the ca37fa527f broke
CI.
Refer: https://github.com/nodejs/node/pull/9814
Refer: https://github.com/nodejs/node/pull/9492
PR-URL: https://github.com/nodejs/node/pull/9815
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Backport-Of: https://github.com/nodejs/node/pull/9815
PR-URL: https://github.com/nodejs/node/pull/11176
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-08 17:10:14 -08:00
Evan Lucas
bad0d9367e
http: add debug message for invalid header value
...
This makes it easier to see what header has an invalid value.
PR-URL: #9195
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2017-03-08 17:10:13 -08:00
Anna Henningsen
1d400ea484
Revert "repl: disable Ctrl+C support on win32 for now"
...
This reverts commit f59b8888f1
now that the libuv update containing the proper fix has
landed in 63243bcb33 .
Ref: https://github.com/libuv/libuv/pull/1054
Ref: https://github.com/nodejs/node/issues/7837
PR-URL: https://github.com/nodejs/node/pull/8645
Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-01-31 17:07:50 -05:00
Evan Lucas
57c4c6f5ae
repl: allow autocompletion for scoped packages
...
Previously, autocompletion of scoped packages was not supported by the
repl due to not including the `@` character in the regular expression.
PR-URL: https://github.com/nodejs/node/pull/10296
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-01-31 17:07:49 -05:00