0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

4303 Commits

Author SHA1 Message Date
John Barboza
9dac165160 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-02-14 18:54:36 -05:00
Timothy Gu
c6b12d0984 url: fix surrogate handling in encodeAuth()
Also factor out common parts in querystring and url.

PR-URL: https://github.com/nodejs/node/pull/11161
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-02-14 12:13:11 -08:00
Timothy Gu
781eb90960 benchmark: add url/url-searchparams-sort.js
PR-URL: https://github.com/nodejs/node/pull/11098
Fixes: https://github.com/nodejs/node/issues/10760
Ref: https://github.com/whatwg/url/issues/26
Ref: https://github.com/whatwg/url/pull/199
Ref: https://github.com/w3c/web-platform-tests/pull/4531
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-02-13 20:49:13 -08:00
Timothy Gu
02d1e32fe3 url: add urlSearchParams.sort()
PR-URL: https://github.com/nodejs/node/pull/11098
Fixes: https://github.com/nodejs/node/issues/10760
Ref: https://github.com/whatwg/url/issues/26
Ref: https://github.com/whatwg/url/pull/199
Ref: https://github.com/w3c/web-platform-tests/pull/4531
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-02-13 20:48:58 -08:00
David Benjamin
e34ee1d2c9 crypto: remove unused access of tlsext_hostname
The return value of loadSession is ultimately ignored, so don't fill it
in. This inches Node closer to 1.1.0 compatibility and is less code.

Also remove a comment which appears to have long since become invalid.
It dates to 048e0e77e0 when the SNI value
was actually extracted from the session.

This also fixes a segfault should d2i_SSL_SESSION fail to parse the
input and return NULL. Add a test for this case based on
test-tls-session-cache.js.

PR-URL: https://github.com/nodejs/node/pull/10882
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-02-13 13:56:46 -08:00
James M Snell
9f74184e98 crypto: upgrade pbkdf2 without digest to an error
Commit a1163582 added a deprecation warning when pbkdf2 was called without an
explicit `digest` argument. This was because the default digest is `sha1`,
which is not-recommended from a security point of view. This upgrades it
to a runtime error when `digest` is undefined per the plan discussed in
the original issue.

Ref: a1163582c5

PR-URL: https://github.com/nodejs/node/pull/11305
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-02-13 11:04:51 -08:00
Brian White
ff785fd517 querystring: fix empty pairs and optimize parse()
This commit fixes handling of empty pairs that occur before the end
of the query string so that they are also ignored.

Additionally, some optimizations have been made, including:

* Avoid unnecessary code execution where possible
* Use a lookup table when checking for hex characters
* Avoid forced decoding when '+' characters are encountered and we
are using the default decoder

Fixes: https://github.com/nodejs/node/issues/10454
PR-URL: https://github.com/nodejs/node/pull/11234
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Nicu Micleușanu <micnic90@gmail.com>
2017-02-13 10:40:37 -08:00
Ben Noordhuis
fd8587eb38 lib: replace \u2019 with regular ascii quote
The previous commit stores baked-in files with non-ASCII characters
as UTF-16.  Replace the \u2019 with a regular quote character so that
the files they're in can be stored as one-byte strings.  The UTF-16
functionality is still tested by the Unicode diagram in lib/timers.js.

PR-URL: https://github.com/nodejs/node/pull/11129
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-02-13 19:16:47 +01:00
Anna Henningsen
fd18b656a3
lib: build node inspect into node
Include the relevant files from `deps/node-inspect` in the compiled
`node` binary and make `node inspect` work like `node-inspect`.

PR-URL: https://github.com/nodejs/node/pull/10187
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-02-13 14:50:32 +01:00
Matteo Collina
b1fc7745f2 fs: avoid emitting error EBADF for double close
Changed the logic in fs.ReadStream and fs.WriteStream so that
close always calls the prototype method rather than the internal
event listener.

Fixes: https://github.com/nodejs/node/issues/2950
PR-URL: https://github.com/nodejs/node/pull/11225
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2017-02-13 09:08:47 +01:00
asafdav2
b2a77654b7 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-02-13 08:17:57 +09:00
Sam Roberts
4cafa60c99 child_process: align fork/spawn stdio error msg
fork()'s support for .stdio strings in 3268863eb used a different
TypeError string from spawn, unnecessarily.

