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

Commit

Permalink
Merge nodejs/master
Browse files Browse the repository at this point in the history
Merge 97c4394 as of 2017-08-10.
This is an automatically created merge. For any problems please
contact @kunalspathak.
  • Loading branch information
chakrabot committed Aug 11, 2017
2 parents 8c646a0 + 97c4394 commit dc0f0d7
Show file tree
Hide file tree
Showing 33 changed files with 482 additions and 205 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V8.md#8.2.1">8.2.1</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V8.md#8.3.0">8.3.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.2.1">8.2.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.2.0">8.2.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.1.4">8.1.4</a><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.1.3">8.1.3</a><br/>
Expand Down
9 changes: 8 additions & 1 deletion benchmark/process/next-tick-breadth-args.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ function main(conf) {
if (n === N)
bench.end(n / 1e6);
}
function cb4(arg1, arg2, arg3, arg4) {
n++;
if (n === N)
bench.end(n / 1e6);
}

bench.start();
for (var i = 0; i < N; i++) {
if (i % 3 === 0)
if (i % 4 === 0)
process.nextTick(cb4, 3.14, 1024, true, false);
else if (i % 3 === 0)
process.nextTick(cb3, 512, true, null);
else if (i % 2 === 0)
process.nextTick(cb2, false, 5.1);
Expand Down
25 changes: 22 additions & 3 deletions benchmark/process/next-tick-depth-args.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,24 @@ process.maxTickDepth = Infinity;
function main(conf) {
var n = +conf.millions * 1e6;

function cb4(arg1, arg2, arg3, arg4) {
if (--n) {
if (n % 4 === 0)
process.nextTick(cb4, 3.14, 1024, true, false);
else if (n % 3 === 0)
process.nextTick(cb3, 512, true, null);
else if (n % 2 === 0)
process.nextTick(cb2, false, 5.1);
else
process.nextTick(cb1, 0);
} else
bench.end(+conf.millions);
}
function cb3(arg1, arg2, arg3) {
if (--n) {
if (n % 3 === 0)
if (n % 4 === 0)
process.nextTick(cb4, 3.14, 1024, true, false);
else if (n % 3 === 0)
process.nextTick(cb3, 512, true, null);
else if (n % 2 === 0)
process.nextTick(cb2, false, 5.1);
Expand All @@ -23,7 +38,9 @@ function main(conf) {
}
function cb2(arg1, arg2) {
if (--n) {
if (n % 3 === 0)
if (n % 4 === 0)
process.nextTick(cb4, 3.14, 1024, true, false);
else if (n % 3 === 0)
process.nextTick(cb3, 512, true, null);
else if (n % 2 === 0)
process.nextTick(cb2, false, 5.1);
Expand All @@ -34,7 +51,9 @@ function main(conf) {
}
function cb1(arg1) {
if (--n) {
if (n % 3 === 0)
if (n % 4 === 0)
process.nextTick(cb4, 3.14, 1024, true, false);
else if (n % 3 === 0)
process.nextTick(cb3, 512, true, null);
else if (n % 2 === 0)
process.nextTick(cb2, false, 5.1);
Expand Down
5 changes: 2 additions & 3 deletions doc/api/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,6 @@ The following `addon.cc` implements AtExit:

```cpp
// addon.cc
#undef NDEBUG
#include <assert.h>
#include <stdlib.h>
#include <node.h>
Expand Down Expand Up @@ -1110,10 +1109,10 @@ static void sanity_check(void*) {
}

void init(Local<Object> exports) {
AtExit(sanity_check);
AtExit(at_exit_cb2, cookie);
AtExit(at_exit_cb2, cookie);
AtExit(at_exit_cb1, exports->GetIsolate());
AtExit(sanity_check);
}

NODE_MODULE(addon, init)
Expand All @@ -1125,7 +1124,7 @@ Test in JavaScript by running:
```js
// test.js
const addon = require('./build/Release/addon');
require('./build/Release/addon');
```

[Embedder's Guide]: https://github.com/v8/v8/wiki/Embedder's%20Guide
Expand Down
6 changes: 3 additions & 3 deletions doc/api/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ console.log('this will also print');

### console.clear()
<!-- YAML
added: REPLACEME
added: v8.3.0
-->

When `stdout` is a TTY, calling `console.clear()` will attempt to clear the
Expand All @@ -183,7 +183,7 @@ binary.

### console.count([label])
<!-- YAML
added: REPLACEME
added: v8.3.0
-->

* `label` {string} The display label for the counter. Defaults to `'default'`.
Expand Down Expand Up @@ -216,7 +216,7 @@ undefined

### console.countReset([label = 'default'])
<!-- YAML
added: REPLACEME
added: v8.3.0
-->

* `label` {string} The display label for the counter. Defaults to `'default'`.
Expand Down
4 changes: 2 additions & 2 deletions doc/api/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ the [Implementation considerations section][] for more information.

## Class dns.Resolver
<!-- YAML
added: REPLACEME
added: v8.3.0
-->

An independent resolver for DNS requests.
Expand Down Expand Up @@ -97,7 +97,7 @@ The following methods from the `dns` module are available:

### resolver.cancel()
<!-- YAML
added: REPLACEME
added: v8.3.0
-->

Cancel all outstanding DNS queries made by this resolver. The corresponding
Expand Down
12 changes: 12 additions & 0 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,18 @@ loop tick.
System-level errors are generated as augmented `Error` instances, which are
detailed [here](#errors_system_errors).

## Class: AssertionError

A subclass of `Error` that indicates the failure of an assertion. Such errors
commonly indicate inequality of actual and expected value.

For example:

```js
assert.strictEqual(1, 2);
// AssertionError [ERR_ASSERTION]: 1 === 2
```

## Class: RangeError

A subclass of `Error` that indicates that a provided argument was not within the
Expand Down
16 changes: 11 additions & 5 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ server.on('stream', (stream, headers) => {
server.listen(80);
```

Note that the above example is an HTTP/2 server that does not support SSL.
This is significant as most browsers support HTTP/2 only with SSL.
To make the above server be able to serve content to browsers,
replace `http2.createServer()` with
`http2.createSecureServer({key: /* your SSL key */, cert: /* your SSL cert */})`.

The following illustrates an HTTP/2 client:

```js
Expand Down Expand Up @@ -1236,7 +1242,7 @@ const {
HTTP2_HEADER_CONTENT_TYPE
} = http2.constants;

const server = http.createServer();
const server = http2.createServer();
server.on('stream', (stream, headers, flags) => {
const method = headers[HTTP2_HEADER_METHOD];
const path = headers[HTTP2_HEADER_PATH];
Expand Down Expand Up @@ -1322,7 +1328,7 @@ const {

const options = getOptionsSomehow();

const server = http.createSecureServer(options);
const server = http2.createSecureServer(options);
server.on('stream', (stream, headers, flags) => {
const method = headers[HTTP2_HEADER_METHOD];
const path = headers[HTTP2_HEADER_PATH];
Expand Down Expand Up @@ -2367,7 +2373,7 @@ to [`response.writeHead()`][] given precedence.

```js
// returns content-type = text/plain
const server = http.createServer((req, res) => {
const server = http2.createServer((req, res) => {
res.setHeader('Content-Type', 'text/html');
res.setHeader('X-Foo', 'bar');
res.writeHead(200, { 'Content-Type': 'text/plain' });
Expand Down Expand Up @@ -2410,8 +2416,8 @@ via `response.connection`.
Example:

```js
const http = require('http');
const server = http.createServer((req, res) => {
const http2 = require('http2');
const server = http2.createServer((req, res) => {
const ip = req.socket.remoteAddress;
const port = req.socket.remotePort;
res.end(`Your IP address is ${ip} and your source port is ${port}.`);
Expand Down
6 changes: 3 additions & 3 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ of the ECMAScript Language Specification.

#### *napi_create_dataview*
<!-- YAML
added: REPLACEME
added: v8.3.0
-->

```C
Expand Down Expand Up @@ -1665,7 +1665,7 @@ is managed by the VM
#### *napi_get_dataview_info*
<!-- YAML
added: REPLACEME
added: v8.3.0
-->
```C
Expand Down Expand Up @@ -2162,7 +2162,7 @@ This API checks if the Object passsed in is a typed array.
### *napi_is_dataview*
<!-- YAML
added: REPLACEME
added: v8.3.0
-->
```C
Expand Down
4 changes: 2 additions & 2 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ see [Custom promisified functions][].

## Class: util.TextDecoder
<!-- YAML
added: REPLACEME
added: v8.3.0
-->

> Stability: 1 - Experimental
Expand Down Expand Up @@ -685,7 +685,7 @@ mark.

## Class: util.TextEncoder
<!-- YAML
added: REPLACEME
added: v8.3.0
-->

> Stability: 1 - Experimental
Expand Down
Loading

0 comments on commit dc0f0d7

Please sign in to comment.