summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* src,test,tools: modify for more stringent lintingRich Trott2016-02-181-1/+1
| | | | | | | | | | | ESLint 2.1.0 is coming. Some lint rules have been tightened. PR-URL: https://github.com/nodejs/node/pull/5214 Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: jbergstroem - Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Myles Borins <myles.borins@gmail.com>
* src: remove unnecessary checkBrian White2016-02-151-1/+0
| | | | | | | | The value's type is unsigned so it will always be >= 0. PR-URL: https://github.com/nodejs/node/pull/5233 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
* node: set process._eventsCount to 0 on startupEvan Lucas2016-02-151-0/+1
| | | | | | | | | | | | process is an EventEmitter. There are operations that increment and decrement the _eventsCount property of an EventEmitter. process._eventsCount would previously get set to NaN. This change makes process._eventsCount be calculated as expected. PR-URL: https://github.com/nodejs/node/pull/5208 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* src: remove TryCatch in MakeCallbackTrevor Norris2016-02-123-41/+27
| | | | | | | | | | | | | After attempting to use ReThrow() and Reset() there were cases where firing the domain's error handlers was not happening. Or in some cases reentering MakeCallback would still cause the domain enter callback to abort (because the error had not been Reset yet). In order for the script to properly stop execution when a subsequent call to MakeCallback throws it must not be located within a TryCatch. PR-URL: https://github.com/nodejs/node/pull/4507 Reviewed-By: Fedor Indutny <fedor@indutny.com>
* src: remove unused TickInfo::in_tick()Trevor Norris2016-02-122-12/+1
| | | | | PR-URL: https://github.com/nodejs/node/pull/4507 Reviewed-By: Fedor Indutny <fedor@indutny.com>
* src: remove unused of TickInfo::last_threw()Trevor Norris2016-02-125-22/+9
| | | | | | | | | Environment::TickInfo::last_threw() is no longer in use. Also pass Isolate to few methods and fix whitespace alignment. PR-URL: https://github.com/nodejs/node/pull/4507 Reviewed-By: Fedor Indutny <fedor@indutny.com>
* src: add AsyncCallbackScopeTrevor Norris2016-02-127-17/+45
| | | | | | | | | | | Add a scope that will allow MakeCallback to know whether or not it's currently running. This will prevent nextTickQueue and the MicrotaskQueue from being processed recursively. It is also required to wrap the bootloading stage since it doesn't run within a MakeCallback. Ref: https://github.com/nodejs/node-v0.x-archive/issues/9245 PR-URL: https://github.com/nodejs/node/pull/4507 Reviewed-By: Fedor Indutny <fedor@indutny.com>
* src: fix MakeCallback error handlingTrevor Norris2016-02-122-16/+10
| | | | | | | | | | | | | | | Implementations of error handling between node::MakeCallback() and AsyncWrap::MakeCallback() do not return at the same point. Make both executions work the same by moving the early return if there's a caught exception just after the AsyncWrap post callback. Since the domain's call stack is cleared on a caught exception there is no reason to call its exit() callback. Remove the SetVerbose() statement in the AsyncWrap pre/post callback calls since it does not affect the callback call. PR-URL: https://github.com/nodejs/node/pull/4507 Reviewed-By: Fedor Indutny <fedor@indutny.com>
* crypto: have fixed NodeBIOs return EOFAdam Langley2016-02-113-20/+26
| | | | | | | | | | | | | | | | | | Prior to this change, the NodeBIO objects used to wrap fixed data had `num` equal to -1. This caused them to return -1 and set the retry flags when they ran out of data. Since the data is fixed, that's incorrect. Instead they should return zero to signal EOF. This change adds a new, static function, NodeBIO::NewFixed to create a BIO that wraps fixed data and which returns zero when exhausted. The practical impact of this is limited since most (all?) the parsing functions that these BIOs get passed to consider any return value less than one to be EOF and ignore the retry flags anyway. PR-URL: https://github.com/nodejs/node/pull/5105 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Fedor Indutny <fedor@indutny.com>
* buffer: add encoding parameter to fill()Trevor Norris2016-02-103-15/+114
| | | | | | | | | | | | | | | | | | | | | | | | | Can now call fill() using following parameters if value is a String: fill(string[, start[, end]][, encoding]) And with the following if value is a Buffer: fill(buffer[, start[, end]]) The encoding is ignored if value is not a String. All other non-Buffer values are coerced to a uint32. A multibyte strings will simply be copied into the Buffer until the number of bytes run out. Meaning partial strings can be left behind: Buffer(3).fill('\u0222'); // returns: <Buffer c8 a2 c8> In some encoding cases, such as 'hex', fill() will throw if the input string is not valid. PR-URL: https://github.com/nodejs/node/pull/4935 Reviewed-By: James M Snell <jasnell@gmail.com>
* src: deprecate undocumented variablesJackson Tian2016-02-101-2/+21
| | | | | | | | | | | | The `root` and `GLOBAL` were never documented. PR-URL: https://github.com/nodejs/node/pull/1838 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* src: avoid compiler warning in node_revert.ccJames M Snell2016-02-091-2/+2
| | | | | | | PR-URL: https://github.com/nodejs/node-private/pull/26 Reviewed-By: Rod Vagg <r@va.gg> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* src: add --security-revert command line flagJames M Snell2016-02-093-8/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `--security-revert={cvenum}` command line flag is a special purpose flag to be used only in stable or LTS branches when a breaking change is required to address a security vulnerability. Whenever a vulnerability requires a breaking change, and a CVE has been assigned, the flag can be used to force Node to revert to the insecure behavior that was implemented before the fix was applied. Note that this flag is intended to be used only as a last resort in the case a security update breaks existing code. When used, a security warning will be printed to stderr when Node launches. The `--security-revert={cvenum}` flag takes a single CVE number as an argument. Multiple instances of the `--security-revert={cvenum}` flag can be used on the command line to revert multiple changes. Whenever a new `--security-revert={cvenum}` is enabled, it should be documented in the release notes and in the API docs. Master and the first release of a new major (e.g. v6.0) should not have any reverts available. Every time a new `--security-revert={cvenum}` is added, there should be a semver-minor bump in the stable and LTS branch. PR-URL: https://github.com/nodejs/node-private/pull/26 Reviewed-By: Rod Vagg <r@va.gg> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* node: improve process.nextTick performanceRuben Bridgewater2016-02-091-95/+26
| | | | | | | | | | | | | | Prevent deoptimization of process.nextTick by removing the try finally block. This is not necessary as the next tick queue will be reset anyway, no matter if the callback throws or not. Use a predefined array size prevents resizing the array and is therefor faster. PR-URL: https://github.com/nodejs/node/pull/5092 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
* deps: sync with upstream bagder/c-ares@2bae2d5Fedor Indutny2016-02-081-3/+3
| | | | | PR-URL: https://github.com/nodejs/node/pull/5090 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
* crypto: fix memory leak in LoadPKCS12Fedor Indutny2016-02-081-1/+1
| | | | | | | | | `sk_X509_pop_free` should be used instead of `sk_X509_free` to free all items in queue too, not just the queue itself. PR-URL: https://github.com/nodejs/node/pull/5109 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
* crypto: add `pfx` certs as CA certs tooFedor Indutny2016-02-081-0/+11
| | | | | | | | | | | | According to documentation all certificates specified in `pfx` option should be treated as a CA certificates too. While it doesn't seem to be logically correct to me, we can't afford to break API stability at this point. Fix: #5100 PR-URL: https://github.com/nodejs/node/pull/5109 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
* dns: add resolvePtr to query plain DNS PTR recordsDaniel Turing2016-02-081-0/+44
| | | | | | | | | | Resolving plain PTR records is used beyond reverse DNS, most prominently with DNS-SD (RFC6763). This adds dns.resolvePtr(), and uses it (instead of dns.reverse()) in dns.resolve(). PR-URL: https://github.com/nodejs/node/pull/4921 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Brian White <mscdex@mscdex.net>
* src: clean up usage of __proto__Jackson Tian2016-02-071-2/+3
| | | | | | | | Prefer using Object.setPrototypeOf() instead. PR-URL: https://github.com/nodejs/node/pull/5069 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* node_contextify: do not incept debug contextMyles Borins2016-02-051-21/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Currently a debug context is created for various calls to util. If the node debugger is being run the main context is the debug context. In this case node_contextify was freeing the debug context and causing everything to explode. This change moves around the logic and no longer frees the context. There is a concern about the dangling pointer The regression test was adapted from code submitted by @3y3 in #4815 Fixes: https://github.com/nodejs/node/issues/4440 Fixes: https://github.com/nodejs/node/issues/4815 Fixes: https://github.com/nodejs/node/issues/4597 Fixes: https://github.com/nodejs/node/issues/4952 PR-URL: https://github.com/nodejs/node/issues/4815 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
* node: deprecate process.EventEmitterEvan Lucas2016-02-041-1/+11
| | | | | | | | | | | | | The comment stating it was deprecated was added in 2011 via 4ef8f06fe62edb74fded0e817266cb6398e69f36. It is time to actually deprecate it. PR-URL: https://github.com/nodejs/node/pull/5049 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
* tls: add getProtocol() to TLS socketsBrian White2016-02-032-0/+11
| | | | | | | | | | This commit adds a new method for TLS sockets that returns the negotiated protocol version. PR-URL: https://github.com/nodejs/node/pull/4995 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: upgrade to new v8::Private apiBen Noordhuis2016-02-036-94/+178
| | | | | | | | | | | | Stop using the deprecated `GetHiddenValue()` and `SetHiddenValue()` methods, start using `GetPrivate()` and `SetPrivate()` instead. This commit turns some of the entries in the per-isolate string table into private symbols. PR-URL: https://github.com/nodejs/node/pull/5045 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* module: pass v8::Object to linked module initialization functionPhillip Kovalev2016-02-021-6/+9
| | | | | | | | Fixes: https://github.com/nodejs/node/issues/4756 PR-URL: https://github.com/nodejs/node/pull/4771 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Rod Vagg <r@va.gg>
* crypto: use SSL_CTX_clear_extra_chain_certs.Adam Langley2016-02-021-4/+1
| | | | | | | | | | | | | | | The SSL_CTX_clear_extra_chain_certs function clears the extra certificates associated with an SSL_CTX without reaching into the SSL_CTX structure itself (which will become impossible in OpenSSL 1.1.0). The underlying implementation in OpenSSL[1] is the same what the code was doing and OpenSSL has provided this function since 0.9.8 so this change should be fully compatible. [1] https://github.com/nodejs/node/blob/master/deps/openssl/openssl/ssl/s3_lib.c#L3899 PR-URL: https://github.com/nodejs/node/pull/4919 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
* src: remove no longer relevant commentsChris9112016-02-013-4/+2
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/4843 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
* contextify: use offset/length from Uint8ArrayFedor Indutny2016-01-291-3/+4
| | | | | | | | | | | | | Do not blindly take data from underlying `ArrayBuffer`, use `ByteOffset`/`ByteLength` of `Uint8Array` itself. Additionally, fix tests that weren't actually properly running because of V8's internal code cache. The code should be different, otherwise the cached data won't be used at all. Fix: #4939 PR-URL: https://github.com/nodejs/node/pull/4947 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* dgram: support dgram.send with multiple buffersMatteo Collina2016-01-291-19/+45
| | | | | | | | | | | | Added ability to dgram.send to send multiple buffers, _writev style. The offset and length parameters in dgram.send are now optional. Refactored the dgram benchmarks, and seperated them from net. Added docs for the new signature. Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Fixes: https://github.com/nodejs/node/issues/4302 PR-URL: https://github.com/nodejs/node/pull/4374
* crypto: fix build when OCSP-stapling not providedAdam Langley2016-01-281-1/+10
| | | | | | | | | | | | | | | node_crypto.cc attempts to handle the case where OCSP stapling APIs aren't provided by using NODE__HAVE_TLSEXT_STATUS_CB. But the build would actually fail in this case because of a couple of places that were missing #ifdefs. With this change the build works although, as expected, test-tls-ocsp-callback.js will fail. PR-URL: https://github.com/nodejs/node/pull/4914 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
* crypto: use a const SSL_CIPHERAdam Langley2016-01-271-1/+1
| | | | | | | | | | SSL_CIPHER objects are conceptually const in any case and this allows STACK_OF(SSL_CIPHER) to return a const pointer, as is done in BoringSSL and, perhaps, OpenSSL in the future. PR-URL: https://github.com/nodejs/node/pull/4913 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* tls_wrap: reach error reporting for UV_EPROTOFedor Indutny2016-01-273-10/+25
| | | | | | | | | | | Do not swallow error details when reporting UV_EPROTO asynchronously, and when creating artificial errors. Fix: #3692 PR-URL: https://github.com/nodejs/node/pull/4885 Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* src: attach error to stack on displayErrorscjihrig2016-01-263-4/+31
| | | | | | | | | | | | | | The vm module's displayErrors option attaches error arrow messages as a hidden property. Later, core JavaScript code can optionally decorate the error stack with the arrow message. However, when user code catches an error, it has no way to access the arrow message. This commit changes the behavior of displayErrors to mean "decorate the error stack if an error occurs." Fixes: https://github.com/nodejs/node/issues/4835 PR-URL: https://github.com/nodejs/node/pull/4874 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* vm: introduce `cachedData`/`produceCachedData`Fedor Indutny2016-01-242-3/+78
| | | | | | | | | Introduce `cachedData`/`produceCachedData` options for `v8.Script`. Could be used to consume/produce V8's code cache for speeding up compilation of known code. PR-URL: https://github.com/nodejs/node/pull/4777 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* buffer: properly retrieve binary length of needleTrevor Norris2016-01-221-1/+3
| | | | | | | | | If the needle contains an extended latin-1 character then using String::Utf8Length() will be too large and the search will return early. Instead use String::Length() when encoding is BINARY. PR-URL: https://github.com/nodejs/node/pull/4803 Reviewed-By: James M Snell <jasnell@gmail.com>
* process: support symbol eventscjihrig2016-01-211-1/+2
| | | | | | | | | | | | | Event emitters support symbols as event names. The process object assumes that the event name is a string, and examines the first three characters to check for signals. This causes an exception if the event name is a symbol. This commit ensures that the event name is a string before trying to slice() it. PR-URL: https://github.com/nodejs/node/pull/4798 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Wyatt Preul <wpreul@gmail.com>
* src: fix negative values in process.hrtime()Ben Noordhuis2016-01-201-4/+3
| | | | | | | | | | | | | Fix a regression introduced in commit 89f056b ("node: improve performance of hrtime()") where the nanosecond field sometimes had a negative value when calculating the difference between two timestamps. Fixes: https://github.com/nodejs/node/issues/4751 PR-URL: https://github.com/nodejs/node/pull/4757 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
* node: allow preload modules with -iEvan Lucas2016-01-181-0/+1
| | | | | | | | | | This gives us the ability to preload when using the node repl. This can be useful for doing things like creating aliases. Fixes: https://github.com/nodejs/node/issues/4661 PR-URL: https://github.com/nodejs/node/pull/4696 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* v8,src: expose statistics about heap spacesBen Ripkens2016-01-183-1/+102
| | | | | | | | | | | | Provide means to inspect information about the separate heap spaces via a callable API. This is helpful to analyze memory issues. Fixes: https://github.com/nodejs/node/issues/2079 PR-URL: https://github.com/nodejs/node/pull/4463 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: return UV_EAI_NODATA on empty lookupcjihrig2016-01-181-0/+4
| | | | | | | | | | | | | | AfterGetAddrInfo() can potentially return an empty array of results without setting an error value. The JavaScript layer expects the array to have at least one value if an error is not returned. This commit sets a UV_EAI_NODATA error when an empty result array is detected. Fixes: https://github.com/nodejs/node/issues/4545 PR-URL: https://github.com/nodejs/node/pull/4715 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
* src: don't check failure with ERR_peek_error()Ben Noordhuis2016-01-181-2/+1
| | | | | | | | | | | It's possible there is already an existing error on OpenSSL's error stack that is unrelated to the EVP_DigestInit_ex() operation we just executed. Fixes: https://github.com/nodejs/node/issues/4221 PR-URL: https://github.com/nodejs/node/pull/4731 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
* crypto: clear error stack in ECDH::InitializeFedor Indutny2016-01-151-0/+2
| | | | | | | | | | | Clean up OpenSSL error stack in `ECDH::Initialize`, some curves have faulty implementations that are leaving dangling errors after initializing the curve. Fix: #4686 PR-URL: https://github.com/nodejs/node/pull/4689 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
* src: remove redeclarations of variablesRich Trott2016-01-111-7/+3
| | | | | | | | | | | Remove redeclarations of variables in node.js. This includes removing one apparently unnecessary `NativeModule.require('module')`. PR-URL: https://github.com/nodejs/node/pull/4605 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com>
* tls_wrap: clear errors on returnFedor Indutny2016-01-043-16/+24
| | | | | | | | | Adopt `MarkPopErrorOnReturn` from `node_crypto.cc`, and use it to clear errors after `SSL_read`/`SSL_write`/`SSL_shutdown` functions. See: https://github.com/nodejs/node/issues/4485 PR-URL: https://github.com/nodejs/node/pull/4515 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* os: fix crash in GetInterfaceAddressesMartin Bark2016-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | If uv_interface_addresses() returns UV_ENOSYS then interfaces and count are uninitialised. This can cause a segmentation fault inside GetInterfaceAddresses when it tries to use the invalid interfaces[]. Fix the issue by returning from GetInterfaceAddresses on the UV_ENOSYS error. This issue was observed when using uCLibc-ng version 1.0.9 because uv_interface_addresses() in deps/uv/src/unix/linux-core.c incorrectly undefines HAVE_IFADDRS_H. Signed-off-by: Martin Bark <martin@barkynet.com> PR-URL: https://github.com/nodejs/node/pull/4272 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
* node: improve performance of process.hrtime()Evan Lucas2015-12-302-18/+16
| | | | | | | | | Move argument validation out of C++ and into JS. Improves performance by about 15-20%. PR-URL: https://github.com/nodejs/node/pull/4484 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: remove forwards for v8::GC*logueCallbackAli Ijaz Sheikh2015-12-223-6/+0
| | | | | | | | These types are no longer used in the file and V8 4.9 no longer defines these types anymore. PR-URL: https://github.com/nodejs/node/pull/4381 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
* module: always decorate thrown errorsBrian White2015-12-193-3/+30
| | | | | | | | | | This provides more information when encountering a syntax or similar error when executing a file with require(). Fixes: https://github.com/nodejs/node/issues/4286 PR-URL: https://github.com/nodejs/node/pull/4287 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* crypto: load PFX chain the same way as regular oneFedor Indutny2015-12-171-50/+120
| | | | | | | | | Load the certificate chain from the PFX file the same as we do it for a regular certificate chain. Fix: #4127 PR-URL: https://github.com/nodejs/node/pull/4165 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* node: improve accessor perf of process.envTrevor Norris2015-12-171-13/+30
| | | | | | | Set process.env array entries in JS. PR-URL: https://github.com/nodejs/node/pull/3780 Reviewed-By: Fedor Indutny <fedor@indutny.com>
* node: improve performance of hrtime()Trevor Norris2015-12-172-12/+28
| | | | | | | | | | | | | | process.hrtime() was performing too many operations in C++ that could be done faster in JS. Move those operations over by creating a length 4 Uint32Array and perform bitwise operations on the seconds so that it was unnecessary for the native API to do any object creation or set any fields. This has improved performance from ~350 ns/op to ~65 ns/op. Light benchmark included to demonstrate the performance change. PR-URL: https://github.com/nodejs/node/pull/3780 Reviewed-By: Fedor Indutny <fedor@indutny.com>