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

16924 Commits

Author SHA1 Message Date
Sakthipriyan Vairamani (thefourtheye)
d75fdd96aa
child_process: improve killSignal validations
As it is, the `killSignal` is just retrieved from an object and used.
If the signal passed is actually one of the inherited properties of
that object, Node.js will die. For example,

    ➜  node -e "child_process.spawnSync('ls', {killSignal: 'toString'})"
    Assertion failed: (0), function uv_close, file ....core.c, line 166.
    [1]    58938 abort      node -e "child_process.spawnSync(...)"

1. This patch makes sure that the signal is actually a own property of
   the constants object.

2. Extends the killSignal validation to all the other functions.

PR-URL: https://github.com/nodejs/node/pull/10423

Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-04-04 13:02:51 +05:30
Teddy Katz
a5f91ab230
src: throw when -c and -e are used simultaneously
The -c flag ("check script syntax") and -e flag ("evaluate given code")
have contradictory meanings. Make them mutually exclusive by throwing
when both of them are provided.

Fixes: https://github.com/nodejs/node/issues/11680
PR-URL: https://github.com/nodejs/node/pull/11689
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-04-03 22:07:45 -04:00
Teddy Katz
3209a8ebf3
lib: ensure --check flag works for piped-in code
Previously, the --check CLI flag had no effect when run on code piped
from stdin. This commit updates the bootstrap logic to handle the
--check flag the same way regardless of whether the code is piped from
stdin.

PR-URL: https://github.com/nodejs/node/pull/11689
Fixes: https://github.com/nodejs/node/issues/11680
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-04-03 22:07:32 -04:00
Luca Maraschi
53828e8bff test: extended test to makeCallback cb type check
makeCallback and makeStatsCallback are both tested intedependently.

PR-URL: https://github.com/nodejs/node/pull/12140
Fixes: https://github.com/nodejs/node/issues/12136
Reviewed-By: Luigi Pinca <luigipinca@gmail.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-04-03 13:32:19 -04:00
James M Snell
7eb1b4658e buffer: zero fill Buffer(num) by default
PR-URL: https://github.com/nodejs/node/pull/12141
Ref: https://github.com/nodejs/CTC/issues/89
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2017-04-03 09:57:24 -07:00
James M Snell
7b4a72d797 errors: add space between error name and code
`Error[CODE]` becomes `Error [CODE]`

PR-URL: https://github.com/nodejs/node/pull/12099
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2017-04-03 09:48:40 -07:00
Anna Henningsen
9b05393362
test: fix V8 test on big-endian machines
Ref: https://github.com/nodejs/node/pull/12143#issuecomment-291131159
PR-URL: https://github.com/nodejs/node/pull/12186
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-04-03 15:15:08 +02:00
Daijiro Wachi
843b7e68ca test: synchronize WPT url setter test data
Updates:
+ Bring tests url-setter-tests from WPT, and put it as JavaScript
+ Comment out unpassed tests

Refs: https://github.com/w3c/web-platform-tests/pull/5112
Refs: https://github.com/nodejs/node/pull/11887
PR-URL: https://github.com/nodejs/node/pull/12058
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-04-03 18:12:05 +09:00
Daijiro Wachi
50bfef66f0 test: synchronize WPT url test data
Refs: https://github.com/w3c/web-platform-tests/pull/4586
Refs: https://github.com/nodejs/node/pull/11887
PR-URL: https://github.com/nodejs/node/pull/12058
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-04-03 18:11:58 +09:00
Daijiro Wachi
f8f46f9917 url: change path parsing for non-special URLs
This changes to the way path parsing for non-special URLs.
It allows paths to be empty for non-special URLs and also
takes that into account when serializing.

Fixes: https://github.com/nodejs/node/issues/11962
Refs: https://github.com/whatwg/url/pull/213
PR-URL: https://github.com/nodejs/node/pull/12058
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-04-03 18:11:51 +09:00
Anna Henningsen
33a19b46ca v8: fix offsets for TypedArray deserialization
Fix the offset calculation for deserializing TypedArrays that are
not aligned in their original buffer.

Since `byteOffset` refers to the offset into the source `Buffer`
instance, not its underlying `ArrayBuffer`, that is what should
be passed to `buffer.copy`.

PR-URL: https://github.com/nodejs/node/pull/12143
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-03 10:38:10 +02:00
Jason Ginchereau
56e881d0b0
n-api: add support for abi stable module API
Add support for abi stable module API (N-API) as "Experimental feature".
The goal of this API is to provide a stable Node API for native
module developers. N-API aims to provide ABI compatibility guarantees
across different Node versions and also across different
Node VMs - allowing N-API enabled native modules to just work
across different versions and flavors of Node.js without recompilation.