PR-URL: https://github.com/nodejs/node/pull/11044
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-02-11 14:06:26 -08:00
DavidCai
78182458e6 url: fix error message of url.format
PR-URL: https://github.com/nodejs/node/pull/11162
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-02-11 13:59:34 -08:00
Michaël Zasso
f65aa08b52 util: improve inspect for (Async|Generator)Function
Use the constructor name in the output, if present.

PR-URL: https://github.com/nodejs/node/pull/11210
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-02-11 13:29:10 -08:00
Ben Noordhuis
46345b9374 src: make --icu-data-dir= switch testable
Move some code around so we can properly test whether the switch
actually does anything.

PR-URL: https://github.com/nodejs/node/pull/11255
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-02-11 15:23:51 +01:00
Josh Gavant
dfdd911e17 lib: deprecate node --debug at runtime
Fixes: https://github.com/nodejs/node/issues/9789
PR-URL: https://github.com/nodejs/node/pull/10970
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-02-10 12:41:09 -08:00
cjihrig
b594b3bc34 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-02-10 12:30:25 -05:00
James M Snell
159749d522 errors: add internal/errors.js
Add the internal/errors.js core mechanism.

PR-URL: https://github.com/nodejs/node/pull/11220
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-02-09 13:46:14 -08:00
cjihrig
a4bb9fdb89 http: include provided status code in range error
ServerResponse#writeHead() coerces the user provided status code
to a number and then performs a range check. If the check fails,
a range error is thrown. The coerced status code is included in
the error message. This commit uses the user provided status code
instead.

PR-URL: https://github.com/nodejs/node/pull/11221
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-02-09 12:38:06 -05:00
James M Snell
9549329158 fs: allow WHATWG URL and file: URLs as paths
Updates the fs module APIs to allow 'file://' URL objects
to be passed as the path.

For example:

```js
const URL = require('url').URL;
const myURL = new URL('file:///C:/path/to/file');
fs.readFile(myURL, (err, data) => {});
```

On Windows, file: URLs with a hostname convert to UNC paths,
while file: URLs with drive letters convert to local absolute
paths:

```
file://hostname/a/b/c => \\hostname\a\b\c
file:///c:/a/b/c => c:\a\b\c
```

On all other platforms, file: URLs with a hostname are unsupported
and will result in a throw:

```
file://hostname/a/b/c => throw!
file:///a/b/c => /a/b/c
```

The documentation for the fs API is intentionally not updated in
this commit because the URL API is still considered experimental
and is not officially documented *at this time*

Note that file: URLs are *required* by spec to always be absolute
paths from the file system root.

This is a semver-major commit because it changes error handling
on the fs APIs.

PR-URL: https://github.com/nodejs/node/pull/10739
Ref: https://github.com/nodejs/node/issues/10703
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-02-06 11:03:37 -08:00
Nikolai Vavilov
9a0829d728 buffer: stricter argument checking in toString
This prevents the confusing behavior of `buf.toString(0, 5)` by
disallowing passing `0` as the encoding.

PR-URL: https://github.com/nodejs/node/pull/11120
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-02-05 14:14:53 +02:00
Umair Ishaq
b869ecaacf
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-02-04 07:06:17 +01:00
James M Snell
5e52a9ac09 Revert "fs: allow WHATWG URL and file: URLs as paths"
This reverts commit 79400bfbfd.

PR-URL: https://github.com/nodejs/node/pull/11155
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-02-03 16:43:18 -08:00
James M Snell
79400bfbfd fs: allow WHATWG URL and file: URLs as paths
Updates the fs module APIs to allow 'file://' URL objects
to be passed as the path.

For example:

```js
const URL = require('url').URL;
const myURL = new URL('file:///C:/path/to/file');
fs.readFile(myURL, (err, data) => {});
```

On Windows, file: URLs with a hostname convert to UNC paths,
while file: URLs with drive letters convert to local absolute
paths:

```
file://hostname/a/b/c => \\hostname\a\b\c
file:///c:/a/b/c => c:\a\b\c
```

On all other platforms, file: URLs with a hostname are unsupported
and will result in a throw:

```
file://hostname/a/b/c => throw!
file:///a/b/c => /a/b/c
```

