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

Commit 35c8c3a

Browse files
committed
Merge nodejs/master
Merge 82790d8 as of 2017-10-31. This is an automatically created merge. For any problems please contact @kunalspathak.
2 parents 3018e16 + 82790d8 commit 35c8c3a

File tree

1,979 files changed

+110026
-35506
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,979 files changed

+110026
-35506
lines changed

CPP_STYLE_GUIDE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,21 @@ class FancyContainer {
127127
128128
What it says in the title.
129129
130+
## Do not include `*.h` if `*-inl.h` has already been included
131+
132+
Do
133+
134+
```cpp
135+
#include "util-inl.h" // already includes util.h
136+
```
137+
138+
instead of
139+
140+
```cpp
141+
#include "util.h"
142+
#include "util-inl.h"
143+
```
144+
130145
## Avoid throwing JavaScript errors in nested C++ methods
131146

132147
If you need to throw JavaScript errors from a C++ binding method, try to do it

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,3 +1119,29 @@ The externally maintained libraries used by Node.js are:
11191119
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
11201120
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11211121
"""
1122+
1123+
- remark-cli, located at tools/remark-cli, is licensed as follows:
1124+
"""
1125+
(The MIT License)
1126+
1127+
Copyright (c) 2014-2016 Titus Wormer <tituswormer@gmail.com>
1128+
Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/)
1129+
1130+
Permission is hereby granted, free of charge, to any person obtaining a copy
1131+
of this software and associated documentation files (the "Software"), to deal
1132+
in the Software without restriction, including without limitation the rights
1133+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1134+
copies of the Software, and to permit persons to whom the Software is
1135+
furnished to do so, subject to the following conditions:
1136+
1137+
The above copyright notice and this permission notice shall be included in
1138+
all copies or substantial portions of the Software.
1139+
1140+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1141+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1142+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1143+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1144+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1145+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1146+
THE SOFTWARE.
1147+
"""

Makefile

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ test: all
219219
$(CI_ASYNC_HOOKS) \
220220
$(CI_JS_SUITES) \
221221
$(CI_NATIVE_SUITES) \
222-
doctool known_issues
222+
$(CI_DOC) \
223+
known_issues
223224
endif
224225

225226
# For a quick test, does not run linter or build doc
@@ -268,7 +269,6 @@ test/gc/build/Release/binding.node: test/gc/binding.cc test/gc/binding.gyp
268269
--directory="$(shell pwd)/test/gc" \
269270
--nodedir="$(shell pwd)"
270271

271-
# Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale.
272272
DOCBUILDSTAMP_PREREQS = tools/doc/addon-verify.js doc/api/addons.md
273273

274274
ifeq ($(OSTYPE),aix)
@@ -277,7 +277,7 @@ endif
277277

278278
test/addons/.docbuildstamp: $(DOCBUILDSTAMP_PREREQS)
279279
$(RM) -r test/addons/??_*/
280-
$(NODE) $<
280+
[ -x $(NODE) ] && $(NODE) $< || node $<
281281
touch $@
282282

283283
ADDONS_BINDING_GYPS := \
@@ -299,7 +299,8 @@ test/addons/.buildstamp: config.gypi \
299299
test/addons/.docbuildstamp
300300
# Cannot use $(wildcard test/addons/*/) here, it's evaluated before
301301
# embedded addons have been generated from the documentation.
302-
# Ignore folders without binding.gyp (#14843)
302+
# Ignore folders without binding.gyp
303+
# (https://github.com/nodejs/node/issues/14843)
303304
@for dirname in test/addons/*/; do \
304305
if [ ! -f "$$PWD/$${dirname}binding.gyp" ]; then \
305306
continue; fi ; \
@@ -312,10 +313,10 @@ test/addons/.buildstamp: config.gypi \
312313
done
313314
touch $@
314315

315-
# .buildstamp and .docbuildstamp need $(NODE_EXE) but cannot depend on it
316+
# .buildstamp needs $(NODE_EXE) but cannot depend on it
316317
# directly because it calls make recursively. The parent make cannot know
317318
# if the subprocess touched anything so it pessimistically assumes that
318-
# .buildstamp and .docbuildstamp are out of date and need a rebuild.
319+
# .buildstamp is out of date and need a rebuild.
319320
# Just goes to show that recursive make really is harmful...
320321
# TODO(bnoordhuis) Force rebuild after gyp update.
321322
build-addons: $(NODE_EXE) test/addons/.buildstamp
@@ -337,7 +338,11 @@ test/addons-napi/.buildstamp: config.gypi \
337338
src/node_api.h src/node_api_types.h
338339
# Cannot use $(wildcard test/addons-napi/*/) here, it's evaluated before
339340
# embedded addons have been generated from the documentation.
341+
# Ignore folders without binding.gyp
342+
# (https://github.com/nodejs/node/issues/14843)
340343
@for dirname in test/addons-napi/*/; do \
344+
if [ ! -f "$$PWD/$${dirname}binding.gyp" ]; then \
345+
continue; fi ; \
341346
printf "\nBuilding addon $$PWD/$$dirname\n" ; \
342347
env MAKEFLAGS="-j1" $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp \
343348
--loglevel=$(LOGLEVEL) rebuild \
@@ -347,10 +352,10 @@ test/addons-napi/.buildstamp: config.gypi \
347352
done
348353
touch $@
349354

350-
# .buildstamp and .docbuildstamp need $(NODE_EXE) but cannot depend on it
355+
# .buildstamp needs $(NODE_EXE) but cannot depend on it
351356
# directly because it calls make recursively. The parent make cannot know
352357
# if the subprocess touched anything so it pessimistically assumes that
353-
# .buildstamp and .docbuildstamp are out of date and need a rebuild.
358+
# .buildstamp is out of date and need a rebuild.
354359
# Just goes to show that recursive make really is harmful...
355360
# TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
356361
build-addons-napi: $(NODE_EXE) test/addons-napi/.buildstamp
@@ -382,6 +387,7 @@ test-all-valgrind: test-build
382387
CI_NATIVE_SUITES ?= addons addons-napi
383388
CI_ASYNC_HOOKS := async-hooks
384389
CI_JS_SUITES ?= default
390+
CI_DOC := doctool
385391

386392
# Build and test addons without building anything else
387393
test-ci-native: LOGLEVEL := info
@@ -407,7 +413,8 @@ test-ci: | clear-stalled build-addons build-addons-napi doc-only
407413
out/Release/cctest --gtest_output=tap:cctest.tap
408414
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
409415
--mode=release --flaky-tests=$(FLAKY_TESTS) \
410-
$(TEST_CI_ARGS) $(CI_ASYNC_HOOKS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES) doctool known_issues
416+
$(TEST_CI_ARGS) $(CI_ASYNC_HOOKS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES) \
417+
$(CI_DOC) known_issues
411418
# Clean up any leftover processes, error if found.
412419
ps awwx | grep Release/node | grep -v grep | cat
413420
@PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \
@@ -443,6 +450,10 @@ test-tick-processor: all
443450
test-hash-seed: all
444451
$(NODE) test/pummel/test-hash-seed.js
445452

453+
test-doc: doc-only
454+
$(MAKE) lint
455+
$(PYTHON) tools/test.py $(CI_DOC)
456+
446457
test-known-issues: all
447458
$(PYTHON) tools/test.py known_issues
448459

@@ -537,13 +548,13 @@ doc-only: $(apidocs_html) $(apidocs_json)
537548
doc: $(NODE_EXE) doc-only
538549

539550
$(apidoc_dirs):
540-
mkdir -p $@
551+
@mkdir -p $@
541552

542553
out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets
543-
cp $< $@
554+
@cp $< $@
544555

545556
out/doc/%: doc/%
546-
cp -r $< $@
557+
@cp -r $< $@
547558

548559
# check if ./node is actually set, else use user pre-installed binary
549560
gen-json = tools/doc/generate.js --format=json $< > $@
@@ -561,11 +572,11 @@ gen-doc = \
561572
[ -x $(NODE) ] && $(NODE) $(1) || node $(1)
562573

563574
out/doc/api/%.json: doc/api/%.md
564-
$(call gen-doc, $(gen-json))
575+
@$(call gen-doc, $(gen-json))
565576

566577
# check if ./node is actually set, else use user pre-installed binary
567578
out/doc/api/%.html: doc/api/%.md
568-
$(call gen-doc, $(gen-html))
579+
@$(call gen-doc, $(gen-html))
569580

570581
docopen: $(apidocs_html)
571582
@$(PYTHON) -mwebbrowser file://$(PWD)/out/doc/api/all.html
@@ -976,26 +987,38 @@ lint-md: lint-md-build
976987
./*.md doc src lib benchmark tools/doc/ tools/icu/
977988

978989
LINT_JS_TARGETS = benchmark doc lib test tools
990+
LINT_JS_CMD = tools/eslint/bin/eslint.js --cache \
991+
--rulesdir=tools/eslint-rules --ext=.js,.mjs,.md \
992+
$(LINT_JS_TARGETS)
979993

980994
lint-js:
981995
@echo "Running JS linter..."
982-
$(NODE) tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules --ext=.js,.mjs,.md \
983-
$(LINT_JS_TARGETS)
996+
@if [ -x $(NODE) ]; then \
997+
$(NODE) $(LINT_JS_CMD); \
998+
else \
999+
node $(LINT_JS_CMD); \
1000+
fi
9841001

9851002
jslint: lint-js
9861003
@echo "Please use lint-js instead of jslint"
9871004

9881005
lint-js-ci:
9891006
@echo "Running JS linter..."
990-
$(NODE) tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
991-
$(LINT_JS_TARGETS)
1007+
@if [ -x $(NODE) ]; then \
1008+
$(NODE) tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
1009+
$(LINT_JS_TARGETS); \
1010+
else \
1011+
node tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
1012+
$(LINT_JS_TARGETS); \
1013+
fi
9921014

9931015
jslint-ci: lint-js-ci
9941016
@echo "Please use lint-js-ci instead of jslint-ci"
9951017

1018+
LINT_CPP_ADDON_DOC_FILES = $(wildcard test/addons/??_*/*.cc test/addons/??_*/*.h)
9961019
LINT_CPP_EXCLUDE ?=
9971020
LINT_CPP_EXCLUDE += src/node_root_certs.h
998-
LINT_CPP_EXCLUDE += $(wildcard test/addons/??_*/*.cc test/addons/??_*/*.h)
1021+
LINT_CPP_EXCLUDE += $(LINT_CPP_ADDON_DOC_FILES)
9991022
LINT_CPP_EXCLUDE += $(wildcard test/addons-napi/??_*/*.cc test/addons-napi/??_*/*.h)
10001023
# These files were copied more or less verbatim from V8.
10011024
LINT_CPP_EXCLUDE += src/tracing/trace_event.h src/tracing/trace_event_common.h
@@ -1019,11 +1042,19 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
10191042
tools/icu/*.h \
10201043
))
10211044

1045+
# Code blocks don't have newline at the end,
1046+
# and the actual filename is generated so it won't match header guards
1047+
ADDON_DOC_LINT_FLAGS=-whitespace/ending_newline,-build/header_guard
1048+
10221049
lint-cpp:
10231050
@echo "Running C++ linter..."
10241051
@$(PYTHON) tools/cpplint.py $(LINT_CPP_FILES)
10251052
@$(PYTHON) tools/check-imports.py
10261053

1054+
lint-addon-docs: test/addons/.docbuildstamp
1055+
@echo "Running C++ linter on addon docs..."
1056+
@$(PYTHON) tools/cpplint.py --filter=$(ADDON_DOC_LINT_FLAGS) $(LINT_CPP_ADDON_DOC_FILES)
1057+
10271058
cpplint: lint-cpp
10281059
@echo "Please use lint-cpp instead of cpplint"
10291060

@@ -1033,9 +1064,10 @@ lint:
10331064
$(MAKE) lint-js || EXIT_STATUS=$$? ; \
10341065
$(MAKE) lint-cpp || EXIT_STATUS=$$? ; \
10351066
$(MAKE) lint-md || EXIT_STATUS=$$? ; \
1067+
$(MAKE) lint-addon-docs || EXIT_STATUS=$$? ; \
10361068
exit $$EXIT_STATUS
10371069
CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+
1038-
lint-ci: lint-js-ci lint-cpp lint-md
1070+
lint-ci: lint-js-ci lint-cpp lint-md lint-addon-docs
10391071
@if ! ( grep -IEqrs "$(CONFLICT_RE)" benchmark deps doc lib src test tools ) \
10401072
&& ! ( find . -maxdepth 1 -type f | xargs grep -IEqs "$(CONFLICT_RE)" ); then \
10411073
exit 0 ; \
@@ -1115,6 +1147,7 @@ endif
11151147
test-ci \
11161148
test-ci-js \
11171149
test-ci-native \
1150+
test-doc \
11181151
test-gc \
11191152
test-gc-clean \
11201153
test-hash-seed \

deps/npm/.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Jake Verbaten <raynos2@gmail.com>
3232
James Sanders <jimmyjazz14@gmail.com>
3333
James Treworgy <jamietre@gmail.com>
3434
Jason Smith <jhs@iriscouch.com>
35+
Joshua Bennett <legodudejb@gmail.com>
3536
Jonas Weber <github@jonasw.de>
3637
Julien Meddah <julien.meddah@deveryware.com>
3738
Kevin Lorenz <mail@kevinlorenz.com>

deps/npm/.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ matrix:
2525
script:
2626
- "standard"
2727
- "node . run tap -- \"test/tap/*.js\" \"test/broken-under-nyc/*.js\""
28-
before_install:
29-
# required by test/tap/registry.js
30-
- "mkdir -p /var/run/couchdb"
3128
notifications:
3229
slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8
3330
cache:

deps/npm/AUTHORS

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ Daniel Paz-Soldan <daniel.pazsoldan@gmail.com>
424424
Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
425425
Zach Renner <zarenner@microsoft.com>
426426
Christopher Hiller <boneskull@boneskull.com>
427-
legodude17 <legodudejb@gmail.com>
427+
Joshua Bennett <legodudejb@gmail.com>
428428
Andrew Meyer <andrewm.bpi@gmail.com>
429429
Michael Jasper <mdjasper@gmail.com>
430430
Max <contact@mstoiber.com>
@@ -503,3 +503,26 @@ Sanketh Katta <sankethkatta@gmail.com>
503503
Tim Needham <tim.needham@wmfs.net>
504504
leonardo rojas <leonardo.rojas@shopify.com>
505505
Mark Peter Fejes <fejes.mark@gmail.com>
506+
Ryan Florence <rpflorence@gmail.com>
507+
MichaelQQ <mingsian.tu@vpon.com>
508+
Anders D. Johnson <anders.d.johnson.developer@gmail.com>
509+
Benjamin Fernandes <lotharsee@gmail.com>
510+
Simon Kurtz <simonkurtz@gmail.com>
511+
David Goss <david@davidgoss.co.uk>
512+
Luis Gustavo Pereira <lgp1985@yahoo.com.br>
513+
Amos Wenger <fasterthanlime@users.noreply.github.com>
514+
Samuel Marks <samuelmarks@gmail.com>
515+
Victor Travieso <victor@grabcad.com>
516+
legodude17 <legodude17@users.noreply.github.com>
517+
Joshua Chaitin-Pollak <jbcpollak@users.noreply.github.com>
518+
Brendan Warkentin <faazshift@gmail.com>
519+
Scott Santucci <ScottFreeCode@users.noreply.github.com>
520+
Xavier Cambar <xcambar@gmail.com>
521+
Vikram <nrvikram19@gmail.com>
522+
Igor Nadj <igor.nadj@shinesolutions.com>
523+
Tong Li <supertong@users.noreply.github.com>
524+
tripu <t@tripu.info>
525+
Carsten Brandt <mail@cebe.cc>
526+
Marcin Szczepanski <marcin@imagichine.com.au>
527+
Josh Clow <josh@textio.com>
528+
Jakub Holy <jakubholy@jakubholy.net>

0 commit comments

Comments
 (0)