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

Commit cdaf0d4

Browse files
committed
meta: merge node/master into node-chakracore/master
Merge 9b7a691 as of 2018-03-21 This commit was automatically generated. For any problems, please contact jackhorton Reviewed-By: Kyle Farnung <[email protected]>
2 parents 3036f13 + 9b7a691 commit cdaf0d4

40 files changed

+626
-191
lines changed

Diff for: CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ release.
3131
</tr>
3232
<tr>
3333
<td valign="top">
34-
<b><a href="doc/changelogs/CHANGELOG_V9.md#9.8.0">9.8.0</a></b><br/>
34+
<b><a href="doc/changelogs/CHANGELOG_V9.md#9.9.0">9.9.0</a></b><br/>
35+
<a href="doc/changelogs/CHANGELOG_V9.md#9.8.0">9.8.0</a><br/>
3536
<a href="doc/changelogs/CHANGELOG_V9.md#9.7.1">9.7.1</a><br/>
3637
<a href="doc/changelogs/CHANGELOG_V9.md#9.7.0">9.7.0</a><br/>
3738
<a href="doc/changelogs/CHANGELOG_V9.md#9.6.1">9.6.1</a><br/>

Diff for: COLLABORATOR_GUIDE.md

+123-71
Large diffs are not rendered by default.

Diff for: deps/chakrashim/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 6
1212
#define V8_MINOR_VERSION 5
1313
#define V8_BUILD_NUMBER 254
14-
#define V8_PATCH_LEVEL 40
14+
#define V8_PATCH_LEVEL 41
1515

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

Diff for: deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 6
1212
#define V8_MINOR_VERSION 5
1313
#define V8_BUILD_NUMBER 254
14-
#define V8_PATCH_LEVEL 40
14+
#define V8_PATCH_LEVEL 41
1515

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

Diff for: deps/v8/src/compiler/escape-analysis.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -623,9 +623,7 @@ void ReduceNode(const Operator* op, EscapeAnalysisTracker::Scope* current,
623623
break;
624624
}
625625
case IrOpcode::kTypeGuard: {
626-
// The type-guard is re-introduced in the final reducer if the types
627-
// don't match.
628-
current->SetReplacement(current->ValueInput(0));
626+
current->SetVirtualObject(current->ValueInput(0));
629627
break;
630628
}
631629
case IrOpcode::kReferenceEqual: {

Diff for: deps/v8/test/mjsunit/compiler/escape-analysis-18.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2017 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --allow-natives-syntax --turbo-escape
6+
7+
function bar(arr) {
8+
var x = 0;
9+
arr.forEach(function(el) {
10+
x = el;
11+
});
12+
return x;
13+
}
14+
15+
function foo(array) {
16+
return bar(array);
17+
}
18+
19+
let array = [,.5,];
20+
foo(array);
21+
foo(array);
22+
%OptimizeFunctionOnNextCall(foo);
23+
foo(array);

Diff for: doc/api/assert.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ For more information about the used equality comparisons see
1515

1616
## Strict mode
1717
<!-- YAML
18-
added: REPLACEME
18+
added: v9.9.0
1919
changes:
20-
- version: REPLACEME
20+
- version: v9.9.0
2121
pr-url: https://github.com/nodejs/node/pull/17615
2222
description: Added error diffs to the strict mode
23-
- version: REPLACEME
23+
- version: v9.9.0
2424
pr-url: https://github.com/nodejs/node/pull/17002
2525
description: Added strict mode to the assert module.
2626
-->
@@ -924,7 +924,7 @@ instead of the `AssertionError`.
924924
<!-- YAML
925925
added: v0.1.21
926926
changes:
927-
- version: REPLACEME
927+
- version: v9.9.0
928928
pr-url: https://github.com/nodejs/node/pull/17584
929929
description: The `error` parameter can now be an object as well.
930930
- version: v4.2.0

Diff for: doc/api/crypto.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,11 @@ This property is deprecated. Please use `crypto.setFips()` and
12541254
### crypto.createCipher(algorithm, password[, options])
12551255
<!-- YAML
12561256
added: v0.1.94
1257+
deprecated: REPLACEME
12571258
-->
1259+
1260+
> Stability: 0 - Deprecated: Use [`crypto.createCipheriv()`][] instead.
1261+
12581262
- `algorithm` {string}
12591263
- `password` {string | Buffer | TypedArray | DataView}
12601264
- `options` {Object} [`stream.transform` options][]
@@ -1290,7 +1294,7 @@ Adversaries][] for details.
12901294
<!-- YAML
12911295
added: v0.1.94
12921296
changes:
1293-
- version: REPLACEME
1297+
- version: v9.9.0
12941298
pr-url: https://github.com/nodejs/node/pull/18644
12951299
description: The `iv` parameter may now be `null` for ciphers which do not
12961300
need an initialization vector.
@@ -1334,7 +1338,11 @@ called.
13341338
### crypto.createDecipher(algorithm, password[, options])
13351339
<!-- YAML
13361340
added: v0.1.94
1341+
deprecated: REPLACEME
13371342
-->
1343+
1344+
> Stability: 0 - Deprecated: Use [`crypto.createDecipheriv()`][] instead.
1345+
13381346
- `algorithm` {string}
13391347
- `password` {string | Buffer | TypedArray | DataView}
13401348
- `options` {Object} [`stream.transform` options][]
@@ -1358,7 +1366,7 @@ to create the `Decipher` object.
13581366
<!-- YAML
13591367
added: v0.1.94
13601368
changes:
1361-
- version: REPLACEME
1369+
- version: v9.9.0
13621370
pr-url: https://github.com/nodejs/node/pull/18644
13631371
description: The `iv` parameter may now be `null` for ciphers which do not
13641372
need an initialization vector.

