summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-05-05inspector: report when main context is destroyedEugene Ostroukhov
PR-URL: https://github.com/nodejs/node/pull/12814 Reimplements: https://github.com/nodejs/node/pull/7756 Fixes: https://github.com/nodejs/node/issues/7742 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
2017-05-04url: handle windows drive letter in the file stateDaijiro Wachi
`C|` should not satisfy the condition to not copy the base's path. It also synchronises WPT url test data to verify the update in upstream. PR-URL: https://github.com/nodejs/node/pull/12808 Refs: https://github.com/whatwg/url/pull/305 Refs: https://github.com/w3c/web-platform-tests/pull/5754 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-05-04inspector: do not add 'inspector' propertyEugene Ostroukhov
'inspector' property is not an official API and should not be published on process object, where the user may discover it. This change was extracted from https://github.com/nodejs/node/pull/12263 that will be focused on creating JS bindings. PR-URL: https://github.com/nodejs/node/pull/12656 Reviewed-By: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-05-04src: update --inspect hint textJosh Gavant
* Removes "experimental" warning. * Prints ws://_ip_:_port_:/_uuid_ for all IDs. * Refers to nodejs.org guide for more details. PR-URL: https://github.com/nodejs/node/pull/11207 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <mhdawson@ibm.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2017-05-04src: make root_cert_vector function scopedDaniel Bevenius
root_cert_vector currently has file scope and external linkage, but is only used in the NewRootCertsStore function. If this is not required to be externally linked perhaps it can be changed to be static and function scoped instead. PR-URL: https://github.com/nodejs/node/pull/12788 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
2017-05-04src: rename CryptoPemCallback -> PasswordCallbackDaniel Bevenius
While reading through node_crypto.cc I think the code could perhaps be be a made a little clearer if CryptPemCallback was renamed. I admit that I'm very new to the code base and openssl but having a name like PasswordCallback or something similar would have helped me so I'm suggesting this change. PR-URL: https://github.com/nodejs/node/pull/12787 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-05-03src: do proper StringBytes error handlingAnna Henningsen
- Return `MaybeLocal`s from `StringBytes::Encode` - Add an `error` out parameter to pass JS exceptions to the callers (instead of directly throwing) - Simplify some of the string generation methods in `string_bytes.cc` by unifying the `EXTERN_APEX` logic - Reduce usage of deprecated V8 APIs. - Remove error handling logic from JS, the `buffer.*Slice()` methods now throw errors themselves. - Left TODO comments for future semver-major error message improvements. This paves the way for better error messages coming out of the StringBytes methods. Ref: https://github.com/nodejs/node/issues/3175 PR-URL: https://github.com/nodejs/node/pull/12765 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-05-03crypto: throw proper errors if out enc is UTF-16Anna Henningsen
Throw `Error`s instead of hard crashing when the `.digest()` output encoding is UTF-16. Fixes: https://github.com/nodejs/node/issues/9817 PR-URL: https://github.com/nodejs/node/pull/12752 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-03src: turn buffer type-CHECK into exceptionAnna Henningsen
Turn a `CHECK()` that could be brought to fail using public APIs into throwing an error. Fixes: https://github.com/nodejs/node/issues/12152 PR-URL: https://github.com/nodejs/node/pull/12753 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-05-03src: add --napi-modules to whitelistMichael Dawson
Add --napi-modules to whitelist for NODE_OPTIONS as its needed so that we can run the tests that come along with native modules. PR-URL: https://github.com/nodejs/node/pull/12733 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-05-03node: add missing option to --help outputRuslan Bekenev
PR-URL: https://github.com/nodejs/node/pull/12763 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-05-03n-api: remove unnecessary try-catch bracket from certain APIsGabriel Schulhof
These APIs do not need a try-catch around their body, because no exceptions are thrown in their implementation: - `napi_is_array()` - `napi_get_value_string_latin1()` - `napi_get_value_string_utf8()` - `napi_get_value_string_utf16()` - `napi_get_value_external()` - `napi_is_buffer()` - `napi_is_arraybuffer()` - `napi_get_arraybuffer_info()` - `napi_is_typedarray()` - `napi_get_typedarray_info()` Fixes: https://github.com/nodejs/abi-stable-node/issues/238 PR-URL: https://github.com/nodejs/node/pull/12705 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-05-02buffer: remove pointless C++ utility methodsAnna Henningsen
PR-URL: https://github.com/nodejs/node/pull/12760 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-05-01src: support domains with empty labelsDaijiro Wachi
Follow the spec of domainToASCII/domainToUnicode in whatwg, and synchronise WPT url test data. Refs: https://github.com/w3c/web-platform-tests/pull/5397 PR-URL: https://github.com/nodejs/node/pull/12707 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-04-29src: remove debugger dead codeMichaël Zasso
PR-URL: https://github.com/nodejs/node/pull/12621 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-04-28n-api: Sync with back-compat changesJason Ginchereau
Background: To enable N-API support for node versions back to v4, the N-API code can also be built as an external addon. To make maintenance easier, a single codebase needs to support both built-in and external scenarios, along with Node versions >= 4 (and corresponding V8 versions). This change includes several minor fixes to avoid using node internal APIs and support older V8 versions: - Expand node::arraysize - In the CHECK_ENV() macro, return an error code instead of calling node::FatalError(). This is more consistent with how other invalid arguments to N-API functions are handled. - In v8impl::SetterCallbackWrapper::SetReturnValue(), do nothing instead of calling node::FatalError(). This is more consistent with JavaScript setter callbacks, where any returned value is silently ignored. - When queueing async work items, get the uv default loop instead of getting the loop from node::Environment::GetCurrent(). Currently that returns the same loop anyway. If/when node supports multiple environments, it should have a public API for getting the environment & event loop, and we can update this implementation then. - Use v8::Maybe::FromJust() instead of the newer alias ToChecked() PR-URL: https://github.com/nodejs/node/pull/12674 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-04-27n-api: Reference and external testsJason Ginchereau
- Add a test project to addons-napi that covers the N-API reference and external APIs - Fix a bug in napi_typeof that was found by the new tests PR-URL: https://github.com/nodejs/node/pull/12551 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-04-27src: fix incorrect macro commentDaniel Bevenius
Commit de168b4b4a4a8b8bd765a99bfa735d51f2650961 ("src: guard bundled_ca/openssl_ca with HAVE_OPENSSL") included an incorrect end macro comment which this commit fixes. PR-URL: https://github.com/nodejs/node/pull/12688 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-27domain: support promisesAnna Henningsen
Fixes: https://github.com/nodejs/node/issues/10724 PR-URL: https://github.com/nodejs/node/pull/12489 Reviewed-By: Matthew Loring <mattloring@google.com> Reviewed-By: Julien Gilli <jgilli@nodejs.org> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-04-27src: expose `node::AddPromiseHook`Anna Henningsen
Expose `node::AddPromiseHook`, which wraps V8’s `SetPromiseHook` in a way that allows multiple hooks to be set up. PR-URL: https://github.com/nodejs/node/pull/12489 Reviewed-By: Matthew Loring <mattloring@google.com> Reviewed-By: Julien Gilli <jgilli@nodejs.org> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-27src: remove GTEST_DONT_DEFINE_ASSERT_EQ in util.hDaniel Bevenius
As indicated by the FIXME comment, this macro guard is no longer needed. PR-URL: https://github.com/nodejs/node/pull/12638 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-04-25n-api: Enable scope and ref APIs during exceptionJason Ginchereau
N-API is somewhat strict about blocking calls to many APIs while there is a pending exception. The NAPI_PREAMBLE macro at the beginning of many API implementations checks for a pending exception. However, a subset of the APIs (which don't call back into JavaScript) still need to work while in a pending-exception state. This changes the reference APIs (equivalent to v8::Persistent) and handle scope APIs so that they can be used for cleanup up while an exception is pending. We may decide to similarly enable a few other APIs later, (which would be a non-breaking change) but we know at least these are needed now to unblock some specific scenarios. Fixes: https://github.com/nodejs/abi-stable-node/issues/122 Fixes: https://github.com/nodejs/abi-stable-node/issues/228 PR-URL: https://github.com/nodejs/node/pull/12524 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
2017-04-25src: remove invalid commentcjihrig
PR-URL: https://github.com/nodejs/node/pull/12645 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2017-04-25n-api: tighten null-checking and clean up last errorGabriel Schulhof
We left out null-checks for many of the parameters passed to our APIs. In particular, arguments of type `napi_value` were often accepted without a null-check, even though they should never be null. Additionally, many APIs simply returned `napi_ok` on success. This leaves in place an error that may have occurred in a previous N-API call. Others (those which perform `NAPI_PREAMBLE(env)` at the top) OTOH explicitly clear the last error before proceeding. With this modification all APIs explicitly clear the last error on success. Fixes: https://github.com/nodejs/abi-stable-node/issues/227 PR-URL: https://github.com/nodejs/node/pull/12539 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-04-25src: allow CLI args in env with NODE_OPTIONSSam Roberts
Not all CLI options are supported, those that are problematic from a security or implementation point of view are disallowed, as are ones that are inappropriate (for example, -e, -p, --i), or that only make sense when changed with code changes (such as options that change the javascript syntax or add new APIs). PR-URL: https://github.com/nodejs/node/pull/12028 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2017-04-25src: expose V8's IsNativeError() in util bindingscjihrig
Refs: https://github.com/nodejs/node/pull/12400 PR-URL: https://github.com/nodejs/node/pull/12546 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-24url: update WHATWG URL API to latest specTimothy Gu
- Update to spec - Add opaque hosts - File state did not correctly deal with lack of base URL - Cleanup API for file and non-special URLs - Allow % and IPv6 addresses in non-special URL hosts - Use specific names for percent-encode sets - Add empty host concept for file and non-special URLs - Clarify IPv6 serializer - Fix existing mistakes - Add missing ':' to forbidden host code point list. - Correct IPv4 parser empty label behavior - Maintain type equivalence in URLContext with spec - scheme, username, and password should always be strings - host, port, query, and fragment may be strings or null - Align scheme state more closely with the spec - Make sure the `special` variable is always synced with URL_FLAG_SPECIAL. PR-URL: https://github.com/nodejs/node/pull/12523 Fixes: https://github.com/nodejs/node/issues/10608 Fixes: https://github.com/nodejs/node/issues/10634 Refs: https://github.com/whatwg/url/pull/185 Refs: https://github.com/whatwg/url/pull/225 Refs: https://github.com/whatwg/url/pull/224 Refs: https://github.com/whatwg/url/pull/218 Refs: https://github.com/whatwg/url/pull/243 Refs: https://github.com/whatwg/url/pull/260 Refs: https://github.com/whatwg/url/pull/268 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-04-24inspector: remove AgentImplEugene Ostroukhov
AgentImpl was introduce so inspector-agent.h does not leak libuv and inspector implementation details. Inspector had been reworked since and new classes provide this isolation and AgentImpl became unnecessary level of indirection. This change removes that class to streamline the code. PR-URL: https://github.com/nodejs/node/pull/12576 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-04-24src: remove extraneous dotMyles Borins
This got accidentally added when landing original commit PR-URL: https://github.com/nodejs/node/pull/12626 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com>
2017-04-24src: add fcntl.h include to node.ccBartosz Sosnowski
https://github.com/nodejs/node/pull/11863 adds _O_RDWR to node.cc which is defined in fcntl.h. This adds this include directly to node.cc. PR-URL: https://github.com/nodejs/node/pull/12540 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Myles Borins <myles.borins@gmail.com>
2017-04-24src: replace IsConstructCalls with lambdaDaniel Bevenius
I've added a deprecation notice as the functions are public, but not sure if this is correct or the format of the deprecation notice. PR-URL: https://github.com/nodejs/node/pull/12533 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-04-21src: remove TODO about uv errno removalDaniel Bevenius
This commit removes a TODO regarding the removal of uv errno. errno is currently used and cannot be removed so removing the comment to avoid any confusion. PR-URL: https://github.com/nodejs/node/pull/12536 Ref: https://github.com/nodejs/node/issues/4641 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-21lib,src,test: update --debug/debug-brk commentsBen Noordhuis
Overlooked in commit 47f8f74 ("src: remove support for --debug") from earlier this month. PR-URL: https://github.com/nodejs/node/pull/12495 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-20n-api: remove napi_get_value_string_length()Jason Ginchereau
This API doesn't serve much purpose, and is only likely to cause confusion and bugs. The intention was that this would return the number of characters in a string independent of encoding, but that's not generally useful. In almost all cases, one of the encoding-specific napi_get_value_string_* APIs is more correct. (Pass a null buffer if only the encoded length is desired.) Anyway the current implementation of napi_get_value_string_length() is technically wrong: it returns the number of 2-byte code units of the UTF-16 encoding, but there are actually some characters that are encoded as two UTF-16 code units. Note the JavaScript String.prototype.length property returns the number of UTF-16 code units, which may be different from the number of characters. So, getting the true character count is not common with JavaScript, and is probably best left to specialized internationalization libraries. PR-URL: https://github.com/nodejs/node/pull/12496 Fixes: https://github.com/nodejs/abi-stable-node/issues/226 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-19src: add missing "http_parser.h" includeAnna Henningsen
In 9d522225e7907b6cf631975b34f586984f698e33 the indirect "http_parser.h" include was removed, which made `NODE_STRINGIFY()` fail silently for the http parser version in `process.versions`. PR-URL: https://github.com/nodejs/node/pull/12464 Fixes: https://github.com/nodejs/node/issues/12463 Ref: https://github.com/nodejs/node/pull/12366 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
2017-04-19src: add --pending-deprecation and NODE_PENDING_DEPRECATIONJames M Snell
Command line flag and environment variable that can be used to indicate that pending deprecations should be emitted. PR-URL: https://github.com/nodejs/node/pull/11968 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-19src: don't call uv_run() after 'exit' eventBen Noordhuis
It makes timers and other libuv handles fire intermittently after the 'exit' event, contrary to what the documentation states. Regression introduced in commit aac79df ("src: use stack-allocated Environment instances") from June last year that made the `while (handle_cleanup_waiting_ != 0) uv_run(event_loop(), UV_RUN_ONCE)` loop run unconditionally on exit because it merged CleanupHandles() into the Environment destructor. This change breaks parallel/test-async-wrap-throw-from-callback because the async_wrap idle handle is no longer cleaned up, which I resolved pragmatically by removing the test. In all seriousness, it is being removed in the upcoming async_wrap revamp - it doesn't make sense to sink a lot of time in it now. Fixes: https://github.com/nodejs/node/issues/12322 PR-URL: https://github.com/nodejs/node/pull/12344 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-04-18crypto: remove unused C++ parameter in sign/verifyTobias Nießen
Removes code in node_crypto.cc in Sign::SignFinal and Verify::VerifyFinal which allowed to convert between buffers and strings based on given encodings. The code is unused as crypto.js only passes in and expects buffers and does the conversion itself. The encoding parameter was removed from both methods. PR-URL: https://github.com/nodejs/node/pull/12397 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-18crypto: update root certificatesBen Noordhuis
Update the list of root certificates in src/node_root_certs.h with tools/mk-ca-bundle.pl. Certificates added: - AC RAIZ FNMT-RCM - Amazon Root CA 1 - Amazon Root CA 2 - Amazon Root CA 3 - Amazon Root CA 4 - Certplus Root CA G1 - Certplus Root CA G2 - Hellenic Academic and Research Institutions ECC RootCA 2015 - Hellenic Academic and Research Institutions RootCA 2015 - ISRG Root X1 - LuxTrust Global Root 2 - OpenTrust Root CA G1 - OpenTrust Root CA G2 - OpenTrust Root CA G3 Certificates removed: - Buypass Class 2 CA 1 - EBG Elektronik Sertifika Hizmet Sağlayıcısı - IGC/A - Juur-SK - RSA Security 2048 v3 - Root CA Generalitat Valenciana PR-URL: https://github.com/nodejs/node/pull/12402 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
2017-04-17crypto: add randomFill and randomFillSyncEvan Lucas
crypto.randomFill and crypto.randomFillSync are similar to crypto.randomBytes, but allow passing in a buffer as the first argument. This allows us to reuse buffers to prevent having to create a new one on every call. PR-URL: https://github.com/nodejs/node/pull/10209 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-04-17src: clean up WHATWG WG parserTimothy Gu
* reduce indentation * refactor URL inlined methods * prefer templates over macros * do not export ARG_* flags in url binding PR-URL: https://github.com/nodejs/node/pull/12251 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-16zlib: remove unused declarationAnna Henningsen
Overlooked in https://github.com/nodejs/node/pull/12366. Removing this removes a compiler warning. PR-URL: https://github.com/nodejs/node/pull/12432 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-04-15src: replace IsConstructCall functions with lambdaDaniel Bevenius
I noticed that there are three static functions that only check if args is a construct call. This commit suggests replacing them and them with a lambda. PR-URL: https://github.com/nodejs/node/pull/12384 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-15Revert "src: exclude node_root_certs when use-def-ca-store"Daniel Bevenius
This reverts commit be98f2691736e10053b9826fce42b0ab50604da7. The above commit prevented the functionality of --use-bundled-ca if Node has been built using --openssl-use-def-ca-store, since there will be no bundled ca included and no way to use them. I only noticed this when trying to add // Flags: --use-bundled-ca to test-tls-ccnic-whitelist.js to force it to use the bundled ca and allow the test to pass. PR-URL: https://github.com/nodejs/node/pull/12391 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-14os,vm: fix segfaults and CHECK failureTobias Nießen
Fixes multiple possible segmentation faults in node_contextify.cc and an assertion failure in node_os.cc Fixes: https://github.com/nodejs/node/issues/12369 Fixes: https://github.com/nodejs/node/issues/12370 PR-URL: https://github.com/nodejs/node/pull/12371 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-04-14src: reduce number of exported symbolsAnna Henningsen
Use `static` definitions and anonymous namespaces to reduce the number of symbols that are exported from the `node` binary. PR-URL: https://github.com/nodejs/node/pull/12366 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-14buffer: optimize from() and byteLength()Brian White
PR-URL: https://github.com/nodejs/node/pull/12361 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-04-14n-api: fix coverity scan reportMichael Dawson
Coverity was reporting _request.work_req as not being initialized. Add memset to ensure all of _request is initialized. PR-URL: https://github.com/nodejs/node/pull/12365 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-04-14n-api: add string api for latin1 encodingSampson Gao
PR-URL: https://github.com/nodejs/node/pull/12368 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
2017-04-14url: disallow invalid IPv4 in IPv6 parserDaijiro Wachi
Fixes: https://github.com/nodejs/node/issues/10655 PR-URL: https://github.com/nodejs/node/pull/12315 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>