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

Commit

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

Reviewed-By: Jack Horton <jahorto@microsoft.com>
  • Loading branch information
chakrabot committed Nov 10, 2017
2 parents 188e4c2 + d597317 commit b6b3ed8
Show file tree
Hide file tree
Showing 30 changed files with 398 additions and 169 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ release.
<a href="doc/changelogs/CHANGELOG_V9.md#9.0.0">9.0.0</a><br/>
</td>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V8.md#8.9.0">8.9.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V8.md#8.9.1">8.9.1</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.9.0">8.9.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.8.1">8.8.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.8.0">8.8.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.7.0">8.7.0</a><br/>
Expand Down
36 changes: 30 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ bench-ci: bench
lint-md-clean:
$(RM) -r tools/remark-cli/node_modules
$(RM) -r tools/remark-preset-lint-node/node_modules
$(RM) tools/.*mdlintstamp

lint-md-build:
@if [ ! -d tools/remark-cli/node_modules ]; then \
Expand All @@ -983,10 +984,25 @@ lint-md-build:
echo "Markdown linter: installing remark-preset-lint-node into tools/"; \
cd tools/remark-preset-lint-node && ../../$(NODE) ../../$(NPM) install; fi

lint-md: lint-md-build
@echo "Running Markdown linter..."
$(NODE) tools/remark-cli/cli.js -q -f \
./*.md doc src lib benchmark tools/doc/ tools/icu/
LINT_MD_TARGETS = src lib benchmark tools/doc tools/icu
LINT_MD_ROOT_DOCS := $(wildcard *.md)
LINT_MD_FILES := $(shell find $(LINT_MD_TARGETS) -type f \
-not -path '*node_modules*' -name '*.md') $(LINT_MD_ROOT_DOCS)
LINT_DOC_MD_FILES = $(shell ls doc/**/*.md)

tools/.docmdlintstamp: $(LINT_DOC_MD_FILES)
@echo "Running Markdown linter on docs..."
@$(NODE) tools/remark-cli/cli.js -q -f $(LINT_DOC_MD_FILES)
@touch $@

tools/.miscmdlintstamp: $(LINT_MD_FILES)
@echo "Running Markdown linter on misc docs..."
@$(NODE) tools/remark-cli/cli.js -q -f $(LINT_MD_FILES)
@touch $@

tools/.mdlintstamp: tools/.miscmdlintstamp tools/.docmdlintstamp

lint-md: | lint-md-build tools/.mdlintstamp

LINT_JS_TARGETS = benchmark doc lib test tools
LINT_JS_CMD = tools/eslint/bin/eslint.js --cache \
Expand Down Expand Up @@ -1048,10 +1064,13 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
# and the actual filename is generated so it won't match header guards
ADDON_DOC_LINT_FLAGS=-whitespace/ending_newline,-build/header_guard

lint-cpp:
lint-cpp: tools/.cpplintstamp

tools/.cpplintstamp: $(LINT_CPP_FILES)
@echo "Running C++ linter..."
@$(PYTHON) tools/cpplint.py $(LINT_CPP_FILES)
@$(PYTHON) tools/cpplint.py $?
@$(PYTHON) tools/check-imports.py
@touch $@

lint-addon-docs: test/addons/.docbuildstamp
@echo "Running C++ linter on addon docs..."
Expand Down Expand Up @@ -1087,6 +1106,10 @@ lint:
lint-ci: lint
endif

lint-clean:
$(RM) tools/.*lintstamp
$(RM) .eslintcache

.PHONY: $(TARBALL)-headers \
all \
bench \
Expand Down Expand Up @@ -1127,6 +1150,7 @@ endif
install-bin \
install-includes \
lint \
lint-clean \
lint-ci \
lint-cpp \
lint-js \
Expand Down
2 changes: 1 addition & 1 deletion doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ assert.fail(1, 2, new TypeError('need array'));
// TypeError: need array
```

*Note*: Is the last two cases `actual`, `expected`, and `operator` have no
*Note*: In the last two cases `actual`, `expected`, and `operator` have no
influence on the error message.

```js
Expand Down
7 changes: 4 additions & 3 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -1044,10 +1044,11 @@ added: v0.5.10
-->

* {boolean} Set to `true` after `subprocess.kill()` is used to successfully
terminate the child process.
send a signal to the child process.

The `subprocess.killed` property indicates whether the child process was
successfully terminated using `subprocess.kill()`.
The `subprocess.killed` property indicates whether the child process
successfully received a signal from `subprocess.kill()`. The `killed` property
does not indicate that the child process has been terminated.