The documentation for the fs API is intentionally not updated in
this commit because the URL API is still considered experimental
and is not officially documented *at this time*

Note that file: URLs are *required* by spec to always be absolute
paths from the file system root.

This is a semver-major commit because it changes error handling
on the fs APIs.

PR-URL: https://github.com/nodejs/node/pull/10739
Ref: https://github.com/nodejs/node/issues/10703
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-02-03 13:59:06 -08:00
Timothy Gu
0792d452e8 url: fix setting url.search to the empty string
PR-URL: https://github.com/nodejs/node/pull/11105
Fixes: https://github.com/nodejs/node/issues/11101
Fixes: 98bb65f641 "url: improving URLSearchParams"
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-02-03 12:29:07 -08:00
Daijiro Wachi
4e259b21a3 querystring, url: handle repeated sep in search
* update state machine in parse
  * repeated sep should be adjusted
  * `&=&=` should be `{ '': [ '', '' ] }`
* add test cases for querystring and URLSearchParams

Fixes: https://github.com/nodejs/node/issues/10454
PR-URL: https://github.com/nodejs/node/pull/10967
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-02-02 13:02:44 -08:00
James M Snell
c5e9654b5b url: extend url.format to support WHATWG URL
Removes the non-standard options on WHATWG URL toString
and extends the existing url.format() API to support
customizable serialization of the WHATWG URL object.

This does not yet include the documentation updates
because the documentation for the new WHATWG URL object
has not yet landed.

Example:

```js
const url = require('url');
const URL = url.URL;
const myURL = new URL('http://example.org/?a=b#c');
const str = url.format(myURL, {fragment: false, search: false});
console.log(str);
  // Prints: http://example.org/
```

PR-URL: https://github.com/nodejs/node/pull/10857
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-02-02 12:35:55 -08:00
Roee Kasher
3e3bfc57d9 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-02-02 12:01:13 -08:00
yorkie
1b30df1003 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-02-01 09:58:51 +01:00
Timothy Gu
cc48f21c83 url: extend URLSearchParams constructor
PR-URL: https://github.com/nodejs/node/pull/11060
Fixes: https://github.com/nodejs/node/issues/10635
Ref: https://github.com/whatwg/url/pull/175
Ref: https://github.com/w3c/web-platform-tests/pull/4523
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-01-31 23:51:06 -08:00
Jackson Tian
aa8eb8747c
http: use direct parameters instead
When parameter count is fixed, use literal Array instance is more
simply and avoid arguments leak also.

PR-URL: https://github.com/nodejs/node/pull/10833
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-01-31 12:56:21 -05:00
Timothy Gu
90c2ac7be3 url: make URLSearchParams/Iterator match spec
PR-URL: https://github.com/nodejs/node/pull/11057
Fixes: https://github.com/nodejs/node/issues/10799
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-01-31 09:29:42 -08:00
James M Snell
5de3cf099c lib: add static identifier codes for all deprecations
Assigns a static identifier code to all runtime and documentation
only deprecations. The identifier code is included in the emitted
DeprecationWarning.

Also adds a deprecations.md to the API docs to provide a central
location where deprecation codes can be referenced and explained.

PR-URL: https://github.com/nodejs/node/pull/10116
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-01-30 11:11:57 -08:00
James M Snell
03e89b3ff2 process: add --redirect-warnings command line argument
The --redirect-warnings command line argument allows process warnings
to be written to a specified file rather than printed to stderr.

Also adds an equivalent NODE_REDIRECT_WARNINGS environment variable.

If the specified file cannot be opened or written to for any reason,
the argument is ignored and the warning is printed to stderr.

If the file already exists, it will be appended to.

PR-URL: https://github.com/nodejs/node/pull/10116
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-01-30 11:11:47 -08:00
James M Snell
5e1f32fd94 process: add optional code to warnings + type checking
Add the ability to assign an optional code to process warnings +
add additional type checking to ensure that names and codes can
only be strings.

PR-URL: https://github.com/nodejs/node/pull/10116
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-01-30 11:09:38 -08:00
cjihrig
5587ff1ccd dns: handle implicit bind DNS errors
When send() triggers an implicit bind, the send operation is
added to an internal queue. If a DNS error occurs during the bind,
there is currently no mechanism for clearing the queue other than
sending more data. If DNS errors keep occurring, the queue will
continue to grow with no upper bound. This commit reports errors
with implicit binds, and clears the queue. This should be fine,
given the nature of UDP.

