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

Commit

Permalink
Merge nodejs/master
Browse files Browse the repository at this point in the history
Merge 82790d8 as of 2017-10-31.
This is an automatically created merge. For any problems please
contact @kunalspathak.
  • Loading branch information
chakrabot committed Nov 6, 2017
2 parents 3018e16 + 82790d8 commit 35c8c3a
Show file tree
Hide file tree
Showing 1,979 changed files with 110,026 additions and 35,506 deletions.
15 changes: 15 additions & 0 deletions CPP_STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,21 @@ class FancyContainer {
What it says in the title.
## Do not include `*.h` if `*-inl.h` has already been included
Do
```cpp
#include "util-inl.h" // already includes util.h
```

instead of

```cpp
#include "util.h"
#include "util-inl.h"
```

## Avoid throwing JavaScript errors in nested C++ methods

If you need to throw JavaScript errors from a C++ binding method, try to do it
Expand Down
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -1119,3 +1119,29 @@ The externally maintained libraries used by Node.js are:
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

- remark-cli, located at tools/remark-cli, is licensed as follows:
"""
(The MIT License)

Copyright (c) 2014-2016 Titus Wormer <tituswormer@gmail.com>
Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""
73 changes: 53 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ test: all
$(CI_ASYNC_HOOKS) \
$(CI_JS_SUITES) \
$(CI_NATIVE_SUITES) \
doctool known_issues
$(CI_DOC) \
known_issues
endif

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

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

ifeq ($(OSTYPE),aix)
Expand All @@ -277,7 +277,7 @@ endif

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

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

# .buildstamp and .docbuildstamp need $(NODE_EXE) but cannot depend on it
# .buildstamp needs $(NODE_EXE) but cannot depend on it
# directly because it calls make recursively. The parent make cannot know
# if the subprocess touched anything so it pessimistically assumes that
# .buildstamp and .docbuildstamp are out of date and need a rebuild.
# .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
Expand All @@ -337,7 +338,11 @@ test/addons-napi/.buildstamp: config.gypi \
src/node_api.h src/node_api_types.h
# Cannot use $(wildcard test/addons-napi/*/) here, it's evaluated before
# embedded addons have been generated from the documentation.
# Ignore folders without binding.gyp
# (https://github.com/nodejs/node/issues/14843)
@for dirname in test/addons-napi/*/; do \
if [ ! -f "$$PWD/$${dirname}binding.gyp" ]; then \
continue; fi ; \
printf "\nBuilding addon $$PWD/$$dirname\n" ; \
env MAKEFLAGS="-j1" $(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp \
--loglevel=$(LOGLEVEL) rebuild \
Expand All @@ -347,10 +352,10 @@ test/addons-napi/.buildstamp: config.gypi \
done
touch $@

# .buildstamp and .docbuildstamp need $(NODE_EXE) but cannot depend on it
# .buildstamp needs $(NODE_EXE) but cannot depend on it
# directly because it calls make recursively. The parent make cannot know
# if the subprocess touched anything so it pessimistically assumes that
# .buildstamp and .docbuildstamp are out of date and need a rebuild.
# .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
Expand Down Expand Up @@ -382,6 +387,7 @@ test-all-valgrind: test-build
CI_NATIVE_SUITES ?= addons addons-napi
CI_ASYNC_HOOKS := async-hooks
CI_JS_SUITES ?= default
CI_DOC := doctool

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

test-doc: doc-only
$(MAKE) lint
$(PYTHON) tools/test.py $(CI_DOC)

test-known-issues: all
$(PYTHON) tools/test.py known_issues

Expand Down Expand Up @@ -537,13 +548,13 @@ doc-only: $(apidocs_html) $(apidocs_json)
doc: $(NODE_EXE) doc-only

$(apidoc_dirs):
mkdir -p $@
@mkdir -p $@

out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets
cp $< $@
@cp $< $@

out/doc/%: doc/%
cp -r $< $@
@cp -r $< $@

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

out/doc/api/%.json: doc/api/%.md
$(call gen-doc, $(gen-json))
@$(call gen-doc, $(gen-json))

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

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

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

lint-js:
@echo "Running JS linter..."
$(NODE) tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules --ext=.js,.mjs,.md \
$(LINT_JS_TARGETS)
@if [ -x $(NODE) ]; then \
$(NODE) $(LINT_JS_CMD); \
else \
node $(LINT_JS_CMD); \
fi

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

lint-js-ci:
@echo "Running JS linter..."
$(NODE) tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
$(LINT_JS_TARGETS)
@if [ -x $(NODE) ]; then \
$(NODE) tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
$(LINT_JS_TARGETS); \
else \
node tools/lint-js.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
$(LINT_JS_TARGETS); \
fi

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

LINT_CPP_ADDON_DOC_FILES = $(wildcard test/addons/??_*/*.cc test/addons/??_*/*.h)
LINT_CPP_EXCLUDE ?=
LINT_CPP_EXCLUDE += src/node_root_certs.h
LINT_CPP_EXCLUDE += $(wildcard test/addons/??_*/*.cc test/addons/??_*/*.h)
LINT_CPP_EXCLUDE += $(LINT_CPP_ADDON_DOC_FILES)
LINT_CPP_EXCLUDE += $(wildcard test/addons-napi/??_*/*.cc test/addons-napi/??_*/*.h)
# These files were copied more or less verbatim from V8.
LINT_CPP_EXCLUDE += src/tracing/trace_event.h src/tracing/trace_event_common.h
Expand All @@ -1019,11 +1042,19 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \
tools/icu/*.h \
))

# Code blocks don't have newline at the end,
# 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:
@echo "Running C++ linter..."
@$(PYTHON) tools/cpplint.py $(LINT_CPP_FILES)
@$(PYTHON) tools/check-imports.py

lint-addon-docs: test/addons/.docbuildstamp
@echo "Running C++ linter on addon docs..."
@$(PYTHON) tools/cpplint.py --filter=$(ADDON_DOC_LINT_FLAGS) $(LINT_CPP_ADDON_DOC_FILES)

cpplint: lint-cpp
@echo "Please use lint-cpp instead of cpplint"

Expand All @@ -1033,9 +1064,10 @@ lint:
$(MAKE) lint-js || EXIT_STATUS=$$? ; \
$(MAKE) lint-cpp || EXIT_STATUS=$$? ; \
$(MAKE) lint-md || EXIT_STATUS=$$? ; \
$(MAKE) lint-addon-docs || EXIT_STATUS=$$? ; \
exit $$EXIT_STATUS
CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+
lint-ci: lint-js-ci lint-cpp lint-md
lint-ci: lint-js-ci lint-cpp lint-md lint-addon-docs
@if ! ( grep -IEqrs "$(CONFLICT_RE)" benchmark deps doc lib src test tools ) \
&& ! ( find . -maxdepth 1 -type f | xargs grep -IEqs "$(CONFLICT_RE)" ); then \
exit 0 ; \
Expand Down Expand Up @@ -1115,6 +1147,7 @@ endif
test-ci \
test-ci-js \
test-ci-native \
test-doc \
test-gc \
test-gc-clean \
test-hash-seed \
Expand Down
1 change: 1 addition & 0 deletions deps/npm/.mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Jake Verbaten <raynos2@gmail.com>
James Sanders <jimmyjazz14@gmail.com>
James Treworgy <jamietre@gmail.com>
Jason Smith <jhs@iriscouch.com>
Joshua Bennett <legodudejb@gmail.com>
Jonas Weber <github@jonasw.de>
Julien Meddah <julien.meddah@deveryware.com>
Kevin Lorenz <mail@kevinlorenz.com>
Expand Down
3 changes: 0 additions & 3 deletions deps/npm/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ matrix:
script:
- "standard"
- "node . run tap -- \"test/tap/*.js\" \"test/broken-under-nyc/*.js\""
before_install:
# required by test/tap/registry.js
- "mkdir -p /var/run/couchdb"
notifications:
slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8
cache:
Expand Down
25 changes: 24 additions & 1 deletion deps/npm/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ Daniel Paz-Soldan <daniel.pazsoldan@gmail.com>
Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Zach Renner <zarenner@microsoft.com>
Christopher Hiller <boneskull@boneskull.com>
legodude17 <legodudejb@gmail.com>
Joshua Bennett <legodudejb@gmail.com>
Andrew Meyer <andrewm.bpi@gmail.com>
Michael Jasper <mdjasper@gmail.com>
Max <contact@mstoiber.com>
Expand Down Expand Up @@ -503,3 +503,26 @@ Sanketh Katta <sankethkatta@gmail.com>
Tim Needham <tim.needham@wmfs.net>
leonardo rojas <leonardo.rojas@shopify.com>
Mark Peter Fejes <fejes.mark@gmail.com>
Ryan Florence <rpflorence@gmail.com>
MichaelQQ <mingsian.tu@vpon.com>
Anders D. Johnson <anders.d.johnson.developer@gmail.com>
Benjamin Fernandes <lotharsee@gmail.com>
Simon Kurtz <simonkurtz@gmail.com>
David Goss <david@davidgoss.co.uk>
Luis Gustavo Pereira <lgp1985@yahoo.com.br>
Amos Wenger <fasterthanlime@users.noreply.github.com>
Samuel Marks <samuelmarks@gmail.com>
Victor Travieso <victor@grabcad.com>
legodude17 <legodude17@users.noreply.github.com>
Joshua Chaitin-Pollak <jbcpollak@users.noreply.github.com>
Brendan Warkentin <faazshift@gmail.com>
Scott Santucci <ScottFreeCode@users.noreply.github.com>
Xavier Cambar <xcambar@gmail.com>
Vikram <nrvikram19@gmail.com>
Igor Nadj <igor.nadj@shinesolutions.com>
Tong Li <supertong@users.noreply.github.com>
tripu <t@tripu.info>
Carsten Brandt <mail@cebe.cc>
Marcin Szczepanski <marcin@imagichine.com.au>
Josh Clow <josh@textio.com>
Jakub Holy <jakubholy@jakubholy.net>
Loading

0 comments on commit 35c8c3a

Please sign in to comment.