Diff for: doc/api/deprecations.md

+18
Original file line numberDiff line numberDiff line change
@@ -959,11 +959,25 @@ Type: Runtime
959959
[`decipher.final()`][]. In the future, this API will likely be removed, and it
960960
is recommended to use [`decipher.final()`][] instead.
961961
962+
<a id="DEP0106"></a>
963+
### DEP0106: crypto.createCipher and crypto.createDecipher
964+
965+
Type: Documentation-only
966+
967+
Using [`crypto.createCipher()`][] and [`crypto.createDecipher()`][] should be
968+
avoided as they use a weak key derivation function (MD5 with no salt) and static
969+
initialization vectors. It is recommended to derive a key using
970+
[`crypto.pbkdf2()`][] and to use [`crypto.createCipheriv()`][] and
971+
[`crypto.createDecipheriv()`][] to obtain the [`Cipher`][] and [`Decipher`][]
972+
objects respectively.
973+
962974
[`--pending-deprecation`]: cli.html#cli_pending_deprecation
963975
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
964976
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array
965977
[`Buffer.from(buffer)`]: buffer.html#buffer_class_method_buffer_from_buffer
966978
[`Buffer.isBuffer()`]: buffer.html#buffer_class_method_buffer_isbuffer_obj
979+
[`Cipher`]: crypto.html#crypto_class_cipher
980+
[`Decipher`]: crypto.html#crypto_class_decipher
967981
[`assert`]: assert.html
968982
[`clearInterval()`]: timers.html#timers_clearinterval_timeout
969983
[`clearTimeout()`]: timers.html#timers_cleartimeout_timeout
@@ -976,7 +990,11 @@ is recommended to use [`decipher.final()`][] instead.
976990
[`child_process`]: child_process.html
977991
[`console.error()`]: console.html#console_console_error_data_args
978992
[`console.log()`]: console.html#console_console_log_data_args
993+
[`crypto.createCipher()`]: crypto.html#crypto_crypto_createcipher_algorithm_password_options
994+
[`crypto.createCipheriv()`]: crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv_options
979995
[`crypto.createCredentials()`]: crypto.html#crypto_crypto_createcredentials_details
996+
[`crypto.createDecipher()`]: crypto.html#crypto_crypto_createdecipher_algorithm_password_options
997+
[`crypto.createDecipheriv()`]: crypto.html#crypto_crypto_createdecipheriv_algorithm_key_iv_options
980998
[`crypto.DEFAULT_ENCODING`]: crypto.html#crypto_crypto_default_encoding
981999
[`crypto.fips`]: crypto.html#crypto_crypto_fips
9821000
[`crypto.pbkdf2()`]: crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback

Diff for: doc/api/http2.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ be emitted either by client-side code or server-side code.
2424

2525
### Server-side example
2626