A more detailed introduction is provided in:
https://github.com/nodejs/node-eps/blob/master/005-ABI-Stable-Module-API.md
and https://github.com/nodejs/abi-stable-node/blob/doc/VM%20Summit.pdf.

The feature, during its experimental state, will be guarded by a runtime
flag "--napi-modules". Only when this flag is added to the command line
will N-API modules along with regular non N-API modules be supported.

The API is defined by the methods in "src/node_api.h" and
"src/node_api_types.h". This is the best
starting point to review the API surface. More documentation will follow.

In addition to the implementation of the API using V8, which is included
in this PR, the API has also been validated against chakracore and that
port is available in
https://github.com/nodejs/abi-stable-node/tree/api-prototype-chakracore-8.x.

The current plan is to provide N-API support in versions 8.X and 6.X
directly. For older versions, such as 4.X or pre N-API versions of 6.X,
we plan to create an external npm module to provide a migration path
that will allow modules targeting older Node.js versions to use the API,
albeit without getting the advantage of not having to recompile.

In addition, we also plan an external npm package with C++ sugar to
simplify the use of the API. The sugar will be in-line only and will
only use the exported N-API methods but is not part of the N-API
itself. The current version is in:
https://github.com/nodejs/node-api.

This PR is a result of work in the abi-stable-node repo:
https://github.com/nodejs/abi-stable-node/tree/doc,
with this PR being the cumulative work on the api-prototype-8.x
branch with the following contributors in alphabetical order:

Author: Arunesh Chandra <arunesh.chandra@microsoft.com>
Author: Gabriel Schulhof <gabriel.schulhof@intel.com>
Author: Hitesh Kanwathirtha <hiteshk@microsoft.com>
Author: Ian Halliday <ianhall@microsoft.com>
Author: Jason Ginchereau <jasongin@microsoft.com>
Author: Michael Dawson <michael_dawson@ca.ibm.com>
Author: Sampson Gao <sampsong@ca.ibm.com>
Author: Taylor Woll <taylor.woll@microsoft.com>
PR-URL: https://github.com/nodejs/node/pull/11975
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-03 10:31:25 +02:00
Joseph Gentle
6481c93aef
assert: add support for Map and Set in deepEqual
assert.deepEqual and assert.deepStrictEqual currently return true for
any pair of Maps and Sets regardless of content. This patch adds
support in deepEqual and deepStrictEqual to verify the contents of Maps
and Sets.

Deeo equivalence checking is currently an
O(n^2) operation, and worse, it gets slower exponentially if maps
and sets were nested.

Note that this change breaks compatibility with previous versions of
deepEqual and deepStrictEqual if consumers were depending on all maps
and sets to be seen as equivalent. The old behaviour was never
documented, but nevertheless there are certainly some tests out there
which depend on it.

Support has stalled because the assert API was frozen, but was recently
unfrozen in CTC#63.

---

Later squashed in:

This change updates the checks for deep equality checking on Map and Set
to check all set values / all map keys to see if any of them match the
expected result.

This change is much slower, but based on the conversation in the pull
request its probably the right approach.

Fixes: https://github.com/nodejs/node/issues/2309
Refs: https://github.com/substack/tape/issues/342
Refs: https://github.com/nodejs/node/pull/2315
Refs: https://github.com/nodejs/CTC/issues/63
PR-URL: https://github.com/nodejs/node/pull/12142
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-04-03 10:15:53 +02:00
Anna Henningsen
3cc3e099be
util: show External values explicitly in inspect
Display `v8::External` values as `[External]` rather than `{}`
which makes them look like objects.

PR-URL: https://github.com/nodejs/node/pull/12151
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-04-03 10:08:26 +02:00
Timothy Gu
91383e47fd
zlib: support Uint8Array in convenience methods
Also support Uint8Array as a `dictionary` option.

PR-URL: https://github.com/nodejs/node/pull/12001
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-04-03 09:50:09 +02:00
Roman Reiss
2d039ffa29
doc: add logo to README
Adds a centered logo to the README to make it a little more festive. As
centering is not possible in pure Markdown, a bit of HTML is used.

PR-URL: https://github.com/nodejs/node/pull/12148
Ref: https://github.com/nodejs/node/issues/6920
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-04-02 13:54:34 +02:00
Joyee Cheung
0ea45707a4 net: rename internal functions for readability
* Rename listen to listenInCluster
* Rename _listen2 to _setupListenHandle
* Remove _listen since it's a one-liner only used in one place
* Correct comments in server.listen

