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 97ba69f as of 2017-11-19
This commit was automatically generated. For any problems, please contact jackhorton

Reviewed-By: Jimmy Thomson <jithomso@microsoft.com>
  • Loading branch information
chakrabot committed Nov 20, 2017
2 parents 6c36d31 + 97ba69f commit 19c7b74
Show file tree
Hide file tree
Showing 51 changed files with 489 additions and 591 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ test/addons/.buildstamp: config.gypi \
# .buildstamp is out of date and need a rebuild.
# Just goes to show that recursive make really is harmful...
# TODO(bnoordhuis) Force rebuild after gyp update.
build-addons: $(NODE_EXE) test/addons/.buildstamp
build-addons: | $(NODE_EXE) test/addons/.buildstamp

ADDONS_NAPI_BINDING_GYPS := \
$(filter-out test/addons-napi/??_*/binding.gyp, \
Expand Down Expand Up @@ -353,7 +353,7 @@ test/addons-napi/.buildstamp: config.gypi \
# .buildstamp is out of date and need a rebuild.
# Just goes to show that recursive make really is harmful...
# TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
build-addons-napi: $(NODE_EXE) test/addons-napi/.buildstamp
build-addons-napi: | $(NODE_EXE) test/addons-napi/.buildstamp

clear-stalled:
# Clean up any leftover processes but don't error if found.
Expand Down
8 changes: 4 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,17 @@ parser.add_option("--partly-static",
parser.add_option("--enable-vtune-profiling",
action="store_true",
dest="enable_vtune_profiling",
help="Enable profiling support for Intel VTune profiler to profile"
help="Enable profiling support for Intel VTune profiler to profile "
"JavaScript code executed in nodejs. This feature is only available "
"for x32, x86 and x64 architectures.")


parser.add_option("--link-module",
action="append",
dest="linked_module",
help="Path to a JS file to be bundled in the binary as a builtin."
"This module will be referenced by path without extension."
"e.g. /root/x/y.js will be referenced via require('root/x/y')."
help="Path to a JS file to be bundled in the binary as a builtin. "
"This module will be referenced by path without extension; "
"e.g. /root/x/y.js will be referenced via require('root/x/y'). "
"Can be used multiple times")

parser.add_option("--openssl-no-asm",
Expand Down
40 changes: 20 additions & 20 deletions deps/chakrashim/include/v8-version.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_INCLUDE_VERSION_H_ // V8_VERSION_H_ conflicts with src/version.h
#define V8_INCLUDE_VERSION_H_

// These macros define the version number for the current version.
// NOTE these macros are used by some of the tool scripts and the build
// system so their names cannot be changed without changing the scripts.
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 2
#define V8_BUILD_NUMBER 414
#define V8_PATCH_LEVEL 44

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define V8_IS_CANDIDATE_VERSION 0

#endif // V8_INCLUDE_VERSION_H_
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_INCLUDE_VERSION_H_ // V8_VERSION_H_ conflicts with src/version.h
#define V8_INCLUDE_VERSION_H_

// These macros define the version number for the current version.
// NOTE these macros are used by some of the tool scripts and the build
// system so their names cannot be changed without changing the scripts.
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 2
#define V8_BUILD_NUMBER 414
#define V8_PATCH_LEVEL 44

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define V8_IS_CANDIDATE_VERSION 0

#endif // V8_INCLUDE_VERSION_H_
210 changes: 105 additions & 105 deletions deps/icu-small/source/common/uchar_props_data.h

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions doc/api/async_hooks.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Async Hooks

<!--introduced_in=v8.1.0-->

> Stability: 1 - Experimental
The `async_hooks` module provides an API to register callbacks tracking the
Expand Down
3 changes: 1 addition & 2 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2606,8 +2606,7 @@ Returns an un-pooled `Buffer`.

In order to avoid the garbage collection overhead of creating many individually
allocated `Buffer` instances, by default allocations under 4KB are sliced from a
single larger allocated object. This approach improves both performance and memory
usage since v8 does not need to track and cleanup as many `Persistent` objects.
single larger allocated object.

In the case where a developer may need to retain a small chunk of memory from a
pool for an indeterminate amount of time, it may be appropriate to create an
Expand Down
6 changes: 3 additions & 3 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To view this documentation as a manual page in a terminal, run `man node`.

## Synopsis

`node [options] [v8 options] [script.js | -e "script" | -] [--] [arguments]`
`node [options] [V8 options] [script.js | -e "script" | -] [--] [arguments]`

`node debug [script.js | -e "script" | <host>:<port>] …`

Expand Down Expand Up @@ -293,15 +293,15 @@ Track heap object allocations for heap snapshots.
added: v5.2.0
-->

Process v8 profiler output generated using the v8 option `--prof`.
Process V8 profiler output generated using the V8 option `--prof`.


### `--v8-options`
<!-- YAML
added: v0.1.3
-->

Print v8 command line options.
Print V8 command line options.

*Note*: V8 options allow words to be separated by both dashes (`-`) or
underscores (`_`).
Expand Down
3 changes: 2 additions & 1 deletion doc/api/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ will be dropped and new connections will be refused. Node.js does not
automatically manage the number of workers, however. It is the application's
responsibility to manage the worker pool based on its own needs.


Although a primary use case for the `cluster` module is networking, it can
also be used for other use cases requiring worker processes.

## Class: Worker
<!-- YAML
Expand Down
2 changes: 2 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Deprecated APIs

<!--introduced_in=v7.7.0-->

Node.js may deprecate APIs when either: (a) use of the API is considered to be
unsafe, (b) an improved alternative API has been made available, or (c)
breaking changes to the API are expected in a future major release.
Expand Down
2 changes: 1 addition & 1 deletion doc/api/esm.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ECMAScript Modules

<!--introduced_in=v9.x.x-->
<!--introduced_in=v8.5.0-->

> Stability: 1 - Experimental
Expand Down
17 changes: 2 additions & 15 deletions doc/api/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,8 @@ myEmitter.emit('error', new Error('whoops!'));
// Throws and crashes Node.js
```

To guard against crashing the Node.js process, a listener can be registered
on the [`process` object's `uncaughtException` event][] or the [`domain`][] module
can be used. (Note, however, that the `domain` module has been deprecated.)

```js
const myEmitter = new MyEmitter();

process.on('uncaughtException', (err) => {
console.error('whoops! there was an error');
});

myEmitter.emit('error', new Error('whoops!'));
// Prints: whoops! there was an error
```
To guard against crashing the Node.js process the [`domain`][] module can be
used. (Note, however, that the `domain` module has been deprecated.)

As a best practice, listeners should always be added for the `'error'` events.

Expand Down Expand Up @@ -594,5 +582,4 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
[`fs.ReadStream`]: fs.html#fs_class_fs_readstream
[`net.Server`]: net.html#net_class_net_server
[`process.on('warning')`]: process.html#process_event_warning
[`process` object's `uncaughtException` event]: process.html#process_event_uncaughtexception
[stream]: stream.html
4 changes: 3 additions & 1 deletion doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ changes:
* `autoClose` {boolean}
* `start` {integer}
* `end` {integer}
* `highWaterMark` {integer}

Returns a new [`ReadStream`][] object. (See [Readable Stream][]).

Expand All @@ -880,7 +881,8 @@ const defaults = {
encoding: null,
fd: null,
mode: 0o666,
autoClose: true
autoClose: true,
highWaterMark: 64 * 1024
};
```

Expand Down
2 changes: 2 additions & 0 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# HTTP2

<!--introduced_in=v8.4.0-->

> Stability: 1 - Experimental
The `http2` module provides an implementation of the [HTTP/2][] protocol. It
Expand Down
2 changes: 2 additions & 0 deletions doc/api/inspector.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Inspector

<!--introduced_in=v8.0.0-->

> Stability: 1 - Experimental
The `inspector` module provides an API for interacting with the V8 inspector.
Expand Down
2 changes: 2 additions & 0 deletions doc/api/intl.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Internationalization Support

<!--introduced_in=v8.2.0-->

Node.js has many features that make it easier to write internationalized
programs. Some of them are:

Expand Down
2 changes: 2 additions & 0 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# N-API

<!--introduced_in=v7.10.0-->

> Stability: 1 - Experimental

N-API (pronounced N as in the letter, followed by API)
Expand Down
5 changes: 2 additions & 3 deletions doc/api/perf_hooks.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Performance Timing API
<!-- YAML
added: v8.5.0
-->

<!--introduced_in=v8.5.0-->

> Stability: 1 - Experimental
Expand Down
2 changes: 1 addition & 1 deletion doc/api/synopsis.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--introduced_in=v0.10.0-->
<!--type=misc-->

`node [options] [v8 options] [script.js | -e "script" | - ] [arguments]`
`node [options] [V8 options] [script.js | -e "script" | - ] [arguments]`

Please see the [Command Line Options][] document for information about
different options and ways to run scripts with Node.js.
Expand Down
2 changes: 2 additions & 0 deletions doc/api/tracing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Tracing

<!--introduced_in=v7.7.0-->

Trace Event provides a mechanism to centralize tracing information generated by
V8, Node core, and userspace code.

Expand Down
2 changes: 1 addition & 1 deletion doc/guides/writing-and-running-benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ buffers/buffer-tostring.js n=10000000 len=1024 arg=false: 4103857.0726124765
Each line represents a single benchmark with parameters specified as
`${variable}=${value}`. Each configuration combination is executed in a separate
process. This ensures that benchmark results aren't affected by the execution
order due to v8 optimizations. **The last number is the rate of operations
order due to V8 optimizations. **The last number is the rate of operations
measured in ops/sec (higher is better).**

Furthermore a subset of the configurations can be specified, by setting them in
Expand Down
8 changes: 4 additions & 4 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ Track heap object allocations for heap snapshots.

.TP
.BR \-\-prof\-process
Process v8 profiler output generated using the v8 option \fB\-\-prof\fR
Process V8 profiler output generated using the V8 option \fB\-\-prof\fR

.TP
.BR \-\-v8\-options
Print v8 command line options.
Print V8 command line options.

Note: v8 options allow words to be separated by both dashes (\fB-\fR) or
Note: V8 options allow words to be separated by both dashes (\fB-\fR) or
underscores (\fB_\fR).

For example, \fB\-\-stack\-trace\-limit\fR is equivalent to
Expand All @@ -196,7 +196,7 @@ For example, \fB\-\-stack\-trace\-limit\fR is equivalent to
.TP
.BR \-\-v8\-pool\-size =\fInum\fR
Set v8's thread pool size which will be used to allocate background jobs.
If set to 0 then v8 will choose an appropriate size of the thread pool based
If set to 0 then V8 will choose an appropriate size of the thread pool based
on the number of online processors. If the value provided is larger than v8's
max then the largest value will be chosen.

Expand Down
17 changes: 8 additions & 9 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -856,19 +856,18 @@ Readable.prototype.wrap = function(stream) {
var state = this._readableState;
var paused = false;

var self = this;
stream.on('end', function() {
stream.on('end', () => {
debug('wrapped end');
if (state.decoder && !state.ended) {
var chunk = state.decoder.end();
if (chunk && chunk.length)
self.push(chunk);
this.push(chunk);
}

self.push(null);
this.push(null);
});

stream.on('data', function(chunk) {
stream.on('data', (chunk) => {
debug('wrapped data');
if (state.decoder)
chunk = state.decoder.write(chunk);
Expand All @@ -879,7 +878,7 @@ Readable.prototype.wrap = function(stream) {
else if (!state.objectMode && (!chunk || !chunk.length))
return;

var ret = self.push(chunk);
var ret = this.push(chunk);
if (!ret) {
paused = true;
stream.pause();
Expand All @@ -900,20 +899,20 @@ Readable.prototype.wrap = function(stream) {

// proxy certain important events.
for (var n = 0; n < kProxyEvents.length; n++) {
stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n]));
stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
}

// when we try to consume some more bytes, simply unpause the
// underlying stream.
self._read = function(n) {
this._read = (n) => {
debug('wrapped _read', n);
if (paused) {
paused = false;
stream.resume();
}
};

return self;
return this;
};

Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
Expand Down
12 changes: 6 additions & 6 deletions lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,12 @@ Buffer.isEncoding = function isEncoding(encoding) {
};
Buffer[kIsEncodingSymbol] = Buffer.isEncoding;

const kConcatErr = new errors.TypeError(
'ERR_INVALID_ARG_TYPE', 'list', ['Array', 'Buffer', 'Uint8Array']
);

Buffer.concat = function concat(list, length) {
var i;
if (!Array.isArray(list))
throw kConcatErr;
throw new errors.TypeError(
'ERR_INVALID_ARG_TYPE', 'list', ['Array', 'Buffer', 'Uint8Array']
);

if (list.length === 0)
return new FastBuffer();
Expand All @@ -484,7 +482,9 @@ Buffer.concat = function concat(list, length) {
for (i = 0; i < list.length; i++) {
var buf = list[i];
if (!isUint8Array(buf))
throw kConcatErr;
throw new errors.TypeError(
'ERR_INVALID_ARG_TYPE', 'list', ['Array', 'Buffer', 'Uint8Array']
);
_copy(buf, buffer, pos);
pos += buf.length;
}
Expand Down
Loading

0 comments on commit 19c7b74

Please sign in to comment.