Skip to content

Commit

Permalink
meta: merge node/master into node-chakracore/master
Browse files Browse the repository at this point in the history
Merge a478259 as of 2018-07-09
This commit was automatically generated. For any problems, please contact jackhorton

Reviewed-By: Kyle Farnung <[email protected]>
  • Loading branch information
chakrabot committed Jul 9, 2018
2 parents 73a683e + a478259 commit f737a28
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 35 deletions.
25 changes: 17 additions & 8 deletions benchmark/util/normalize-encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,25 @@ const common = require('../common.js');
const assert = require('assert');

const groupedInputs = {
group_common: ['undefined', 'utf8', 'utf-8', 'base64', 'binary', 'latin1'],
group_upper: ['UTF-8', 'UTF8', 'UCS2', 'UTF-16LE', 'UTF16LE', 'BASE64'],
group_uncommon: [ 'foo', '1', 'false', 'undefined', '[]'],
group_common: ['undefined', 'utf8', 'utf-8', 'base64',
'binary', 'latin1', 'ucs-2', 'usc-2'],
group_upper: ['UTF-8', 'UTF8', 'UCS2', 'UTF-16LE',
'UTF16LE', 'BASE64', 'UCS-2', 'USC-2'],
group_uncommon: ['foo', '1', 'false', 'undefined', '[]', '{}'],
group_misc: ['', 'utf16le', 'usc2', 'hex', 'HEX', 'BINARY']
};

const inputs = [
'', 'utf8', 'utf-8', 'UTF-8',
'UTF8', 'Utf8', 'uTf-8', 'utF-8', 'ucs2',
'UCS2', 'utf16le', 'utf-16le', 'UTF-16LE', 'UTF16LE',
'',
'utf8', 'utf-8', 'UTF-8',
'UTF8', 'Utf8', 'uTf-8', 'utF-8',
'ucs2', 'UCS2', 'UcS2',
'USC2', 'usc2', 'uSc2',
'ucs-2', 'UCS-2', 'UcS-2',
'usc-2', 'USC-2', 'uSc-2',
'utf16le', 'utf-16le', 'UTF-16LE', 'UTF16LE',
'binary', 'BINARY', 'latin1', 'base64', 'BASE64',
'hex', 'HEX', 'foo', '1', 'false', 'undefined', '[]'];
'hex', 'HEX', 'foo', '1', 'false', 'undefined', '[]', '{}'];

const bench = common.createBenchmark(main, {
input: inputs.concat(Object.keys(groupedInputs)),
Expand All @@ -42,6 +49,8 @@ function getInput(input) {
return [undefined];
case '[]':
return [[]];
case '{}':
return [{}];
default:
return [input];
}
Expand All @@ -53,7 +62,7 @@ function main({ input, n }) {
var noDead = '';

bench.start();
for (var i = 0; i < n; i += 1) {
for (var i = 0; i < n; ++i) {
for (var j = 0; j < inputs.length; ++j) {
noDead = normalizeEncoding(inputs[j]);
}
Expand Down
52 changes: 26 additions & 26 deletions doc/api/inspector.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ It can be accessed using:
const inspector = require('inspector');
```

## inspector.close()

Deactivate the inspector. Blocks until there are no active connections.

## inspector.console

* {Object} An object to send messages to the remote inspector console.

```js
require('inspector').console.log('a message');
```

The inspector console does not have API parity with Node.js
console.

## inspector.open([port[, host[, wait]]])

* `port` {number} Port to listen on for inspector connections. Optional.
Expand All @@ -28,22 +43,7 @@ started.
If wait is `true`, will block until a client has connected to the inspect port
and flow control has been passed to the debugger client.

### inspector.console

An object to send messages to the remote inspector console.

```js
require('inspector').console.log('a message');
```

The inspector console does not have API parity with Node.js
console.

### inspector.close()

Deactivate the inspector. Blocks until there are no active connections.

### inspector.url()
## inspector.url()

* Returns: {string|undefined}

Expand Down Expand Up @@ -112,6 +112,16 @@ Connects a session to the inspector back-end. An exception will be thrown
if there is already a connected session established either through the API or by
a front-end connected to the Inspector WebSocket port.

### session.disconnect()
<!-- YAML
added: v8.0.0
-->

Immediately close the session. All pending message callbacks will be called
with an error. [`session.connect()`] will need to be called to be able to send
messages again. Reconnected session will lose all inspector state, such as
enabled agents or configured breakpoints.

### session.post(method[, params][, callback])
<!-- YAML
added: v8.0.0
Expand Down Expand Up @@ -139,16 +149,6 @@ by V8. Chrome DevTools Protocol domain provides an interface for interacting
with one of the runtime agents used to inspect the application state and listen
to the run-time events.

### session.disconnect()
<!-- YAML
added: v8.0.0
-->

Immediately close the session. All pending message callbacks will be called
with an error. [`session.connect()`] will need to be called to be able to send
messages again. Reconnected session will lose all inspector state, such as
enabled agents or configured breakpoints.

## Example usage

### CPU Profiler
Expand Down
3 changes: 2 additions & 1 deletion lib/internal/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function slowCases(enc) {
if (enc === 'ucs2' || enc === 'UCS2') return 'utf16le';
enc = `${enc}`.toLowerCase();
if (enc === 'utf8') return 'utf8';
if (enc === 'ucs2' || enc === 'UCS2') return 'utf16le';
if (enc === 'ucs2') return 'utf16le';
break;
case 3:
if (enc === 'hex' || enc === 'HEX' || `${enc}`.toLowerCase() === 'hex')
Expand All @@ -131,6 +131,7 @@ function slowCases(enc) {
if (enc === 'utf-8') return 'utf8';
if (enc === 'ascii') return 'ascii';
if (enc === 'usc-2') return 'utf16le';
if (enc === 'ucs-2') return 'utf16le';
break;
case 6:
if (enc === 'base64') return 'base64';
Expand Down
7 changes: 7 additions & 0 deletions test/parallel/test-internal-util-normalizeencoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ const tests = [
['utF-8', 'utf8'],
['ucs2', 'utf16le'],
['UCS2', 'utf16le'],
['ucs-2', 'utf16le'],
['UCS-2', 'utf16le'],
['UcS-2', 'utf16le'],
['utf16le', 'utf16le'],
['utf-16le', 'utf16le'],
['UTF-16LE', 'utf16le'],
['UTF16LE', 'utf16le'],
['usc-2', 'utf16le'],
['USC-2', 'utf16le'],
['uSc-2', 'utf16le'],
['binary', 'latin1'],
['BINARY', 'latin1'],
['latin1', 'latin1'],
Expand All @@ -36,6 +42,7 @@ const tests = [
[NaN, undefined],
[0, undefined],
[[], undefined],
[{}, undefined]
];

tests.forEach((e, i) => {
Expand Down

0 comments on commit f737a28

Please sign in to comment.