PR-URL: https://github.com/nodejs/node/pull/11796
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-02 01:38:24 +08:00
Tobias Nießen
0e710aada4
crypto: add sign/verify support for RSASSA-PSS
Adds support for the PSS padding scheme. Until now, the sign/verify
functions used the old EVP_Sign*/EVP_Verify* OpenSSL API, making it
impossible to change the padding scheme. Fixed by first computing the
message digest and then signing/verifying with a custom EVP_PKEY_CTX,
allowing us to specify options such as the padding scheme and the PSS
salt length.

Fixes: https://github.com/nodejs/node/issues/1127
PR-URL: https://github.com/nodejs/node/pull/11705
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-04-01 13:27:52 +02:00
Anna Henningsen
c68da89694
build: always use V8_ENABLE_CHECKS in debug mode
Define `V8_ENABLE_CHECKS` in `common.gypi` for the debug mode.
Without this, these checks would only be present in the object files
generated from the V8 build, and so for inline functions in v8.h
multiple different definitions could be generated, where one definition
includes the check and the other does not.

Refs: https://github.com/nodejs/node/pull/11975#discussion_r108005423
PR-URL: https://github.com/nodejs/node/pull/12029
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
2017-03-31 22:12:57 +02:00
AnnaMag
241de510a8
vm: use SetterCallback to set func declarations
Currently, when in strict mode, function
declarations are copied on the sandbox by
CopyProperties(), which is not necessary
and will break when CP is removed.

This change maintains current behavior,
letting GlobalPropertySetterCallback
copy functions on the sandbox instead
of using CP to do the task.

PR-URL: https://github.com/nodejs/node/pull/12051
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-31 22:07:45 +02:00
Jeremiah Senkpiel
1b63fa1096
tty: remove NODE_TTY_UNSAFE_ASYNC
Nothing but trouble can ever come from it.

PR-URL: https://github.com/nodejs/node/pull/12057
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-03-31 22:02:25 +02:00
Nikolai Vavilov
7e0c3ab641 src: fix base64 decoding
Make sure trailing garbage is not treated as a valid base64 character.

Fixes: https://github.com/nodejs/node/issues/11987
PR-URL: https://github.com/nodejs/node/pull/11995
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-31 23:00:02 +03:00
Ben Noordhuis
7c0079f1be
src: add .FromJust(), fix -Wunused-result warnings
Missed while reviewing 1fde98b ("v8: expose new V8 serialization API.")

PR-URL: https://github.com/nodejs/node/pull/12118
Refs: https://github.com/nodejs/node/pull/11048
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-03-31 21:53:20 +02:00
Daniel Bevenius
8a7db9d4b5 src: add --use-bundled-ca --use-openssl-ca check
The --use-bundled-ca and --use-openssl-ca command line arguments are
mutually exclusive but can both be used on the same command line.

This commit adds a check if both options are used.

Fixes: https://github.com/nodejs/node/issues/12083
PR-URL: https://github.com/nodejs/node/pull/12087
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-03-31 20:10:36 +02:00
Michaël Zasso
4d255b04bf tools: update dotfile whitelist in .gitignore
.eslintrc was renamed in #7699 to .eslintrc.yaml.

PR-URL: https://github.com/nodejs/node/pull/12116
Refs: https://github.com/nodejs/node/pull/7699
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-31 14:41:35 +02:00
Rich Trott
a10e657657 test: fix flaky child-process-exec-kill-throws
This is a fix for test-child-process-exec-kill-throws which is currently
flaky on Windows.

A bug in the test was causing the child process to fail for reasons
other than those intended by the test. Instead of failing for exceeding
the `maxBuffer` setting, the test was failing because it was trying to
load `internal/child_process` without being passed the
`expose-internals` flag. Move that module to where only the parent
process (which gets the flag) loads it.

Additionally, improve an assertion message to help debug problems like
this.

PR-URL: https://github.com/nodejs/node/pull/12111
Fixes: https://github.com/nodejs/node/issues/12053
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-03-30 22:49:19 -07:00
Daniel Bevenius
92de91d570 test: fix truncation of argv
Currently argv_[1] and argv_[2] are getting truncated by one character
because of an incorrect addition of one to account for the null
character. I only noticed this when working on #12087, but that fix
will probably not get included in favor of a JavaScript test so I'm
adding this separate commit for it.

