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

Commit 3275414

Browse files
committed
meta: merge node/master into node-chakracore/master
Merge 03b8ac1 as of 2017-12-26 This commit was automatically generated. For any problems, please contact jackhorton Reviewed-By: Taylor Woll <tawoll@ntdev.microsoft.com>
2 parents 3f73796 + 03b8ac1 commit 3275414

26 files changed

+738
-466
lines changed

.mailmap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ Kathy Truong <kathy.yvy.truong@gmail.com> k3kathy <kathy.yvy.truong@gmail.com>
188188
Kazuyuki Yamada <tasogare.pg@gmail.com>
189189
Keith M Wesolowski <wesolows@joyent.com> <wesolows@foobazco.org>
190190
Kelsey Breseman <ifoundthemeaningoflife@gmail.com>
191+
Khaidi Chu <admin@xcoder.in> XadillaX <admin@xcoder.in>
192+
Khaidi Chu <admin@xcoder.in> <i@2333.moe>
191193
Kiyoshi Nomo <tokyoincidents.g@gmail.com> kysnm <tokyoincidents.g@gmail.com>
192194
Koichi Kobayashi <koichik@improvement.jp>
193195
Kris Kowal <kris.kowal@cixar.com>
@@ -264,6 +266,7 @@ Roman Klauke <romaaan.git@gmail.com> <romankl@users.noreply.github.com>
264266
Roman Reiss <me@silverwind.io>
265267
Ron Korving <ron@ronkorving.nl> <rkorving@wizcorp.jp>
266268
Ron Korving <ron@ronkorving.nl> ronkorving <ron@ronkorving.nl>
269+
Ruben Bridgewater <ruben@bridgewater.de> <ruben.bridgewater@fintura.de>
267270
Russell Dempsey <sgtpooki@gmail.com> <SgtPooki@gmail.com>
268271
Ryan Dahl <ry@tinyclouds.org>
269272
Ryan Emery <seebees@gmail.com>

AUTHORS

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ HUANG Wei <grubbyfans@gmail.com>
911911
DC <dcposch@dcpos.ch>
912912
Daniel Turing <mail@danielturing.com>
913913
Julie Pagano <julie.pagano@gmail.com>
914-
Ruben Bridgewater <ruben.bridgewater@fintura.de>
914+
Ruben Bridgewater <ruben@bridgewater.de>
915915
Felix Becker <felix.b@outlook.com>
916916
Igor Klopov <igor@klopov.com>
917917
Tsarevich Dmitry <dimhotepus@users.noreply.github.com>
@@ -1493,7 +1493,7 @@ Sreepurna Jasti <sreepurna.jasti@gmail.com>
14931493
Rafael Fragoso <rafaelfragosom@gmail.com>
14941494
Andrei Cioromila <andrei.cioromila@gmail.com>
14951495
Frank Lanitz <frank@frank.uvena.de>
1496-
XadillaX <admin@xcoder.in>
1496+
Khaidi Chu <admin@xcoder.in>
14971497
Akshay Iyer <c.m.akshay.iyer@gmail.com>
14981498
Rick Bullotta <RickBullotta@users.noreply.github.com>
14991499
Rajaram Gaunker <zimbabao@gmail.com>
@@ -1532,7 +1532,6 @@ Dan Homola <dan.homola@hotmail.cz>
15321532
cornholio <0@mcornholio.ru>
15331533
Tamás Hódi <tamas.hodi@risingstack.com>
15341534
DuanPengfei <2459714173@qq.com>
1535-
Ruben Bridgewater <ruben@bridgewater.de>
15361535
Lakshmi Swetha Gopireddy <lakshmiswethagopireddy@gmail.com>
15371536
Rob Wu <rob@robwu.nl>
15381537
Steven Winston <swinston100@hotmail.com>
@@ -2036,5 +2035,34 @@ Hannes Magnusson <hannes.magnusson@creditkarma.com>
20362035
ChungNgoops <mr.mvagusta@gmail.com>
20372036
Jose M. Palacios Diaz <jmpd1988@gmail.com>
20382037
hmammedzadeh <hasan.mammed-zadeh@commercetools.de>
2038+
IHsuan <frostyjoan0829@livemail.tw>
2039+
Francisco Gerardo Neri Andriano <on_neri@hotmail.com>
2040+
Shilo Mangam <smangam@gmail.com>
2041+
idandagan1 <idandagan1@gmail.com>
2042+
Cameron Moorehead <hello@cameronmoorehead.com>
2043+
TomerOmri <tomer92@gmail.com>
2044+
Collins Abitekaniza <abtcolns@gmail.com>
2045+
Federico Kauffman <fede.kau@gmail.com>
2046+
Benno Fünfstück <benno.fuenfstueck@gmail.com>
2047+
Ram Goli <ramsgoli@gmail.com>
2048+
babygoat <babygoat1124@gmail.com>
2049+
Will Clark <willclarktech@users.noreply.github.com>
2050+
Jem Bezooyen <jem@hipmedia.ca>
2051+
Haejin Jo <professionalhaejin@gmail.com>
2052+
Hakan Kimeiga <hak7alp@gmail.com>
2053+
Tyler <tyler.z.yang@gmail.com>
2054+
Shinya Kanamaru <mn131bb@gmail.com>
2055+
you12724 <you12724@gmail.com>
2056+
routerman <h.okano.looz@gmail.com>
2057+
April Webster <awebster@us.ibm.com>
2058+
Jure Triglav <juretriglav@gmail.com>
2059+
alnyan <qShadowp@gmail.com>
2060+
rt33 <rt33@lastcycle.com>
2061+
Ulmanb <barulman@gmail.com>
2062+
xortiz <xavier.ortiz.ch@gmail.com>
2063+
Waleed Ashraf <waleedashraf@outlook.com>
2064+
Mir Mufaqam Ali <mannanali413@gmail.com>
2065+
Nicholas Drane <nicholasdrane@gmail.com>
2066+
Shobhit Chittora <chittorashobhit@gmail.com>
20392067