27-
The following illustrates a simple, plain-text HTTP/2 server using the
28-
Core API:
27+
The following illustrates a simple HTTP/2 server using the Core API.
28+
Since there are no browsers known that support
29+
[unencrypted HTTP/2][HTTP/2 Unencrypted], the use of
30+
[`http2.createSecureServer()`][] is necessary when communicating
31+
with browser clients.
2932

3033
```js
3134
const http2 = require('http2');
@@ -252,7 +255,7 @@ and would instead register a handler for the `'stream'` event emitted by the
252255
```js
253256
const http2 = require('http2');
254257

255-
// Create a plain-text HTTP/2 server
258+
// Create an unencrypted HTTP/2 server
256259
const server = http2.createServer();
257260

258261
server.on('stream', (stream, headers) => {
@@ -1727,10 +1730,18 @@ changes:
17271730
Returns a `net.Server` instance that creates and manages `Http2Session`
17281731
instances.
17291732

1733+
Since there are no browsers known that support
1734+
[unencrypted HTTP/2][HTTP/2 Unencrypted], the use of
1735+
[`http2.createSecureServer()`][] is necessary when communicating
1736+
with browser clients.
1737+
17301738
```js
17311739
const http2 = require('http2');
17321740

1733-
// Create a plain-text HTTP/2 server
1741+
// Create an unencrypted HTTP/2 server.
1742+
// Since there are no browsers known that support
1743+
// unencrypted HTTP/2, the use of `http2.createSecureServer()`
1744+
// is necessary when communicating with browser clients.
17341745
const server = http2.createServer();
17351746

17361747
server.on('stream', (stream, headers) => {
@@ -3085,6 +3096,7 @@ following additional properties:
30853096
[Compatibility API]: #http2_compatibility_api
30863097
[HTTP/1]: http.html
30873098
[HTTP/2]: https://tools.ietf.org/html/rfc7540
3099+
[HTTP/2 Unencrypted]: https://http2.github.io/faq/#does-http2-require-encryption
30883100
[HTTP2 Headers Object]: #http2_headers_object
30893101
[HTTP2 Settings Object]: #http2_settings_object
30903102
[HTTPS]: https.html

Diff for: doc/api/inspector.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ protocol. Here's a simple example showing how to use the [CPU profiler][]:
145145

146146
```js
147147
const inspector = require('inspector');
148-
148+
const fs = require('fs');
149149
const session = new inspector.Session();
150150
session.connect();
151151

@@ -154,8 +154,11 @@ session.post('Profiler.enable', () => {
154154
// invoke business logic under measurement here...
155155

156156
// some time later...
157-
session.post('Profiler.stop', ({ profile }) => {
157+
session.post('Profiler.stop', (err, { profile }) => {
158158
// write profile to disk, upload, etc.
159+
if (!err) {
160+
fs.writeFileSync('./profile.cpuprofile', JSON.stringify(profile));
161+
}
159162
});
160163
});
161164
});

Diff for: doc/api/n-api.md

+14
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,20 @@ This API returns true if an exception is pending.
541541

542542
This API can be called even if there is a pending JavaScript exception.
543543

544+
#### napi_fatal_exception
545+
<!-- YAML
546+
added: REPLACEME
547+
-->
548+
```C
549+
napi_status napi_fatal_exception(napi_env env, napi_value err);
550+
```
551+
552+
- `[in] env`: The environment that the API is invoked under.
553+
- `[in] err`: The error you want to pass to `uncaughtException`.
554+
555+
Trigger an `uncaughtException` in JavaScript. Useful if an async
556+
callback throws an exception with no way to recover.
557+
544558
### Fatal Errors
545559

546560
In the event of an unrecoverable error in a native module, a fatal error can be

Diff for: doc/api/stream.md

+37-37
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,19 @@ buffered writes in a more optimized manner.
354354

355355
See also: [`writable.uncork()`][].
356356

357+
##### writable.destroy([error])
358+
<!-- YAML
359+
added: v8.0.0
360+
-->
361+
362+
* Returns: {this}
363+
364+
Destroy the stream, and emit the passed `error` and a `close` event.
365+
After this call, the writable stream has ended and subsequent calls
366+
to `write` / `end` will give an `ERR_STREAM_DESTROYED` error.
367+
Implementors should not override this method,
368+
but instead implement [`writable._destroy`][writable-_destroy].
369+
357370
##### writable.end([chunk][, encoding][, callback])
358371
<!-- YAML
359372
added: v0.9.4
@@ -536,19 +549,6 @@ write('hello', () => {
536549

537550
A Writable stream in object mode will always ignore the `encoding` argument.
538551

539-
##### writable.destroy([error])
540-
<!-- YAML
541-
added: v8.0.0
542-
-->
543-
544-
* Returns: {this}
545-
546-
Destroy the stream, and emit the passed `error` and a `close` event.
547-
After this call, the writable stream has ended and subsequent calls
548-
to `write` / `end` will give an `ERR_STREAM_DESTROYED` error.
549-
Implementors should not override this method,
550-
but instead implement [`writable._destroy`][writable-_destroy].
551-
552552
### Readable Streams
553553

554554
Readable streams are an abstraction for a *source* from which data is
@@ -806,6 +806,20 @@ In general, the `readable.pipe()` and `'data'` event mechanisms are easier to
806806
understand than the `'readable'` event. However, handling `'readable'` might
807807
result in increased throughput.
808808

809+
##### readable.destroy([error])
810+
<!-- YAML
811+
added: v8.0.0
812+
-->
813+
814+
* `error` {Error} Error which will be passed as payload in `'error'` event
815+
* Returns: {this}
816+
817+
Destroy the stream, and emit `'error'` and `close`. After this call, the
818+
readable stream will release any internal resources and subsequent calls
819+
to `push` will be ignored.
820+
Implementors should not override this method, but instead implement
821+
[`readable._destroy`][readable-_destroy].
822+
809823
##### readable.isPaused()
810824
<!-- YAML
811825
added: v0.11.14
@@ -913,16 +927,6 @@ to prevent memory leaks.
913927
The [`process.stderr`][] and [`process.stdout`][] Writable streams are never
914928
closed until the Node.js process exits, regardless of the specified options.
915929

916-
##### readable.readableHighWaterMark
917-
<!-- YAML
918-
added: v9.3.0
919-
-->
920-
921-
* Returns: {number}
922-
923-
Returns the value of `highWaterMark` passed when constructing this
924-
`Readable`.
925-
926930
##### readable.read([size])
927931
<!-- YAML
928932
added: v0.9.4
@@ -969,6 +973,16 @@ also be emitted.
969973
Calling [`stream.read([size])`][stream-read] after the [`'end'`][] event has
970974
been emitted will return `null`. No runtime error will be raised.
971975

976+
##### readable.readableHighWaterMark
977+
<!-- YAML
978+
added: v9.3.0
979+
-->
980+
981+
* Returns: {number}
982+
983+
Returns the value of `highWaterMark` passed when constructing this
984+
`Readable`.
985+
972986
##### readable.readableLength
973987
<!-- YAML
974988
added: v9.4.0
@@ -1168,20 +1182,6 @@ myReader.on('readable', () => {
11681182
});
11691183
```
11701184

1171-
##### readable.destroy([error])
1172-
<!-- YAML
1173-
added: v8.0.0
1174-
-->
1175-
1176-
* `error` {Error} Error which will be passed as payload in `'error'` event
1177-
* Returns: {this}
1178-
1179-
Destroy the stream, and emit `'error'` and `close`. After this call, the
1180-
readable stream will release any internal resources and subsequent calls
1181-
to `push` will be ignored.
1182-
Implementors should not override this method, but instead implement
1183-
[`readable._destroy`][readable-_destroy].
1184-
11851185
##### readable[@@asyncIterator]
11861186
<!-- YAML
11871187
added: REPLACEME

Diff for: doc/api/tls.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ For Example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`
585585

586586
### tlsSocket.getFinished()
587587
<!-- YAML
588-
added: REPLACEME
588+
added: v9.9.0
589589
-->
590590

591591
* Returns: {Buffer|undefined} The latest `Finished` message that has been
@@ -647,7 +647,7 @@ If the peer does not provide a certificate, an empty object will be returned.
647647

648648
### tlsSocket.getPeerFinished()
649649
<!-- YAML
650-
added: REPLACEME
650+
added: v9.9.0
651651
-->
652652

653653
* Returns: {Buffer|undefined} The latest `Finished` message that is expected

0 commit comments

Comments
 (0)