Refs: https://github.com/nodejs/node-v0.x-archive/pull/8705
Refs: https://github.com/nodejs/node/pull/10902
PR-URL: https://github.com/nodejs/node/pull/11036
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-30 11:48:59 -05:00
Luigi Pinca
18d4ee97d8 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-01-28 18:04:29 +01:00
Timothy Gu
06ecf4dec7 url: define @@toStringTag as a data property
Even though this is not fully Web IDL spec-compliant, it is arguably the
best we can do. Following the spec would mean non-trivial performance
deterioration (10% when parsing a medium-length URL), while the current
getter behavior is not adopted by any implementer, and it causes some
spec ambiguity when the getter is called with !(this instanceof URL).

This commit adopts Chrome's behavior, and is consistent with
ECMAScript-defined classes while providing reasonable behaviors for
corner cases as well. Until the Web IDL spec is changed one way or
another, this is the way to go.

PR-URL: https://github.com/nodejs/node/pull/10906
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-01-28 08:27:15 -08:00
Timothy Gu
d65904bc6a url: do not public expose inspect methods on URL
PR-URL: https://github.com/nodejs/node/pull/10906
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-01-28 08:27:09 -08:00
Javis Sullivan
3268863ebc child_process: add string shortcut for fork stdio
Add string shortcut option for stdio parameter.

Fixes: https://github.com/nodejs/node/issues/10793
PR-URL: https://github.com/nodejs/node/pull/10866
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-01-27 12:06:48 -08:00
Timothy Gu
e71c278288 url: stop exporting originFor()
PR-URL: https://github.com/nodejs/node/pull/10955
Fixes: https://github.com/nodejs/node/issues/10800
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-01-27 07:35:36 -08:00
Brian White
24ef1e6775 string_decoder: align UTF-8 handling with V8
V8 5.5 changed how invalid characters are handled and it now appears
to follow the WHATWG Encoding standard, where all of an invalid
character's bytes are replaced by a single replacement character
(\ufffd) instead of replacing each invalid byte with separate
replacement characters.

Example: the byte sequence 0xF0,0xB8,0x41 is decoded as '\ufffdA' in
V8 5.5, but is decoded as '\ufffd\ufffdA' in previous versions of V8.

PR-URL: https://github.com/nodejs/node/pull/9618
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-01-26 22:46:18 +01:00
Michaël Zasso
007386ee81 repl: remove workaround for function redefinition
The issue is fixed upstream in V8. Thus we do not need this workaround
in REPL.

Fixes: https://github.com/nodejs/node/issues/548
PR-URL: https://github.com/nodejs/node/pull/9618
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-01-26 22:46:18 +01:00
Rich Trott
dd928b04fc zlib: be strict about what strategies are accepted
Currently, strategy constants are integers but Node.js will accept
string versions of those integers. Users should be using the provided
zlib constants and not hardcoding numbers, strings, or anything else. As
such, Node.js should be strict about accepting only exactly those values
that are in the provided zlib constants.

PR-URL: https://github.com/nodejs/node/pull/10934
Fixes: https://github.com/nodejs/node/issues/10932
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-01-25 14:07:43 -08:00
Brian White
3bdcbdb1a0
querystring: improve unescapeBuffer performance
PR-URL: https://github.com/nodejs/node/pull/10837
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-25 02:22:26 -05:00
Brian White
05f38be556
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-01-25 02:15:03 -05:00
Brian White
2298bc4b1f
querystring: improve parse() performance
PR-URL: https://github.com/nodejs/node/pull/10874
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-25 02:05:26 -05:00
Brian White
9e0f6a5eb4
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-01-25 01:42:42 -05:00
dcposch@dcpos.ch
39f65e6656
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-01-25 00:37:50 +01:00
Timothy Gu
ed0086fb46 url: check forEach callback is a function
The Web IDL spec mandates such a check.

Also make error messages consistent with rest of Node.js and add
additional tests for forEach().

PR-URL: https://github.com/nodejs/node/pull/10905
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-01-23 16:24:33 -08:00