20402068
# Generated by tools/update-authors.sh

doc/api/console.md

Lines changed: 16 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -103,70 +103,33 @@ The global `console` is a special `Console` whose output is sent to
103103
new Console(process.stdout, process.stderr);
104104
```
105105

106-
### console.assert(value[, message][, ...args])
106+
### console.assert(value[, ...message])
107107
<!-- YAML
108108
added: v0.1.101
109+
changes:
110+
- version: REPLACEME
111+
pr-url: https://github.com/nodejs/node/pull/REPLACEME
112+
description: The implementation is now spec compliant and does not throw
113+
anymore.
109114
-->
110-
* `value` {any}
111-
* `message` {any}
112-
* `...args` {any}
115+
* `value` {any} The value tested for being truthy.
116+
* `...message` {any} All arguments besides `value` are used as error message.
113117

114118
A simple assertion test that verifies whether `value` is truthy. If it is not,
115-
an `AssertionError` is thrown. If provided, the error `message` is formatted
116-
using [`util.format()`][] and used as the error message.
119+
`Assertion failed` is logged. If provided, the error `message` is formatted
120+
using [`util.format()`][] by passing along all message arguments. The output is
121+
used as the error message.
117122

118123
```js
119124
console.assert(true, 'does nothing');
120125
// OK
121-
console.assert(false, 'Whoops %s', 'didn\'t work');
122-
// AssertionError: Whoops didn't work
126+
console.assert(false, 'Whoops %s work', 'didn\'t');
127+
// Assertion failed: Whoops didn't work
123128
```
124129

125-
*Note*: The `console.assert()` method is implemented differently in Node.js
126-
than the `console.assert()` method [available in browsers][web-api-assert].
127-
128-
Specifically, in browsers, calling `console.assert()` with a falsy
129-
assertion will cause the `message` to be printed to the console without
130-
interrupting execution of subsequent code. In Node.js, however, a falsy
131-
assertion will cause an `AssertionError` to be thrown.
132-
133-
Functionality approximating that implemented by browsers can be implemented
134-
by extending Node.js' `console` and overriding the `console.assert()` method.
135-
136-
In the following example, a simple module is created that extends and overrides
137-
the default behavior of `console` in Node.js.
138-
139-
<!-- eslint-disable func-name-matching -->
140-
```js
141-
'use strict';
142-
143-
// Creates a simple extension of console with a
144-
// new impl for assert without monkey-patching.
145-
const myConsole = Object.create(console, {
146-
assert: {
147-
value: function assert(assertion, message, ...args) {
148-
try {
149-
console.assert(assertion, message, ...args);
150-
} catch (err) {
151-
console.error(err.stack);
152-
}
153-
},
154-
configurable: true,
155-
enumerable: true,
156-
writable: true,
157-
},
158-
});
159-
160-
module.exports = myConsole;
161-
```
162-
163-
This can then be used as a direct replacement for the built in console:
164-
165-
```js
166-
const console = require('./myConsole');
167-
console.assert(false, 'this message will print, but no error thrown');
168-
console.log('this will also print');
169-
```
130+
*Note*: Calling `console.assert()` with a falsy assertion will only cause the
131+
`message` to be printed to the console without interrupting execution of
132+
subsequent code.
170133

171134
### console.clear()
172135
<!-- YAML
@@ -531,4 +494,3 @@ This method does not display anything unless used in the inspector. The
531494
[customizing `util.inspect()` colors]: util.html#util_customizing_util_inspect_colors
532495
[inspector]: debugger.html
533496
[note on process I/O]: process.html#process_a_note_on_process_i_o
534-
[web-api-assert]: https://developer.mozilla.org/en-US/docs/Web/API/console/assert

doc/guides/building-node-with-ninja.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,36 @@
11
# Building Node with Ninja
22

3-
The purpose of this guide is to show how to build Node.js using [Ninja][], as doing so can be significantly quicker than using `make`. Please see [Ninja's site][Ninja] for installation instructions (unix only).
3+
The purpose of this guide is to show how to build Node.js using [Ninja][], as
4+
doing so can be significantly quicker than using `make`. Please see
5+
[Ninja's site][Ninja] for installation instructions (unix only).
46

57
To build Node with ninja, there are 3 steps that must be taken:
68

79
1. Configure the project's OS-based build rules via `./configure --ninja`.
810
2. Run `ninja -C out/Release` to produce a compiled release binary.
911
3. Lastly, make symlink to `./node` using `ln -fs out/Release/node node`.
1012

11-
When running `ninja -C out/Release` you will see output similar to the following if the build has succeeded:
13+
When running `ninja -C out/Release` you will see output similar to the following
14+
if the build has succeeded:
15+
1216
```txt
1317
ninja: Entering directory `out/Release`
1418
[4/4] LINK node, POSTBUILDS
1519
```
1620

17-
The bottom line will change while building, showing the progress as `[finished/total]` build steps.
18-
This is useful output that `make` does not produce and is one of the benefits of using Ninja.
19-
Also, Ninja will likely compile much faster than even `make -j4` (or `-j<number of processor threads on your machine>`).
21+
The bottom line will change while building, showing the progress as
22+
`[finished/total]` build steps. This is useful output that `make` does not
23+
produce and is one of the benefits of using Ninja. Also, Ninja will likely
24+
compile much faster than even `make -j4` (or
25+
`-j<number of processor threads on your machine>`).
2026

2127
## Considerations
2228

23-
Ninja builds vary slightly from `make` builds. If you wish to run `make test` after, `make` will likely still need to rebuild some amount of Node.
29+
Ninja builds vary slightly from `make` builds. If you wish to run `make test`
30+
after, `make` will likely still need to rebuild some amount of Node.
2431

25-
As such, if you wish to run the tests, it can be helpful to invoke the test runner directly, like so:
32+
As such, if you wish to run the tests, it can be helpful to invoke the test
33+
runner directly, like so:
2634
`tools/test.py --mode=release message parallel sequential -J`
2735

2836
## Alias
@@ -31,7 +39,8 @@ As such, if you wish to run the tests, it can be helpful to invoke the test runn
3139

3240
## Producing a debug build
3341

34-
The above alias can be modified slightly to produce a debug build, rather than a release build as shown below:
42+
The above alias can be modified slightly to produce a debug build, rather than a
43+
release build as shown below:
3544
`alias nnodedebug='./configure --ninja && ninja -C out/Debug && ln -fs out/Debug/node node_g'`
3645

3746

doc/guides/maintaining-V8.md

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ process.
157157

158158
* Unfixed bugs. The bug exists in the V8 master branch.
159159
* Fixed, but needs backport. The bug may need porting to one or more branches.
160-
* Backporting to active branches.
161-
* Backporting to abandoned branches.
160+
* Backporting to active branches.
161+
* Backporting to abandoned branches.
162162
* Backports identified by the V8 team. Bugs identified by upstream V8 that we
163163
haven't encountered in Node.js yet.
164164

@@ -188,14 +188,14 @@ backport the fix:
188188
* Identify which version of V8 the bug was fixed in.
189189
* Identify if any active V8 branches still contain the bug:
190190
* A tracking bug is needed to request a backport.
191-
* If there isn't already a V8 bug tracking the fix, open a new merge request
192-
bug using this [Node.js specific template][V8TemplateMergeRequest].
193-
* If a bug already exists
194-
* Add a reference to the GitHub issue.
195-
* Attach *merge-request-x.x* labels to the bug for any active branches
196-
that still contain the bug. (e.g. merge-request-5.3,
197-
merge-request-5.4)
198-
* Add ofrobots-at-google.com to the cc list.
191+
* If there isn't already a V8 bug tracking the fix, open a new merge request
192+
bug using this [Node.js specific template][V8TemplateMergeRequest].
193+
* If a bug already exists
194+
* Add a reference to the GitHub issue.
195+
* Attach *merge-request-x.x* labels to the bug for any active branches
196+
that still contain the bug. (e.g. merge-request-5.3,
197+
merge-request-5.4)
198+
* Add ofrobots-at-google.com to the cc list.
199199
* Once the merge has been approved, it should be merged using the
200200
[merge script documented in the V8 wiki][V8MergingPatching]. Merging requires
201201
commit access to the V8 repository. If you don't have commit access you can
@@ -214,24 +214,24 @@ to be cherry-picked in the Node.js repository and V8-CI must test the change.
214214

215215
* For each abandoned V8 branch corresponding to an LTS branch that is affected
216216
by the bug:
217-
* Checkout a branch off the appropriate *vY.x-staging* branch (e.g.
218-
*v6.x-staging* to fix an issue in V8 5.1).
219-
* Cherry-pick the commit(s) from the V8 repository.
220-
* On Node.js < 9.0.0: Increase the patch level version in `v8-version.h`.
221-
This will not cause any problems with versioning because V8 will not
222-
publish other patches for this branch, so Node.js can effectively bump the
223-
patch version.
224-
* On Node.js >= 9.0.0: Increase the `v8_embedder_string` number in
225-
`common.gypi`.
226-
* In some cases the patch may require extra effort to merge in case V8 has
227-
changed substantially. For important issues we may be able to lean on the
228-
V8 team to get help with reimplementing the patch.
229-
* Open a cherry-pick PR on `nodejs/node` targeting the *vY.x-staging* branch
230-
and notify the `@nodejs/v8` team.
231-
* Run the Node.js [V8 CI] in addition to the [Node.js CI].
232-
Note: The CI uses the `test-v8` target in the `Makefile`, which uses
233-
`tools/make-v8.sh` to reconstruct a git tree in the `deps/v8` directory to
234-
run V8 tests.
217+
* Checkout a branch off the appropriate *vY.x-staging* branch (e.g.
218+
*v6.x-staging* to fix an issue in V8 5.1).
219+
* Cherry-pick the commit(s) from the V8 repository.
220+
* On Node.js < 9.0.0: Increase the patch level version in `v8-version.h`.
221+
This will not cause any problems with versioning because V8 will not
222+
publish other patches for this branch, so Node.js can effectively bump the
223+
patch version.
224+
* On Node.js >= 9.0.0: Increase the `v8_embedder_string` number in
225+
`common.gypi`.
226+
* In some cases the patch may require extra effort to merge in case V8 has
227+
changed substantially. For important issues we may be able to lean on the
228+
V8 team to get help with reimplementing the patch.
229+
* Open a cherry-pick PR on `nodejs/node` targeting the *vY.x-staging* branch
230+
and notify the `@nodejs/v8` team.
231+
* Run the Node.js [V8 CI] in addition to the [Node.js CI].
232+
Note: The CI uses the `test-v8` target in the `Makefile`, which uses
233+
`tools/make-v8.sh` to reconstruct a git tree in the `deps/v8` directory to
234+
run V8 tests.
235235

236236
The [`update-v8`] tool can be used to simplify this task. Run
237237
`update-v8 backport --sha=SHA` to cherry-pick a commit.
@@ -275,6 +275,7 @@ Original commit message:
275275
Refs: https://github.com/v8/v8/commit/a51f429772d1e796744244128c9feeab4c26a854
276276
PR-URL: https://github.com/nodejs/node/pull/7833
277277
```
278+
278279
* Open a PR against the `v6.x-staging` branch in the Node.js repo. Launch the
279280
normal and [V8 CI] using the Node.js CI system. We only needed to backport to
280281
`v6.x` as the other LTS branches weren't affected by this bug.

