summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* src: throw ERR_MISSING_MODULE in module_wrap.ccJoyee Cheung2018-04-192-2/+2
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/20121 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
* src: throw ERR_BUFFER_OUT_OF_BOUNDS in node_buffer.ccJoyee Cheung2018-04-192-2/+5
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/20121 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
* src: throw ERR_INVALID_ARG_TYPE in C++ argument checksJoyee Cheung2018-04-1912-93/+143
| | | | | | | | | | | | | | | | | | | | | - Moves THROW_AND_RETURN_IF_NOT_BUFFER and THROW_AND_RETURN_IF_NOT_STRING from node_crypto.cc to node_errors.h so it can be reused. - Move THROW_AND_RETURN_UNLESS_BUFFER in util.h to node_buffer.cc and call THROW_AND_RETURN_IF_NOT_BUFFER there. The only other reference to THROW_AND_RETURN_UNLESS_BUFFER in node_i18n.cc can be safely replaced by an assertion since the argument will be checked in JS land. - Migrate ERR_INVALID_ARG_TYPE errors in C++. We can move the checks to JS land if possible later without having to go semver-major. PR-URL: https://github.com/nodejs/node/pull/20121 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
* src: migrate ERR_INDEX_OUT_OF_RANGE in C++Joyee Cheung2018-04-193-6/+13
| | | | | | | | | | | | | This patch migrates the "Index out of range" errors in C++ to errors with the code `ERR_INDEX_OUT_OF_RANGE` which have equivalents in JavaScript. PR-URL: https://github.com/nodejs/node/pull/20121 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
* src: add THROW_ERR_* helpersJoyee Cheung2018-04-191-0/+6
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/20121 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
* lib: make c, ca and certs const in _tls_commonDaniel Bevenius2018-04-191-3/+3
| | | | | | PR-URL: https://github.com/nodejs/node/pull/20073 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* lib: use object destructuring tls.jsDaniel Bevenius2018-04-191-2/+2
| | | | | | | | | | | | | | This commit updates canonicalizeIP and Buffer to use object destructuring which is done for other functions in lib/tls.js PR-URL: https://github.com/nodejs/node/pull/20070 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* doc: add myself to list of TSC membersTimothy Gu2018-04-181-0/+2
| | | | | | | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/20132 Fixes: https://github.com/nodejs/TSC/issues/485 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* doc: fully document --experimental-repl-awaitTimothy Gu2018-04-183-1/+15
| | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/20133 Fixes: https://github.com/nodejs/node/pull/19604#issuecomment-382427090 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* doc: fix misplaced entries in test/common docRich Trott2018-04-181-15/+15
| | | | | | | | | | | | One entry is placed in the wrong module and other entries are not in alphabetical order. PR-URL: https://github.com/nodejs/node/pull/20117 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
* test: remove message from strictEqual assertionsisurusiri2018-04-181-3/+2
| | | | | | | | | | | | | | | | | If values are not equals in strictEqual assertions, an AssertionError is thrown with a message property set equals to the value of the message parameter. If we pass a message, this message will be printed instead of the default message, which contains the value that is causing the error. Hence removed the value passed as the message in strictEqual assertions of test/parallel/test-http-response-readable.js PR-URL: https://github.com/nodejs/node/pull/20067 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* repl: hide top-level await feature behind a flagTimothy Gu2018-04-186-3/+49
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/19604 Refs: https://github.com/nodejs/node/pull/17807 Refs: https://github.com/nodejs/node/pull/15566#issuecomment-353428430 Reviewed-By: Gus Caplan <me@gus.host>
* src: remove req_wrap-inl.h from stream_base.hDaniel Bevenius2018-04-182-3/+2
| | | | | | | | | | | | | | This commit removes the inclusion of req_wrap-inl.h in stream_base.h as ReqWrap is not used. This removal required stream_base.h to include async_wrap-inl.h so there is an implementation of BaseObject::object. The above change also affected connect_wrap, which needs to include req_wrap-inl.h to get an implementation of ReqWrap::Dispatched. PR-URL: https://github.com/nodejs/node/pull/20063 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
* src: use v8:: namepace consistently in node_fileDaniel Bevenius2018-04-181-3/+3
| | | | | | | | | | | | Currently node_file.cc has a number of using declarations but in a few places still uses the qualified names. This commit changes this for consistency. PR-URL: https://github.com/nodejs/node/pull/20059 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* domain: converted anonymous to named functionDaven Casia2018-04-171-3/+3
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/20021 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* doc: move mikeal to Collaborator Emeriti listRich Trott2018-04-181-2/+2
| | | | | | | | | | | | | | | | | Per conversation with Mikeal, moving to Collaborator Emeriti list. Mikeal will remain active in Evangelism so you'll still see him around the org. PR-URL: https://github.com/nodejs/node/pull/20113 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Myles Borins <myles.borins@gmail.com>
* doc: adjust slightly awkward wording in buffer.mdRich Trott2018-04-171-3/+5
| | | | | | | | | | | | | | Minor re-wording of three sentences to make them slightly more natural. Ending sentences with prepositions is fine in many cases, but these three cases are a bit awkward. PR-URL: https://github.com/nodejs/node/pull/20037 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
* deps: patch the V8 API to be forward compatible with 6.7Peter Marshall2018-04-178-109/+114
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/19999 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* doc: update links and names for DevTools ProtocolVse Mozhet Byt2018-04-173-5/+5
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/20111 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
* deps: bump V8 embedder stringMyles Borins2018-04-171-1/+1
| | | | | | | | | | | | This was missed in a previous PR PR-URL: https://github.com/nodejs/node/pull/20105 Refs: https://github.com/nodejs/node/pull/20016 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* trace_events: adds a new trace_events apiJames M Snell2018-04-1725-87/+677
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the requirement to use `--trace-events-enabled` to enable trace events. Tracing is enabled automatically if there are any enabled categories. Adds a new `trace_events` module with an API for enabling/disabling trace events at runtime without a command line flag. ```js const trace_events = require('trace_events'); const categories = [ 'node.perf', 'node.async_hooks' ]; const tracing = trace_events.createTracing({ categories }); tracing.enable(); // do stuff tracing.disable(); ``` Multiple `Tracing` objects may exist and be enabled at any point in time. The enabled trace event categories is the union of all enabled `Tracing` objects and the `--trace-event-categories` flag. PR-URL: https://github.com/nodejs/node/pull/19803 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
* http: fix undefined error in parser eventAnatoli Papirovski2018-04-171-4/+6
| | | | | | | | | | | | | | | The current check for socket.server[kIncomingMessage] does not account for the possibility of a socket.server that doesn't have that property defined. Fix it. PR-URL: https://github.com/nodejs/node/pull/20029 Fixes: https://github.com/nodejs/node/issues/19231 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Khaidi Chu <i@2333.moe>
* timers: call destroy on interval errorAnatoli Papirovski2018-04-172-1/+38
| | | | | | | | | | | | | When an interval callback throws an error, the destroy hook is never called due to a faulty if condition. PR-URL: https://github.com/nodejs/node/pull/20001 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
* timers: fix subsequent enroll calls not workingAnatoli Papirovski2018-04-172-1/+18
| | | | | | | | | | | | | | A bug was introduced in #17704 which meant that subsequent calls to enroll would unset the new _idleTimeout and the enrolled object could never again function as a timer. PR-URL: https://github.com/nodejs/node/pull/19936 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
* errors: alter ERR_INVALID_CURSOR_POSdavidmarkclements2018-04-172-4/+2
| | | | | | | | | | | | | Changes the base instance for ERR_INVALID_CURSOR_POS from Error to TypeError as a more accurate representation of the error. PR-URL: https://github.com/nodejs/node/pull/19960 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* test: fix http-agent-destroyed-socket cb not firingAnatoli Papirovski2018-04-171-15/+2
| | | | | | | | | | | | | | | A whole part of the test-http-agent-destroyed-socket test was not running as the semantics of http events changed slightly and were no longer triggering the expected event. Instead listen to the same event on the socket to verify that the code being tested is still working as expected. PR-URL: https://github.com/nodejs/node/pull/20006 Fixes: https://github.com/nodejs/node/issues/8613 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* doc: prevent one more false-positive linkificationVse Mozhet Byt2018-04-171-4/+4
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/20087 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
* doc: fix suspicious heading emphasis in n-api.mdVse Mozhet Byt2018-04-171-2/+2
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/20086 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
* deps: patch V8 to 6.6.346.24Myles Borins2018-04-163-2/+16
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/19995 Refs: https://github.com/v8/v8/compare/6.6.346.23...6.6.346.24 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* doc: add ryzokuken to collaboratorsUjjwal Sharma2018-04-161-0/+2
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/20081 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
* http2: refactor how trailers are doneJames M Snell2018-04-1617-285/+329
| | | | | | | | | | | | | | | | | | | | | | | | Rather than an option, introduce a method and an event... ```js server.on('stream', (stream) => { stream.respond(undefined, { waitForTrailers: true }); stream.on('wantTrailers', () => { stream.sendTrailers({ abc: 'xyz'}); }); stream.end('hello world'); }); ``` This is a breaking change in the API such that the prior `options.getTrailers` is no longer supported at all. Ordinarily this would be semver-major and require a deprecation but the http2 stuff is still experimental. PR-URL: https://github.com/nodejs/node/pull/19959 Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* doc: fix two sorting nits in fs.mdVse Mozhet Byt2018-04-161-14/+14
| | | | | | PR-URL: https://github.com/nodejs/node/pull/20078 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* doc: add tools/doc/README link in doc/STYLE_GUIDEVse Mozhet Byt2018-04-161-0/+3
| | | | | | PR-URL: https://github.com/nodejs/node/pull/20071 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* util: fix inspect performance bugRuben Bridgewater2018-04-161-5/+5
| | | | | | | | | | | | | | In case an object contained a circular reference `Object.keys` was called even though it was not necessary at all. This caused a significant overhead for objects that contained a lot of such entries. PR-URL: https://github.com/nodejs/node/pull/20007 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* errors: alter ERR_INVALID_PROTOCOLdavidmarkclements2018-04-162-4/+4
| | | | | | | | | | | | | Changes the base instance for ERR_INVALID_PROTOCOL from Error to TypeError as a more accurate representation of the error. PR-URL: https://github.com/nodejs/node/pull/19983 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
* stream: add pipeline and finishedMathias Buus2018-04-169-0/+917
| | | | | | PR-URL: https://github.com/nodejs/node/pull/19828 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* fs: add 'close' event to FSWatcherAlec Larson2018-04-163-0/+13
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/19900 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* doc: unify and compact some fragments in fs.mdVse Mozhet Byt2018-04-162-51/+25
| | | | | | PR-URL: https://github.com/nodejs/node/pull/20050 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* doc: update tools/doc/README.mdVse Mozhet Byt2018-04-161-5/+8
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/20047 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
* doc: unify more headingsVse Mozhet Byt2018-04-163-22/+25
| | | | | | PR-URL: https://github.com/nodejs/node/pull/20046 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* http: relax requirements on upgrade listenerAnatoli Papirovski2018-04-167-40/+43
| | | | | | | | | | | | | | | | The http spec does not say anything about Upgrade headers making protocol switch mandatory but Node.js implements them as if they are. Relax the requirements to only destroy the socket if no upgrade listener exists on the client when status code is 101. PR-URL: https://github.com/nodejs/node/pull/19981 Fixes: https://github.com/nodejs/node/issues/11552 Refs: https://tools.ietf.org/html/rfc7230#section-6.7 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* doc: clarify url docJames M Snell2018-04-161-1/+29
| | | | | | | | | | Indicate that `base` is ignored if `input` is absolute. PR-URL: https://github.com/nodejs/node/pull/19899 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* errors: alter ERR_INVALID_DOMAIN_NAMEdavidmarkclements2018-04-162-4/+5
| | | | | | | | | | | | Changes the base instance for ERR_INVALID_DOMAIN_NAME from Error to TypeError as a more accurate representation of the error. PR-URL: https://github.com/nodejs/node/pull/19961 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* timers: fix clearInterval to work with timers from setTimeoutRémi Berson2018-04-163-8/+25
| | | | | | | | | | | | | | | | According to HTML Living Standard, "either method [clearInterval or clearTimeout] can be used to clear timers created by setTimeout() or setInterval().". The current implementation of clearTimeout is already able to destroy a timer created by setInterval, but not the other way around. PR-URL: https://github.com/nodejs/node/pull/19952 Refs: https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
* deps: c-ares float, win ipv6 bad fec0 prefixRod Vagg2018-04-161-0/+5
| | | | | | | | | | | | | | | | | | | Was 72c5458aee: PR-URL: https://github.com/nodejs/node/pull/5090 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reimplemented for c-ares 1.13.0 PR-URL: https://github.com/nodejs/node/pull/15378 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/19939 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* deps: c-ares float, manual ares_ssize_t definitionRod Vagg2018-04-161-5/+7
| | | | | | | | | | | | | | | | | | | | | | c-ares switched to using ares_ssize_t for platform-independent ssize_t, our GYP usage to include config/<platform>/ares_config.h causes problems when including gyp as a library in core, i.e. in env.h and cares_wrap.h, where the defines don't get pulled in properly. This, so far, is the easiest approach to just making it work nicely--explicitly defining ares_ssize_t for the different Windows variants and ssize_t for non-Windows where we don't have a configured type from an ares_config.h. In all of our non-Windows platforms it is ssize_t anyway so this is safe. PR-URL: https://github.com/nodejs/node/pull/15378 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: https://github.com/nodejs/node/pull/19939 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* deps: upgrade to c-ares v1.14.0Rod Vagg2018-04-1615-165/+653
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix patch for CVE-2017-1000381 to not be overly aggressive. * win32: Preserve DNS server order returned by Windows when sorting and exclude DNS servers in legacy subnets. * win32: Support most recent Visual Studio 2017. * gethostbyaddr should fail with ECANCELLED not ENOTFOUND when ares_cancel is called. * win32: Exclude legacy ipv6 subnets. * android: Applications compiled for Oreo can no longer use __system_property_get and must use Java calls to retrieve DNS servers. * win32: Force use of ANSI functions. * CMake minimum version is now 3.1. * ares_gethostbyname.3: fix callback status values. * docs: Document WSAStartup requirement. * Fix a typo in init_by_resolv_conf. * Android JNI code leaks local references in some cases. * Force using the ANSI versions of WinAPI functions. The most important changes have already been included via * 50e580df21 deps: cherry-pick 0ef4a0c64b6 from c-ares upstream * 9a0631dffe deps: cherry-pick 18ea996 from c-ares upstream PR-URL: https://github.com/nodejs/node/pull/19939 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* build: remove implied support for win 2012 not R2Beth Griggs2018-04-161-1/+1
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/19378 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* doc: improve assert documentationRuben Bridgewater2018-04-161-11/+32
| | | | | | | | | | | | This adds a example to `assert.throws` to document checking against error instances. It also makes it clearer what some arguments can receive as input. PR-URL: https://github.com/nodejs/node/pull/19885 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* tools: add eslintrc rule for `assert.rejects`Ruben Bridgewater2018-04-163-3/+9
| | | | | | | | | | | | This makes sure `assert.rejects` is always called with a second argument. Besides that it is also changes a eslint error message to suggest objects instead of a regular expression. PR-URL: https://github.com/nodejs/node/pull/19885 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>