Refs: https://github.com/nodejs/node/pull/12087
PR-URL: https://github.com/nodejs/node/pull/12110
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-03-31 07:15:24 +02:00
Steven R. Loomis
b08490774d
tools: add missing #include "unicode/putil.h"
* we use u_setDataDirectory() in "unicode/putil.h"
* at present, this header is indirectly included,
  but this will change in ICU 59
* no impact on past ICUs.
* this is an exact analog to https://github.com/nodejs/node/issues/11753

PR-URL: https://github.com/nodejs/node/pull/12078
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-03-30 14:20:52 -07:00
Eugene Ostroukhov
7954d2a4c7 inspector: use inspector API for "break on start"
This change removes a need for using deprecated debug context for
breaking at the start of the main module.

PR-URL: https://github.com/nodejs/node/pull/12076
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-03-30 13:25:05 -07:00
Timothy Gu
4ddd23f0ec src: WHATWG URL C++ parser cleanup
- Clarify port state
- Remove scheme flag
- Clarify URL_FLAG_TERMINATED

PR-URL: https://github.com/nodejs/node/pull/11917
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-03-29 22:19:33 -07:00
James M Snell
7139b93a8b url: add ToObject method to native URL class
Provides a factory method to convert a native URL class
into a JS URL object.

```c++
Environment* env = ...

URL url("http://example.org/a/b/c?query#fragment");

MaybeLocal<Value> val = url.ToObject(env);
```

PR-URL: https://github.com/nodejs/node/pull/12056
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-29 20:48:25 -07:00
Brian White
61ebfa8d1f tools: add unescaped regexp dot rule to linter
PR-URL: https://github.com/nodejs/node/pull/11834
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2017-03-29 10:53:28 +02:00
Daniel Bevenius
678480e328 deps: backport 8dde6ac from upstream V8
Commit 9c9e2d7f4a changed the name of TypeFeedbackVector to
FeedbackVector but that commit did not update gdbinit. This applies the
changed to gdbinit from upstream V8.

Original commit message:

[gdbinit] Rename TypeFeedback* to Feedback*.

    BUG=

    Change-Id: I1e32fdcf9edda57f5de329c8b694620a5da4558b
    Reviewed-on: https://chromium-review.googlesource.com/442444
    Reviewed-by: Michael Stanton <mvstanton@chromium.org>
    Commit-Queue: Igor Sheludko <ishell@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#43185}

PR-URL: https://github.com/nodejs/node/pull/12060
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-03-29 07:47:31 +02:00
Roman Reiss
a46c43d21a
util: add %i and %f formatting specifiers
This change brings formatting specifiers available in `util.format` and
consequently, `console.*` closer to what is supported in all major
browsers.

- `%i` is introduced to format integer values.
- `%f` is introduced to format floating point values.

Fixes: https://github.com/nodejs/node/issues/10292
PR-URL: https://github.com/nodejs/node/pull/10308
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-29 07:12:05 +02:00
Anna Henningsen
1fde98bb4f
v8: expose new V8 serialization API
Expose the new serialization API that was added in V8 5.5 to userland.
The JS API is virtually a direct copy of what V8 provides on the
C++ level.

This is useful Node as a possible replacement for some internals
that currently use JSON, like IPC, but is likely to be useful to
general userland code as well.

PR-URL: https://github.com/nodejs/node/pull/11048
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-03-29 05:14:55 +02:00
Anna Henningsen
6d93508369
buffer: expose FastBuffer on internal/buffer
PR-URL: https://github.com/nodejs/node/pull/11048
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-03-29 05:14:16 +02:00
Myles Borins
9b2dd47704 2017-03-28, Version 7.8.0 (Current)
Notable changes:

* buffer:
  - do not segfault on out-of-range index (Timothy Gu)
    https://github.com/nodejs/node/pull/11927
* crypto:
  - Fix memory leak if certificate is revoked (Tom Atkinson)
    https://github.com/nodejs/node/pull/12089
* deps:
  * upgrade npm to 4.2.0 (Kat Marchán)
    https://github.com/nodejs/node/pull/11389
  * fix async await desugaring in V8 (Michaël Zasso)
    https://github.com/nodejs/node/pull/12004
* readline:
  - add option to stop duplicates in history (Danny Nemer)
    https://github.com/nodejs/node/pull/2982
* src:
  - add native URL class (James M Snell)
    https://github.com/nodejs/node/pull/11801

PR-URL: https://github.com/nodejs/node/pull/12104
2017-03-28 23:05:21 -04:00
Anna Henningsen
4a5a9445b5 util: use [Array] for deeply nested arrays
Prefer `[Array]` over `[Object]` because the latter is confusing.

