summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-04-08util: use V8 C++ API for inspecting PromisesTimothy Gu
PR-URL: https://github.com/nodejs/node/pull/12254 Refs: https://github.com/nodejs/node/issues/11875 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Josh Gavant <josh.gavant@outlook.com>
2017-04-08napi: initialize and check status properlyGabriel Schulhof
Initialize status to napi_generic_failure and only check it after having made an actual N-API call. This fixes up 8fbace163afbd61b5efc57cf94414be904bf0188. PR-URL: https://github.com/nodejs/node/pull/12283 Ref: https://github.com/nodejs/node/pull/12279 Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-04-07n-api: cache Symbol.hasInstanceGabriel Schulhof
This improves the performance of napi_instanceof() by retrieving Symbol.hasInstance from the global object once and then storing a persistent reference to it in the env. PR-URL: https://github.com/nodejs/node/pull/12246 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-04-07n-api: Update property attrs enum to match JS specJason Ginchereau
The napi_property_attributes enum used names and values from v8::PropertyAttribute, but those negative flag names were outdated along with the default behavior of a property being writable, enumerable, and configurable unless otherwise specified. To match the ES5 standard property descriptor those attributes should be positive flags and should default to false unless otherwise specified. PR-URL: https://github.com/nodejs/node/pull/12240 Fixes: https://github.com/nodejs/abi-stable-node/issues/221 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-04-06debug: activate inspector with _debugProcessEugene Ostroukhov
This pull request switches the signal handler to start inspector socket server instead of the legacy V8 debug protocol. PR-URL: https://github.com/nodejs/node/pull/11431 Fixes: https://github.com/nodejs/node/issues/8464 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-04-06src: remove support for --debugJan Krems
In the 2017-04-05 meeting, the CTC agreed to remove support for the legacy debugger in 8.0.0. This is the first step in this direction. Refs: https://github.com/nodejs/CTC/issues/94 PR-URL: https://github.com/nodejs/node/pull/12197 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2017-04-05src: Update trace event macros to V8 5.7 versionMatt Loring
src/tracing/trace_event.h was updated by applying the following changes: 1) Include src/tracing/trace_event_common.h instead of the one from v8 base. 2) Replace all instances of base::Atomic with intptr_t (trace events can only be generated from the main thread for now). 3) Replace instances of V8_INLINE with inline. 4) Eliminate uses of DCHECK. 5) Eliminate uses of V8_UNLIKELY, the branch predictor should be good enough alone. 6) Change the namespace used by trace_event.h from v8::internal::tracing to node::tracing. 7) Remove CallStatsScopedTracer class and related macros (they rely on V8 implementation details). 8) Change ConvertableToTraceFormat to v8::ConvertableToTraceFormat. 9) Add function "static void SetCurrentPlatform(v8::Platform* platform);" to the declaration of TraceEventHelper. PR-URL: https://github.com/nodejs/node/pull/12127 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2017-04-05n-api: create napi_env as a real structureGabriel Schulhof
1. We define struct napi_env__ to include the isolate, the last exception, and the info about the last error. 2. We instantiate one struct napi_env__ during module registration and we pass it into the FunctionCallbackInfo for all subsequent entries into N-API when we create functions/accessors/finalizers. Once module unloading will be supported we shall have to delete the napi_env we create during module init. There is a clear separation between public and private API wrt. env: 1. Public APIs assert that env is not nullptr as their first action. 2. Private APIs need not validate env. They assume it's not nullptr. PR-URL: https://github.com/nodejs/node/pull/12195 Fixes: https://github.com/nodejs/abi-stable-node/issues/198 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-04-05napi: supress invalid coverity leak messageMichael Dawson
Coverity was complaining that finalizer was being leaked in this method, however it should be freed when the buffer is finalized so I believe the message is invalid. Add the required comments to suppress the warning. PR-URL: https://github.com/nodejs/node/pull/12192 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
2017-04-05n-api: break dep between v8 and napi attributesMichael Dawson
The v8 n-api implementation had been depending on a one-to-one relationship between v8 and n-api v8 property attributes. Remove this dependency and fix coverity scan issue 165845. PR-URL: https://github.com/nodejs/node/pull/12191 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-04-04buffer: optimize decoding wrapped base64 dataAlexey Orlenko
The fast base64 decoder used to switch to the slow one permanently when it saw a whitespace or other garbage character. Since the most common situation such characters may be encountered in is line-wrapped base64 data, a more profitable strategy is to decode a single 24-bit group with the slow decoder and then continue running the fast algorithm. PR-URL: https://github.com/nodejs/node/pull/12146 Ref: https://github.com/nodejs/node/issues/12114 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-04doc, inspector: note that the host is optionalGibson Fahnestock
Document that `node --inspect=${port}` is also a viable option. PR-URL: https://github.com/nodejs/node/pull/12149 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-03src: throw when -c and -e are used simultaneouslyTeddy Katz
The -c flag ("check script syntax") and -e flag ("evaluate given code") have contradictory meanings. Make them mutually exclusive by throwing when both of them are provided. Fixes: https://github.com/nodejs/node/issues/11680 PR-URL: https://github.com/nodejs/node/pull/11689 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-04-03url: change path parsing for non-special URLsDaijiro Wachi
This changes to the way path parsing for non-special URLs. It allows paths to be empty for non-special URLs and also takes that into account when serializing. Fixes: https://github.com/nodejs/node/issues/11962 Refs: https://github.com/whatwg/url/pull/213 PR-URL: https://github.com/nodejs/node/pull/12058 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-04-03n-api: add support for abi stable module APIJason Ginchereau
Add support for abi stable module API (N-API) as "Experimental feature". The goal of this API is to provide a stable Node API for native module developers. N-API aims to provide ABI compatibility guarantees across different Node versions and also across different Node VMs - allowing N-API enabled native modules to just work across different versions and flavors of Node.js without recompilation. A more detailed introduction is provided in: https://github.com/nodejs/node-eps/blob/master/005-ABI-Stable-Module-API.md and https://github.com/nodejs/abi-stable-node/blob/doc/VM%20Summit.pdf. The feature, during its experimental state, will be guarded by a runtime flag "--napi-modules". Only when this flag is added to the command line will N-API modules along with regular non N-API modules be supported. The API is defined by the methods in "src/node_api.h" and "src/node_api_types.h". This is the best starting point to review the API surface. More documentation will follow. In addition to the implementation of the API using V8, which is included in this PR, the API has also been validated against chakracore and that port is available in https://github.com/nodejs/abi-stable-node/tree/api-prototype-chakracore-8.x. The current plan is to provide N-API support in versions 8.X and 6.X directly. For older versions, such as 4.X or pre N-API versions of 6.X, we plan to create an external npm module to provide a migration path that will allow modules targeting older Node.js versions to use the API, albeit without getting the advantage of not having to recompile. In addition, we also plan an external npm package with C++ sugar to simplify the use of the API. The sugar will be in-line only and will only use the exported N-API methods but is not part of the N-API itself. The current version is in: https://github.com/nodejs/node-api. This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the api-prototype-8.x branch with the following contributors in alphabetical order: Author: Arunesh Chandra <arunesh.chandra@microsoft.com> Author: Gabriel Schulhof <gabriel.schulhof@intel.com> Author: Hitesh Kanwathirtha <hiteshk@microsoft.com> Author: Ian Halliday <ianhall@microsoft.com> Author: Jason Ginchereau <jasongin@microsoft.com> Author: Michael Dawson <michael_dawson@ca.ibm.com> Author: Sampson Gao <sampsong@ca.ibm.com> Author: Taylor Woll <taylor.woll@microsoft.com> PR-URL: https://github.com/nodejs/node/pull/11975 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-03util: show External values explicitly in inspectAnna Henningsen
Display `v8::External` values as `[External]` rather than `{}` which makes them look like objects. PR-URL: https://github.com/nodejs/node/pull/12151 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-04-01crypto: add sign/verify support for RSASSA-PSSTobias Nießen
Adds support for the PSS padding scheme. Until now, the sign/verify functions used the old EVP_Sign*/EVP_Verify* OpenSSL API, making it impossible to change the padding scheme. Fixed by first computing the message digest and then signing/verifying with a custom EVP_PKEY_CTX, allowing us to specify options such as the padding scheme and the PSS salt length. Fixes: https://github.com/nodejs/node/issues/1127 PR-URL: https://github.com/nodejs/node/pull/11705 Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-31vm: use SetterCallback to set func declarationsAnnaMag
Currently, when in strict mode, function declarations are copied on the sandbox by CopyProperties(), which is not necessary and will break when CP is removed. This change maintains current behavior, letting GlobalPropertySetterCallback copy functions on the sandbox instead of using CP to do the task. PR-URL: https://github.com/nodejs/node/pull/12051 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@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-03-31src: fix base64 decodingNikolai Vavilov
Make sure trailing garbage is not treated as a valid base64 character. Fixes: https://github.com/nodejs/node/issues/11987 PR-URL: https://github.com/nodejs/node/pull/11995 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-31src: add .FromJust(), fix -Wunused-result warningsBen Noordhuis
Missed while reviewing 1fde98b ("v8: expose new V8 serialization API.") PR-URL: https://github.com/nodejs/node/pull/12118 Refs: https://github.com/nodejs/node/pull/11048 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-03-31src: add --use-bundled-ca --use-openssl-ca checkDaniel Bevenius
The --use-bundled-ca and --use-openssl-ca command line arguments are mutually exclusive but can both be used on the same command line. This commit adds a check if both options are used. Fixes: https://github.com/nodejs/node/issues/12083 PR-URL: https://github.com/nodejs/node/pull/12087 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-03-30inspector: use inspector API for "break on start"Eugene Ostroukhov
This change removes a need for using deprecated debug context for breaking at the start of the main module. PR-URL: https://github.com/nodejs/node/pull/12076 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-03-29src: WHATWG URL C++ parser cleanupTimothy Gu
- Clarify port state - Remove scheme flag - Clarify URL_FLAG_TERMINATED PR-URL: https://github.com/nodejs/node/pull/11917 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-03-29url: add ToObject method to native URL classJames M Snell
Provides a factory method to convert a native URL class into a JS URL object. ```c++ Environment* env = ... URL url("http://example.org/a/b/c?query#fragment"); MaybeLocal<Value> val = url.ToObject(env); ``` PR-URL: https://github.com/nodejs/node/pull/12056 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-29v8: expose new V8 serialization APIAnna Henningsen
Expose the new serialization API that was added in V8 5.5 to userland. The JS API is virtually a direct copy of what V8 provides on the C++ level. This is useful Node as a possible replacement for some internals that currently use JSON, like IPC, but is likely to be useful to general userland code as well. PR-URL: https://github.com/nodejs/node/pull/11048 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-03-28buffer: remove error for malformatted hex stringRich Trott
Remove error message when a hex string of an incorrect length is sent to .write() or .fill(). PR-URL: https://github.com/nodejs/node/pull/12012 Fixes: https://github.com/nodejs/node/issues/3770 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-03-29crypto: fix memory leak if certificate is revokedTom Atkinson
The additional validity checks applied to StartCom and WoSign certificates failed to free memory before returning. Refs: https://github.com/nodejs/node/pull/9469 Fixes: https://github.com/nodejs/node/issues/12033 PR-URL: https://github.com/nodejs/node/pull/12089 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-03-27test: add cctest for native URL classJames M Snell
PR-URL: https://github.com/nodejs/node/pull/12042 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-03-27Partial revert "tls: keep track of stream that is closed"Trevor Norris
This partually reverts commit 4cdb0e89d8daf7e1371c3b8d3f057940aa327d4a. A nullptr check in TSLWrap::IsAlive() and the added test were left. PR-URL: https://github.com/nodejs/node/pull/11947 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-27stream_base,tls_wrap: notify on destructTrevor Norris
The TLSWrap constructor is passed a StreamBase* which it stores as TLSWrap::stream_, and is used to receive/send data along the pipeline (e.g. tls -> tcp). Problem is the lifetime of the instance that stream_ points to is independent of the lifetime of the TLSWrap instance. So it's possible for stream_ to be delete'd while the TLSWrap instance is still alive, allowing potential access to a then invalid pointer. Fix by having the StreamBase destructor null out TLSWrap::stream_; allowing all TLSWrap methods that rely on stream_ to do a check to see if it's available. While the test provided is fixed by this commit, it was also previously fixed by 478fabf. Regardless, leave the test in for better testing. PR-URL: https://github.com/nodejs/node/pull/11947 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-25src: update inspector code to match upstream APIMichaël Zasso
PR-URL: https://github.com/nodejs/node/pull/11752 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2017-03-25src: update NODE_MODULE_VERSION to 54Michaël Zasso
Major V8 updates are usually API/ABI incompatible with previous versions. This commit adapts NODE_MODULE_VERSION for V8 5.7. Refs: https://github.com/nodejs/CTC/blob/master/meetings/2016-09-28.md PR-URL: https://github.com/nodejs/node/pull/11752 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2017-03-23url: show input in parse error messageJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/11934 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2017-03-22lib,src: make constants not inherit from ObjectSakthipriyan Vairamani (thefourtheye)
Make sure `constants` object and all the nested objects don't inherit from `Object.prototype` but from `null`. PR-URL: https://github.com/nodejs/node/pull/10458 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
2017-03-22tls: fix SecurePair external memory reportingBen Noordhuis
Ensure that AdjustAmountOfExternalAllocatedMemory() is called when the SecurePair is destroyed. Not doing so is not an actual memory leak but it makes `process.memoryUsage().external` wildly inaccurate and can cause performance problems due to excessive garbage collection. PR-URL: https://github.com/nodejs/node/pull/11896 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-22src: exclude node_root_certs when use-def-ca-storeDaniel Bevenius
When configuring node with --openssl-use-def-ca-store the root certs from OpenSSL should be used and not the ones in src/node_root_certs.h. I noticed that src/node_root_certs.h is still included even when using --openssl-use-def-ca-store. This commit adds check and does not include node_root_certs.h if --openssl-use-def-ca-store is specified. PR-URL: https://github.com/nodejs/node/pull/11939 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-03-22src: use persistent strings from node::EnvironmentBen Noordhuis
Replace a few calls to FIXED_ONE_BYTE_STRING() with their persistent counterparts from `node::Environment`. None of the calls are in hot code paths but why create a new string when one already exists? PR-URL: https://github.com/nodejs/node/pull/11945 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
2017-03-22src: add native URL classJames M Snell
Adds a URL native class for use within the node.js c/c++ code. This is primarily intended to be used by the eventual ES6 modules implementation but can be used generally wherever URL parsing within the c/c++ may be necessary. ```c URL url1("http://example.org"); URL url2("foo", "http://example.org/bar"); URL url3("baz", &url2); ``` While we're at it, reduce reliance on macros to simplify impl. PR-URL: https://github.com/nodejs/node/pull/11801 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-21src, buffer: do not segfault on out-of-range indexTimothy Gu
Also add test cases for partial writes and invalid indices. PR-URL: https://github.com/nodejs/node/pull/11927 Fixes: https://github.com/nodejs/node/issues/8724 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-21src: make PercentDecode return voidTimothy Gu
It only returns 0, nor is it likely to have any error conditions in the future. PR-URL: https://github.com/nodejs/node/pull/11922 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-20src: ensure that fd 0-2 are valid on windowsBartosz Sosnowski
Check that stdin, stdout and stderr are valid file descriptors on Windows. If not, reopen them with 'nul' file. Refs: https://github.com/nodejs/node/pull/875 Fixes: https://github.com/nodejs/node/issues/11656 PR-URL: https://github.com/nodejs/node/pull/11863 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-03-20tls: fix segfault on destroy after partial readBen Noordhuis
OnRead() calls into JS land which can result in the SSL context object being destroyed on return. Check that `ssl_ != nullptr` afterwards. Fixes: https://github.com/nodejs/node/issues/11885 PR-URL: https://github.com/nodejs/node/pull/11898 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-16src: remove explicit UTF-8 validity check in urlTimothy Gu
This step was never part of the URL Standard's host parser algorithm, and is rendered unnecessary after IDNA errors are no longer ignored. PR-URL: https://github.com/nodejs/node/pull/11859 Refs: c2a302c50b3787666339371 "src: do not ignore IDNA conversion error" Refs: https://url.spec.whatwg.org/#concept-host-parser Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-03-16tls: keep track of stream that is closedjBarz
TLSWrap object keeps a pointer reference to the underlying TCPWrap object. This TCPWrap object could be closed and deleted by the event-loop which leaves us with a dangling pointer. So the TLSWrap object needs to track the "close" event on the TCPWrap object. PR-URL: https://github.com/nodejs/node/pull/11776 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
2017-03-14fs: include more fs.stat*() optimizationsBrian White
Including: * Move async *stat() functions to FillStatsArray() now used by the sync *stat() functions * Avoid creating fs.Stats instances for implicit async/sync *stat() calls used in various fs functions * Store reference to Float64Array data on C++ side for easier/faster access, instead of passing from JS to C++ on every async/sync *stat() call PR-URL: https://github.com/nodejs/node/pull/11665 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-03-13inspector: proper WS URLs when bound to 0.0.0.0Eugene Ostroukhov
JSON target list response will now return appropriate IP address for instances listening on 0.0.0.0. Refs: https://github.com/nodejs/node/issues/11591 PR-URL: https://github.com/nodejs/node/pull/11755 Reviewed-By: James Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-03-10meta: restore original copyright headerJames M Snell
A prior io.js era commit inappropriately removed the original copyright statements from the source. This restores those in any files still remaining from that edit. Ref: https://github.com/nodejs/TSC/issues/174 Ref: https://github.com/nodejs/node/pull/10599 PR-URL: https://github.com/nodejs/node/pull/10155 Note: This PR was required, reviewed-by and approved by the Node.js Foundation Legal Committee and the TSC. There is no `Approved-By:` meta data.
2017-03-10src: fix typos in node_lttng_provider.hBenjamin Fleischer
Is a semver-breaking change Refs: https://github.com/nodejs/node/pull/11189#discussion_r99509433 PR-URL: https://github.com/nodejs/node/pull/11723 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-03-09src: make process.env work with symbols in/deleteTimothy Gu
The getter for process.env already allows symbols to be used, and `in` operator as a read-only operator can do the same. `delete a[b]` operator in ES always returns `true` without doing anything when `b in a === false`. Allow symbols in the deleter accordingly. PR-URL: https://github.com/nodejs/node/pull/11709 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-03-09src: add missing #include <unicode/ustring.h>Steven R. Loomis
* We use these functions that are declared in <unicode/ustring.h> u_strFromUTF8() u_strToUTF8() * At present, <unicode/ustring.h> is indirectly included, but this will likely change in future ICUs. Adding this header has been the right thing to do for many years, so it is backwards compatible. Fixes: https://github.com/nodejs/node/issues/11753 PR-URL: https://github.com/nodejs/node/issues/11754 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>