doc/guides/maintaining-npm.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ $ git checkout vX.Y.Z
2121
$ make release
2222
```
2323

24-
Note: please run `npm dist-tag ls npm` and make sure this is the `latest` **dist-tag**. `latest` on git is usually released as `next` when it's time to downstream
24+
Note: please run `npm dist-tag ls npm` and make sure this is the `latest`
25+
**dist-tag**. `latest` on git is usually released as `next` when it's time to
26+
downstream
2527

2628
## Step 3: Remove old npm
2729

doc/guides/writing-and-running-benchmarks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ arrays/zero-int.js n=25 type=Buffer: 90.49906662339653
144144
```
145145

146146
It is possible to execute more groups by adding extra process arguments.
147+
147148
```console
148149
$ node benchmark/run.js arrays buffers
149150
```
@@ -439,6 +440,7 @@ function main(conf) {
439440
```
440441

441442
Supported options keys are:
443+
442444
* `port` - defaults to `common.PORT`
443445
* `path` - defaults to `/`
444446
* `connections` - number of concurrent connections to use, defaults to 100

doc/guides/writing-tests.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ const freelist = require('internal/freelist');
238238

239239
When writing assertions, prefer the strict versions:
240240

241-
* `assert.strictEqual()` over `assert.equal()`
242-
* `assert.deepStrictEqual()` over `assert.deepEqual()`
241+
- `assert.strictEqual()` over `assert.equal()`
242+
- `assert.deepStrictEqual()` over `assert.deepEqual()`
243243

244244
When using `assert.throws()`, if possible, provide the full error message:
245245

@@ -263,9 +263,9 @@ in each release.
263263

264264
For example:
265265

266-
* `let` and `const` over `var`
267-
* Template literals over string concatenation
268-
* Arrow functions when appropriate
266+
- `let` and `const` over `var`
267+
- Template literals over string concatenation
268+
- Arrow functions when appropriate
269269

270270
## Naming Test Files
271271

@@ -306,12 +306,14 @@ the upstream project, send another PR here to update Node.js accordingly.
306306
Be sure to update the hash in the URL following `WPT Refs:`.
307307

308308
## C++ Unit test
309+
309310
C++ code can be tested using [Google Test][]. Most features in Node.js can be
310311
tested using the methods described previously in this document. But there are
311312
cases where these might not be enough, for example writing code for Node.js
312313
that will only be called when Node.js is embedded.
313314

314315
### Adding a new test
316+
315317
The unit test should be placed in `test/cctest` and be named with the prefix
316318
`test` followed by the name of unit being tested. For example, the code below
317319
would be placed in `test/cctest/test_env.cc`:
@@ -345,18 +347,21 @@ static void at_exit_callback(void* arg) {
345347
```
346348
347349
Next add the test to the `sources` in the `cctest` target in node.gyp:
350+
348351
```console
349352
'sources': [
350353
'test/cctest/test_env.cc',
351354
...
352355
],
353356
```
357+
354358
Note that the only sources that should be included in the cctest target are
355359
actual test or helper source files. There might be a need to include specific
356360
object files that are compiled by the `node` target and this can be done by
357361
adding them to the `libraries` section in the cctest target.
358362

359363
The test can be executed by running the `cctest` target:
364+
360365
```console
361366
$ make cctest
362367
```

0 commit comments

Comments
 (0)