PR-URL: https://github.com/nodejs/node/pull/12046
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-03-28 13:11:07 -07:00
Gibson Fahnestock
cd4ddfdef2 lib: add comment to script eval _tickCallback
Add a comment to match lib/module.js, missed in #11958.

PR-URL: https://github.com/nodejs/node/pull/12050
Ref: https://github.com/nodejs/node/pull/11958
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-03-28 13:04:59 -07:00
Rich Trott
682573c11d buffer: remove error for malformatted hex string
Remove error message when a hex string of an incorrect length is sent
to .write() or .fill().

PR-URL: https://github.com/nodejs/node/pull/12012
Fixes: https://github.com/nodejs/node/issues/3770
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>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-03-28 11:31:10 -07:00
Tom Atkinson
a6f94942b0 crypto: fix memory leak if certificate is revoked
The additional validity checks applied to StartCom and WoSign
certificates failed to free memory before returning.

Refs: https://github.com/nodejs/node/pull/9469
Fixes: https://github.com/nodejs/node/issues/12033
PR-URL: https://github.com/nodejs/node/pull/12089
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-03-29 03:14:55 +09:00
Franziska Hinkelmann
fd18243a50 test: fix misleading comment
The comment is outdated, function declarations have
nothing to do with defineProperties.

PR-URL: https://github.com/nodejs/node/pull/12048
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-28 18:34:23 +02:00
Nikolai Vavilov
01ffe30d18 doc: clarify out-of-bounds behavior of buf[index]
PR-URL: https://github.com/nodejs/node/pull/11286
Fixes: https://github.com/nodejs/node/issues/11244
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ron Korving <ron@ronkorving.nl>
2017-03-28 11:25:55 +03:00
Vse Mozhet Byt
642baf4699 benchmark: check end() argument to be > 0
PR-URL: https://github.com/nodejs/node/pull/12030
Ref: https://github.com/nodejs/node/issues/11972
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-03-28 03:18:44 +03:00
Gibson Fahnestock
66e7dc5587
test: mark child-process-exec-kill-throws flaky
PR-URL: https://github.com/nodejs/node/pull/12054
Ref: https://github.com/nodejs/node/issues/12053
Ref: https://github.com/nodejs/node/pull/11038
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-03-27 18:45:13 +01:00
Vse Mozhet Byt
31da3757fa doc: update and modernize examples in fs.ms
* unify quotes in fs.md
* avoid quote escaping in fs.md
* simplify logics in fs.md
* concatenation -> template literal in fs.md
* add missing callback in fs.md
* fix typo in fs.md
* update output example in fs.md

PR-URL: https://github.com/nodejs/node/pull/12035
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-27 10:33:23 -07:00
Ahmad Nassri
d367a0a3ac doc: fix https.timeout docs
`server.timeout` is a property, not a method

PR-URL: https://github.com/nodejs/node/pull/12039
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-27 10:31:43 -07:00
Ahmad Nassri
d437841961 doc: fix http properties documented as methods
* at 9772fb9282
  [`maxHeadersCount`][maxheaderscount] and [`timeout`][timeout]
  were erroneously changed to methods
* `maxHeadersCount` was also listed to default to `1000` where
  it actually is [`2000`][default]

[maxheaderscount]: e0a9ad1af2/lib/_http_server.js (L276)
[timeout]: e0a9ad1af2/lib/_http_server.js (L273)
[default]: e0a9ad1af2/lib/_http_server.js (L312)

PR-URL: https://github.com/nodejs/node/pull/12039
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-27 10:30:50 -07:00
Alexey Orlenko
52b666ee3d test: fix broken tests in test-buffer-includes
Some of the tests for `buffer.includes()` functionality introduced in
https://github.com/nodejs/node/pull/3567 have been broken in a way that
caused them to always pass regardless of the result of the tested
method.

This behavior was caused by two reasons:

 * These tests were written as though `buffer.includes()` was supposed
   to return the same value that `buffer.indexOf()` does, i.e., used
   indices or -1 as expected return values instead of true and false.
 * `assert()` was used as the assertion function to do that instead of
   `assert.strictEqual()`.

Thus `assert()` was called with a non-zero number as the first argument
effectively causing these tests to pass.

This commit changes the tests to use `assert.ok()` and removes redundant
indices.

PR-URL: https://github.com/nodejs/node/pull/12040
Ref: https://github.com/nodejs/node/pull/3567
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-27 10:28:25 -07:00
Rich Trott
45df578f62 doc: edit the benchmark guide
These are minor typographical and style improvements to the guide for
writing and running benchmarks.

PR-URL: https://github.com/nodejs/node/pull/12041
Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-27 10:27:08 -07:00