### subprocess.pid
<!-- YAML
Expand Down
2 changes: 1 addition & 1 deletion doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ must be called in order to determine if an exception is pending or not.

When an exception is pending one of two approaches can be employed.

The first appoach is to do any appropriate cleanup and then return so that
The first approach is to do any appropriate cleanup and then return so that
execution will return to JavaScript. As part of the transition back to
JavaScript the exception will be thrown at the point in the JavaScript
code where the native method was invoked. The behavior of most N-API calls
Expand Down
27 changes: 27 additions & 0 deletions doc/changelogs/CHANGELOG_V8.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</tr>
<tr>
<td valign="top">
<a href="#8.9.1">8.9.1</a><br/>
<a href="#8.9.0">8.9.0</a><br/>
</td>
<td valign="top">
Expand Down Expand Up @@ -44,6 +45,32 @@
[Node.js Long Term Support Plan](https://github.com/nodejs/LTS) and
will be supported actively until April 2019 and maintained until December 2019.

<a id="8.9.1"></a>
## 2017-11-07, Version 8.9.1 'Carbon' (LTS), @gibfahn

### Notable Changes

- **openssl**:
- upgrade openssl sources to 1.0.2m (Shigeki Ohtsu) [#16691](https://github.com/nodejs/node/pull/16691)
- ***Revert*** "**https**:
- refactor to use http internals" (Myles Borins) [#16660](https://github.com/nodejs/node/pull/16660)

### Commits

* [[`6a7e5ceaa9`](https://github.com/nodejs/node/commit/6a7e5ceaa9)] - **deps**: V8: cherry-pick 32141e9 from upstream (Ali Ijaz Sheikh) [#16704](https://github.com/nodejs/node/pull/16704)
* [[`a815e1b6a2`](https://github.com/nodejs/node/commit/a815e1b6a2)] - **deps**: cherry-pick e7f4e9e from upstream libuv (Bartosz Sosnowski) [#16724](https://github.com/nodejs/node/pull/16724)
* [[`7f86e8190c`](https://github.com/nodejs/node/commit/7f86e8190c)] - **deps**: update openssl asm and asm_obsolete files (Shigeki Ohtsu) [#16691](https://github.com/nodejs/node/pull/16691)
* [[`1af2244020`](https://github.com/nodejs/node/commit/1af2244020)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [nodejs/io.js#1836](https://github.com/nodejs/io.js/pull/1836)
* [[`9d98dcc395`](https://github.com/nodejs/node/commit/9d98dcc395)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389)
* [[`99319efc45`](https://github.com/nodejs/node/commit/99319efc45)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389)
* [[`151a8da4b7`](https://github.com/nodejs/node/commit/151a8da4b7)] - **deps**: copy all openssl header files to include dir (Shigeki Ohtsu) [#16691](https://github.com/nodejs/node/pull/16691)
* [[`d68e53452c`](https://github.com/nodejs/node/commit/d68e53452c)] - **deps**: upgrade openssl sources to 1.0.2m (Shigeki Ohtsu) [#16691](https://github.com/nodejs/node/pull/16691)
* [[`a3be5bc560`](https://github.com/nodejs/node/commit/a3be5bc560)] - **doc**: add 9.x to version picker and mark 8.x as LTS (Chris Young) [#16672](https://github.com/nodejs/node/pull/16672)
* [[`08b75c1591`](https://github.com/nodejs/node/commit/08b75c1591)] - ***Revert*** "**https**: refactor to use http internals" (Myles Borins) [#16660](https://github.com/nodejs/node/pull/16660)
* [[`d334a95834`](https://github.com/nodejs/node/commit/d334a95834)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389)
* [[`bf26b96fd6`](https://github.com/nodejs/node/commit/bf26b96fd6)] - **src**: add 'dynamic' process.release.lts property (Rod Vagg) [#16656](https://github.com/nodejs/node/pull/16656)
* [[`dfac6cc0bb`](https://github.com/nodejs/node/commit/dfac6cc0bb)] - **test**: update process-release for Node 8 Carbon (Jeremiah Senkpiel) [#16656](https://github.com/nodejs/node/pull/16656)

<a id="8.9.0"></a>
## 2017-10-31, Version 8.9.0 'Carbon' (LTS), @gibfahn

Expand Down
5 changes: 4 additions & 1 deletion lib/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ function createWriteErrorHandler(stream) {
// an `error` event. Adding a `once` listener will keep that error
// from becoming an uncaught exception, but since the handler is
// removed after the event, non-console.* writes won’t be affected.
stream.once('error', noop);
// we are only adding noop if there is no one else listening for 'error'
if (stream.listenerCount('error') === 0) {
stream.on('error', noop);
}
}
};
}
Expand Down
11 changes: 6 additions & 5 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ function hasOwnProperty(obj, prop) {

// Can overridden with custom print functions, such as `probe` or `eyes.js`.
// This is the default "writer" value if none is passed in the REPL options.
exports.writer = util.inspect;
const writer = exports.writer = (obj) => util.inspect(obj, writer.options);
writer.options =
Object.assign(util.inspect.defaultOptions, { showProxy: true });

exports._builtinLibs = internalModule.builtinLibs;

Expand Down Expand Up @@ -373,11 +375,10 @@ function REPLServer(prompt,
}
self.useColors = !!options.useColors;

if (self.useColors && self.writer === util.inspect) {
if (self.useColors && self.writer === writer) {
// Turn on ANSI coloring.
self.writer = function(obj, showHidden, depth) {
return util.inspect(obj, showHidden, depth, true);
};
self.writer = (obj) => util.inspect(obj, self.writer.options);
self.writer.options = Object.assign(writer.options, { colors: true });
}

function filterInternalStackFrames(error, structuredStack) {
Expand Down
3 changes: 3 additions & 0 deletions src/process_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ class ProcessWrap : public HandleWrap {
if (!argv_v.IsEmpty() && argv_v->IsArray()) {
Local<Array> js_argv = Local<Array>::Cast(argv_v);
int argc = js_argv->Length();
CHECK_GT(argc + 1, 0); // Check for overflow.

// Heap allocate to detect errors. +1 is for nullptr.
options.args = new char*[argc + 1];
for (int i = 0; i < argc; i++) {
Expand All @@ -211,6 +213,7 @@ class ProcessWrap : public HandleWrap {
if (!env_v.IsEmpty() && env_v->IsArray()) {
Local<Array> env_opt = Local<Array>::Cast(env_v);
int envc = env_opt->Length();
CHECK_GT(envc + 1, 0); // Check for overflow.
options.env = new char*[envc + 1]; // Heap allocated to detect errors.
for (int i = 0; i < envc; i++) {
node::Utf8Value pair(env->isolate(),
Expand Down
6 changes: 4 additions & 2 deletions test/addons-napi/test_exception/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ assert.strictEqual(test_exception.wasPending(), true,
// Test that the native side does not capture a non-existing exception
returnedError = test_exception.returnException(common.mustCall());
assert.strictEqual(undefined, returnedError,
'Returned error is undefined when no exception is thrown');
'Returned error should be undefined when no exception is' +
` thrown, but ${returnedError} was passed`);

// Test that no exception appears that was not thrown by us
try {
Expand All @@ -42,7 +43,8 @@ try {
caughtError = anError;
}
assert.strictEqual(undefined, caughtError,
'No exception originated on the native side');
'No exception originated on the native side, but' +
` ${caughtError} was passed`);

// Test that the exception state remains clear when no exception is thrown
assert.strictEqual(test_exception.wasPending(), false,
Expand Down
7 changes: 5 additions & 2 deletions test/addons-napi/test_general/testNapiRun.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const assert = require('assert');
// eslint-disable-next-line no-unused-vars
const addon = require(`./build/${common.buildType}/test_general`);

assert.strictEqual(addon.testNapiRun('(41.92 + 0.08);'), 42,
'napi_run_script() works correctly');
const testCase = '(41.92 + 0.08);';
const expected = 42;
const actual = addon.testNapiRun(testCase);

assert.strictEqual(actual, expected);
assert.throws(() => addon.testNapiRun({ abc: 'def' }), /string was expected/);
35 changes: 35 additions & 0 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This directory contains modules used to test the Node.js implementation.
* [DNS module](#dns-module)
* [Duplex pair helper](#duplex-pair-helper)
* [Fixtures module](#fixtures-module)
* [Internet module](#internet-module)
* [WPT module](#wpt-module)

## Benchmark Module
Expand Down Expand Up @@ -498,6 +499,40 @@ Returns the result of
Returns the result of
`fs.readFileSync(path.join(fixtures.fixturesDir, 'keys', arg), 'enc')`.

## Internet Module

The `common/internet` module provides utilities for working with
internet-related tests.

### internet.addresses

* [&lt;Object>]
* `INET_HOST` [&lt;String>] A generic host that has registered common
DNS records, supports both IPv4 and IPv6, and provides basic HTTP/HTTPS
services
* `INET4_HOST` [&lt;String>] A host that provides IPv4 services
* `INET6_HOST` [&lt;String>] A host that provides IPv6 services
* `INET4_IP` [&lt;String>] An accessible IPv4 IP, defaults to the
Google Public DNS IPv4 address
* `INET6_IP` [&lt;String>] An accessible IPv6 IP, defaults to the
Google Public DNS IPv6 address
* `INVALID_HOST` [&lt;String>] An invalid host that cannot be resolved
* `MX_HOST` [&lt;String>] A host with MX records registered
* `SRV_HOST` [&lt;String>] A host with SRV records registered
* `PTR_HOST` [&lt;String>] A host with PTR records registered
* `NAPTR_HOST` [&lt;String>] A host with NAPTR records registered
* `SOA_HOST` [&lt;String>] A host with SOA records registered
* `CNAME_HOST` [&lt;String>] A host with CNAME records registered
* `NS_HOST` [&lt;String>] A host with NS records registered
* `TXT_HOST` [&lt;String>] A host with TXT records registered
* `DNS4_SERVER` [&lt;String>] An accessible IPv4 DNS server
* `DNS6_SERVER` [&lt;String>] An accessible IPv6 DNS server

A set of addresses for internet-related tests. All properties are configurable
via `NODE_TEST_*` environment variables. For example, to configure
`internet.addresses.INET_HOST`, set the environment
vairable `NODE_TEST_INET_HOST` to a specified host.

## WPT Module

The wpt.js module is a port of parts of
Expand Down
4 changes: 3 additions & 1 deletion test/common/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,6 @@ function writeDNSPacket(parsed) {
}));
}

module.exports = { types, classes, writeDNSPacket, parseDNSPacket };
module.exports = {
types, classes, writeDNSPacket, parseDNSPacket
};
54 changes: 54 additions & 0 deletions test/common/internet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* eslint-disable required-modules */
'use strict';

// Utilities for internet-related tests

const addresses = {
// A generic host that has registered common DNS records,
// supports both IPv4 and IPv6, and provides basic HTTP/HTTPS services
INET_HOST: 'nodejs.org',
// A host that provides IPv4 services
INET4_HOST: 'nodejs.org',
// A host that provides IPv6 services
INET6_HOST: 'nodejs.org',
// An accessible IPv4 IP,
// defaults to the Google Public DNS IPv4 address
INET4_IP: '8.8.8.8',
// An accessible IPv6 IP,
// defaults to the Google Public DNS IPv6 address
INET6_IP: '2001:4860:4860::8888',
// An invalid host that cannot be resolved
// See https://tools.ietf.org/html/rfc2606#section-2
INVALID_HOST: 'something.invalid',
// A host with MX records registered
MX_HOST: 'nodejs.org',
// A host with SRV records registered
SRV_HOST: '_jabber._tcp.google.com',
// A host with PTR records registered
PTR_HOST: '8.8.8.8.in-addr.arpa',
// A host with NAPTR records registered
NAPTR_HOST: 'sip2sip.info',
// A host with SOA records registered
SOA_HOST: 'nodejs.org',
// A host with CNAME records registered
CNAME_HOST: 'blog.nodejs.org',
// A host with NS records registered
NS_HOST: 'nodejs.org',
// A host with TXT records registered
TXT_HOST: 'nodejs.org',
// An accessible IPv4 DNS server
DNS4_SERVER: '8.8.8.8',
// An accessible IPv4 DNS server
DNS6_SERVER: '2001:4860:4860::8888'
};

for (const key of Object.keys(addresses)) {
const envName = `NODE_TEST_${key}`;
if (process.env[envName]) {
addresses[key] = process.env[envName];
}
}

module.exports = {
addresses
};
7 changes: 4 additions & 3 deletions test/internet/test-dns-cares-domains.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
require('../common');
const common = require('../common');
const { addresses } = require('../common/internet');
const assert = require('assert');
const dns = require('dns');
const domain = require('domain');
Expand All @@ -20,8 +21,8 @@ const methods = [
methods.forEach(function(method) {
const d = domain.create();
d.run(function() {
dns[method]('google.com', function() {
dns[method](addresses.INET_HOST, common.mustCall(() => {
assert.strictEqual(process.domain, d, `${method} retains domain`);
});
}));
});
});
Loading

0 comments on commit b6b3ed8

Please sign in to comment.