Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit db4f534

Browse files
committed
meta: merge node/master into node-chakracore/master
Merge 3b8da4c as of 2017-12-19 This commit was automatically generated. For any problems, please contact jackhorton Reviewed-By: Taylor Woll <tawoll@ntdev.microsoft.com>
2 parents 8975880 + 3b8da4c commit db4f534

File tree

178 files changed

+3608
-3342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+3608
-3342
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# Contributing to Node.js
22

3-
Contributions to Node.js may come in many forms. Some contribute code changes,
4-
others contribute docs, others help answer questions from users, help keep the
5-
infrastructure running, or seek out ways of advocating for Node.js users of all
6-
types.
3+
Contributions to Node.js include code, documentation, answering user questions,
4+
running the project's infrastructure, and advocating for all types of Node.js
5+
users.
76

87
The Node.js project welcomes all contributions from anyone willing to work in
9-
good faith both with other contributors and with the community. No contribution
10-
is too small and all contributions are valued.
8+
good faith with other contributors and the community. No contribution is too
9+
small and all contributions are valued.
1110

12-
This guide details the basic steps for getting started contributing to the
13-
Node.js project's core `nodejs/node` GitHub Repository and describes what to
14-
expect throughout each step of the process.
11+
This guide explains the process for contributing to the Node.js project's core
12+
`nodejs/node` GitHub Repository and describes what to expect at each step.
1513

1614
* [Code of Conduct](#code-of-conduct)
1715
* [Bad Actors](#bad-actors)

doc/api/assert.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -740,12 +740,15 @@ assert.throws(
740740

741741
Validate error message using [`RegExp`][]:
742742

743+
Using a regular expression runs `.toString` on the error object, and will
744+
therefore also include the error name.
745+
743746
```js
744747
assert.throws(
745748
() => {
746749
throw new Error('Wrong value');
747750
},
748-
/value/
751+
/^Error: Wrong value$/
749752
);
750753
```
751754

@@ -767,17 +770,42 @@ assert.throws(
767770

768771
Note that `error` can not be a string. If a string is provided as the second
769772
argument, then `error` is assumed to be omitted and the string will be used for
770-
`message` instead. This can lead to easy-to-miss mistakes:
773+
`message` instead. This can lead to easy-to-miss mistakes. Please read the
774+
example below carefully if using a string as the second argument gets
775+
considered:
771776

772777
<!-- eslint-disable no-restricted-syntax -->
773778
```js
774-
// THIS IS A MISTAKE! DO NOT DO THIS!
775-
assert.throws(myFunction, 'missing foo', 'did not throw with expected message');
776-
777-
// Do this instead.
778-
assert.throws(myFunction, /missing foo/, 'did not throw with expected message');
779+
function throwingFirst() {
780+
throw new Error('First');
781+
}
782+
function throwingSecond() {
783+
throw new Error('Second');
784+
}
785+
function notThrowing() {}
786+
787+
// The second argument is a string and the input function threw an Error.
788+
// In that case both cases do not throw as neither is going to try to
789+
// match for the error message thrown by the input function!
790+
assert.throws(throwingFirst, 'Second');
791+
assert.throws(throwingSecond, 'Second');
792+
793+
// The string is only used (as message) in case the function does not throw:
794+
assert.throws(notThrowing, 'Second');
795+
// AssertionError [ERR_ASSERTION]: Missing expected exception: Second
796+
797+
// If it was intended to match for the error message do this instead:
798+
assert.throws(throwingSecond, /Second$/);
799+
// Does not throw because the error messages match.
800+
assert.throws(throwingFirst, /Second$/);
801+
// Throws a error:
802+
// Error: First
803+
// at throwingFirst (repl:2:9)
779804
```
780805

806+
Due to the confusing notation, it is recommended not to use a string as the
807+
second argument. This might lead to difficult-to-spot errors.
808+
781809
[`Error.captureStackTrace`]: errors.html#errors_error_capturestacktrace_targetobject_constructoropt
782810
[`Map`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map
783811
[`Object.is()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is

doc/api/child_process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ added: v0.1.90
980980

981981
* `signal` {string}
982982

983-
The `subprocess.kill()` methods sends a signal to the child process. If no
983+
The `subprocess.kill()` method sends a signal to the child process. If no
984984
argument is given, the process will be sent the `'SIGTERM'` signal. See
985985
signal(7) for a list of available signals.
986986

doc/api/errors.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,11 @@ Status code was outside the regular status code range (100-999).
810810
The `Trailer` header was set even though the transfer encoding does not support
811811
that.
812812

813+
<a id="ERR_HTTP2_ALREADY_SHUTDOWN"></a>
814+
### ERR_HTTP2_ALREADY_SHUTDOWN
815+
816+
Occurs with multiple attempts to shutdown an HTTP/2 session.
817+
813818
<a id="ERR_HTTP2_CONNECT_AUTHORITY"></a>
814819
### ERR_HTTP2_CONNECT_AUTHORITY
815820

@@ -833,6 +838,12 @@ forbidden.
833838

834839
A failure occurred sending an individual frame on the HTTP/2 session.
835840

841+
<a id="ERR_HTTP2_GOAWAY_SESSION"></a>
842+
### ERR_HTTP2_GOAWAY_SESSION
843+
844+
New HTTP/2 Streams may not be opened after the `Http2Session` has received a
845+
`GOAWAY` frame from the connected peer.
846+
836847
<a id="ERR_HTTP2_HEADER_REQUIRED"></a>
837848
### ERR_HTTP2_HEADER_REQUIRED
838849

@@ -972,6 +983,11 @@ client.
972983
An attempt was made to use the `Http2Stream.prototype.responseWithFile()` API to
973984
send something other than a regular file.
974985

986+
<a id="ERR_HTTP2_SESSION_ERROR"></a>
987+
### ERR_HTTP2_SESSION_ERROR
988+
989+
The `Http2Session` closed with a non-zero error code.
990+
975991
<a id="ERR_HTTP2_SOCKET_BOUND"></a>
976992
### ERR_HTTP2_SOCKET_BOUND
977993

@@ -989,10 +1005,11 @@ Use of the `101` Informational status code is forbidden in HTTP/2.
9891005
An invalid HTTP status code has been specified. Status codes must be an integer
9901006
between `100` and `599` (inclusive).
9911007

992-
<a id="ERR_HTTP2_STREAM_CLOSED"></a>
993-
### ERR_HTTP2_STREAM_CLOSED
1008+
<a id="ERR_HTTP2_STREAM_CANCEL"></a>
1009+
### ERR_HTTP2_STREAM_CANCEL
9941010

995-
An action was performed on an HTTP/2 Stream that had already been closed.
1011+
An `Http2Stream` was destroyed before any data was transmitted to the connected
1012+
peer.
9961013

9971014
<a id="ERR_HTTP2_STREAM_ERROR"></a>
9981015
### ERR_HTTP2_STREAM_ERROR

0 commit comments

Comments
 (0)