Karl Skomski [Wed, 12 Aug 2015 13:30:01 +0000 (15:30 +0200)]
crypto: fix mem {de}allocation in ExportChallenge
Use correct deallocator for returned buffera.
Don't free internal structure via ASN1_STRING_data.
Deallocate NETSCAPE_SPKI.
PR-URL: https://github.com/nodejs/node/pull/2359
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Mike Atkins [Mon, 10 Aug 2015 15:55:37 +0000 (11:55 -0400)]
tls: handle empty cert in checkServerIndentity
This resolves joyent/node#9272. `tlsSocket.getPeerCertificate` will
return an empty object when the peer does not provide a certificate,
but, prior to this, when the certificate is empty, `checkServerIdentity`
would throw because the `subject` wasn't present on the cert.
`checkServerIdentity` must return an error, not throw one, so this
returns an error when the cert is empty instead of throwing
a `TypeError`.
PR-URL: https://github.com/nodejs/node/pull/2343
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Jacob Edelman [Sat, 15 Aug 2015 17:56:12 +0000 (10:56 -0700)]
doc: fix spelling mistake in node.js comment
Per: https://github.com/joyent/node/pull/8876
PR-URL: https://github.com/nodejs/node/pull/2391
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
Michaël Zasso [Sun, 2 Aug 2015 10:09:38 +0000 (12:09 +0200)]
test: remove unreachable code
There is no way a line can be called after throwing an exception.
PR-URL: https://github.com/nodejs/node/pull/2289
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Michaël Zasso [Thu, 20 Aug 2015 09:37:02 +0000 (11:37 +0200)]
test: disallow unreachable code
PR-URL: https://github.com/nodejs/node/pull/2289
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Todd Kennedy [Wed, 19 Aug 2015 22:44:20 +0000 (15:44 -0700)]
repl: dont throw ENOENT on NODE_REPL_HISTORY_FILE
If you have no history file written to disk, but the environment
variable set, `fs.readFileSync` will throw an ENOENT error,
but there's nothing to convert. The converter should ignore
ENOENT on that `fs.readFileSync` call.
Fixes: https://github.com/nodejs/node/issues/2449
PR-URL: https://github.com/nodejs/node/pull/2451
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Fedor Indutny [Tue, 11 Aug 2015 19:27:22 +0000 (12:27 -0700)]
stream_base: various improvements
Expose and use in TLSWrap an `v8::External` wrap of the
`StreamBase*` pointer instead of guessing the ancestor C++ class in
`node_wrap.h`.
Make use of `StreamBase::Callback` structure for storing/passing both
callback and context in a single object.
Introduce `GetObject()` for future user-land usage, when a child class
is not going to be inherited from AsyncWrap.
PR-URL: https://github.com/nodejs/node/pull/2351
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Brendan Ashworth [Tue, 18 Aug 2015 18:45:59 +0000 (11:45 -0700)]
test: reduce timeouts in test-net-keepalive
Previously 1000-1200ms, they're now (platform dependent) 50-100ms.
Improves test run time on my machine from 0m1.335s to 0m0.236s.
PR-URL: https://github.com/nodejs/node/pull/2429
Reviewed-By: Rich Trott <rtrott@gmail.com>
Brendan Ashworth [Tue, 18 Aug 2015 18:36:20 +0000 (11:36 -0700)]
test: improve test-net-server-pause-on-connect
Previously the test had a massive timeout (3s!), reduce this to a
platform specific timeout of 50ms.
This test runs two servers at the same time in an attempt to compare
behaviour. I've added a check to make sure one event fires before the
other event, as is expected, but that is a possible race condition.
Improves test run time on my machine from 0m3.141s to 0m0.356s.
PR-URL: https://github.com/nodejs/node/pull/2429
Reviewed-By: Rich Trott <rtrott@gmail.com>
Brendan Ashworth [Tue, 18 Aug 2015 18:11:28 +0000 (11:11 -0700)]
test: improve test-net-pingpong
This includes the following changes:
- a more strict data check rather than a regex
- reduced number of annoying log calls
The most important of the changes is the annoying log calls, which
speeds up the test execution from about 0m1.130s to 0m0.481s on my
machine.
PR-URL: https://github.com/nodejs/node/pull/2429
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sakthipriyan Vairamani [Tue, 11 Aug 2015 18:31:50 +0000 (00:01 +0530)]
events: deprecate static listenerCount function
As per the discussion in #734, this patch deprecates the usage of
`EventEmitter.listenerCount` static function in the docs, and introduces
the `listenerCount` function in the prototype of `EventEmitter` itself.
PR-URL: https://github.com/nodejs/node/pull/2349
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Michael Dawson [Thu, 30 Jul 2015 22:12:36 +0000 (18:12 -0400)]
Update FIPS instructions in README.md
Update the instructions to follow the requirements
in the security policy and user guide
PR-URL: https://github.com/nodejs/node/pull/2278
Fixes: https://github.com/nodejs/node/issues/2242
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Rod Vagg <r@va.gg>
Ben Noordhuis [Tue, 18 Aug 2015 19:02:52 +0000 (21:02 +0200)]
test: drop Isolate::GetCurrent() from addon tests
v8::Isolate::GetCurrent() is not exactly deprecated at this point but
its use is strongly discouraged. Update the addon tests so they no
longer use it.
PR-URL: https://github.com/nodejs/node/pull/2427
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Tue, 18 Aug 2015 18:29:10 +0000 (20:29 +0200)]
test: lint addon tests
Add files in test/addon to the `make cpplint` rule and fix up existing
style issues. Tests scraped from doc/api/addon.md are filtered out
because those are predominantly for illustrative purposes.
PR-URL: https://github.com/nodejs/node/pull/2427
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Rich Trott [Tue, 18 Aug 2015 15:38:20 +0000 (08:38 -0700)]
doc: clarify options for fs.watchFile()
The explanation for the `options` argument to `fs.watchFile()` had
missing punctuation. I took the opportunity to try to rewrite the
paragraph for greater clarity.
PR-URL: https://github.com/nodejs/node/pull/2425
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Rich Trott [Sat, 15 Aug 2015 23:17:36 +0000 (16:17 -0700)]
test: refactor test-fs-watchfile.js
The test no longer waits about 5 seconds between callback invocations.
It now writes to the tmp directory rather than the fixtures directory.
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/2393
Karl Skomski [Mon, 17 Aug 2015 20:51:42 +0000 (22:51 +0200)]
src: better error message on failed Buffer malloc
PR-URL: https://github.com/nodejs/node/pull/2422
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
P.S.V.R [Tue, 18 Aug 2015 02:32:21 +0000 (10:32 +0800)]
crypto: check for OpenSSL errors when signing
Errors might be injected into OpenSSL's error stack
without the return value of `PEM_read_bio_PrivateKey` being set to
`nullptr`. See the test of `test_bad_rsa_privkey.pem` for an
example.
PR-URL: https://github.com/nodejs/node/pull/2342
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Fedor Indutny [Fri, 14 Aug 2015 22:57:33 +0000 (15:57 -0700)]
tls: fix throughput issues after incorrect merge
1e066e4a was done incorrectly and has overwritten an important change
in:
c17449df. Using bigger output buffer increases performance in 3-4
times.
PR-URL: https://github.com/nodejs/node/pull/2381
Fix: https://github.com/joyent/node/issues/25803
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Matt Loring [Wed, 1 Jul 2015 00:24:21 +0000 (17:24 -0700)]
tools: run the tick processor without building v8
Currently, v8 native deps must be built in order to run the log
processor on node profiling output. These scripts use node instead
of d8 to remove this dependency.
This change was originally proposed to the v8 team but since the
changes are not v8 specific, we have moved the proposal here. See:
https://codereview.chromium.org/
1179173009/
PR-URL: https://github.com/nodejs/node/pull/2090
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Karl Skomski [Fri, 14 Aug 2015 12:35:41 +0000 (14:35 +0200)]
crypto: fix memory leak in PBKDF2Request
PR-URL: https://github.com/nodejs/node/pull/2375
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Karl Skomski [Fri, 14 Aug 2015 12:30:52 +0000 (14:30 +0200)]
crypto: fix memory leak in ECDH::SetPrivateKey
PR-URL: https://github.com/nodejs/node/pull/2375
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Karl Skomski [Fri, 14 Aug 2015 12:28:39 +0000 (14:28 +0200)]
crypto: fix memory leak in PublicKeyCipher::Cipher
PR-URL: https://github.com/nodejs/node/pull/2375
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Karl Skomski [Fri, 14 Aug 2015 12:26:07 +0000 (14:26 +0200)]
crypto: fix memory leak in SafeX509ExtPrint
PR-URL: https://github.com/nodejs/node/pull/2375
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Karl Skomski [Fri, 14 Aug 2015 12:23:00 +0000 (14:23 +0200)]
crypto: fix memory leak in SetDHParam
PR-URL: https://github.com/nodejs/node/pull/2375
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Karl Skomski [Fri, 14 Aug 2015 08:12:16 +0000 (10:12 +0200)]
src: fix memory leak in DLOpen
PR-URL: https://github.com/nodejs/node/pull/2375
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
muddletoes [Wed, 12 Nov 2014 18:42:34 +0000 (13:42 -0500)]
test: correct spelling of 'childProcess'
Per: https://github.com/joyent/node/pull/8715
Cleans up a minor spelling error in two tests.
PR-URL: https://github.com/nodejs/node/pull/2389
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
Sam Stites [Sat, 15 Aug 2015 17:07:07 +0000 (10:07 -0700)]
path: use '===' instead of '==' for comparison
Per: https://github.com/joyent/node/pull/7554
Originally submitted by @stites
PR-URL: https://github.com/nodejs/node/pull/2388
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Ben Noordhuis [Thu, 13 Aug 2015 23:56:30 +0000 (01:56 +0200)]
src: don't use fopen() in require() fast path
Fix a regression that was introduced in commit 1bbf8d0 ("lib: speed up
require(), phase 2") where file paths with Unicode characters fail to
load on Windows.
Fixes: https://github.com/nodejs/node/issues/2236
PR-URL: https://github.com/nodejs/node/pull/2377
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Steven R. Loomis [Fri, 31 Jul 2015 23:25:15 +0000 (16:25 -0700)]
build: work around VS2015 issue in ICU <56
The particular ufile.c is from
http://bugs.icu-project.org/trac/changeset/37704
and should be OK for ICU 54 and 55.
Also, adds general mechanism for floating patches on top of ICU.
Fixes: https://github.com/nodejs/node/issues/2279
PR-URL: https://github.com/nodejs/node/pull/2283
Reviewed-By: João Reis <reis@janeasystems.com>
Ben Noordhuis [Thu, 13 Aug 2015 11:53:39 +0000 (13:53 +0200)]
src: rename Buffer::Use() to Buffer::New()
Fixes: https://github.com/nodejs/node/issues/2308
PR-URL: https://github.com/nodejs/node/pull/2352
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Thu, 13 Aug 2015 11:47:18 +0000 (13:47 +0200)]
src: introduce internal Buffer::Copy() function
Rename the three argument overload of Buffer::New() to Buffer::Copy()
and update the code base accordingly. The reason for renaming is to
make it impossible to miss a call site.
This coincidentally plugs a small memory leak in crypto.getAuthTag().
Fixes: https://github.com/nodejs/node/issues/2308
PR-URL: https://github.com/nodejs/node/pull/2352
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Thu, 13 Aug 2015 11:29:28 +0000 (13:29 +0200)]
src: move internal functions out of node_buffer.h
The circular dependency problem that put them there in the first place
is no longer an issue. Move them out of the public node_buffer.h header
and into the private node_internals.h header.
Fixes: https://github.com/nodejs/node/issues/2308
PR-URL: https://github.com/nodejs/node/pull/2352
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Fri, 7 Aug 2015 21:03:00 +0000 (23:03 +0200)]
src: plug memory leaks
In a few places dynamic memory was passed to the Buffer::New() overload
that makes a copy of the input, not the one that takes ownership.
This commit is a band-aid to fix the memory leaks. Longer term, we
should look into using C++11 move semantics more effectively.
Fixes: https://github.com/nodejs/node/issues/2308
PR-URL: https://github.com/nodejs/node/pull/2352
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Steven R. Loomis [Thu, 13 Aug 2015 15:30:01 +0000 (08:30 -0700)]
build: intl: converge from joyent/node
* turn on small-icu by default for builds (Makefile+Windows)
* add license info from ICU
http://source.icu-project.org/repos/icu/icu/trunk/license.html
All text pasted. Long lines wrapped. (original is HTML.)
Port from joyent/node of:
* https://github.com/nodejs/node/issues/26
* port of joyent/node
67f87a743dee4951374dd240c25e31cd507e6c5f
* https://github.com/joyent/node/pull/9038
* Merge from joyent/node
70d04e7f35667381aa6e9d76f56ea962c019d5bc
* Merge from joyent/node
6168fe6720650052728f3e78a495b723f0b41ce3
* merge from joyent/node
e67073256d847be085be7049cd1d6ebd8d86ac62
PR-URL: https://github.com/nodejs/node/pull/2264
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Fixes: https://github.com/nodejs/node/issues/238
Steven R. Loomis [Mon, 3 Aug 2015 19:44:06 +0000 (12:44 -0700)]
build: Intl: bump ICU4C from 54 to 55
node was using ICU4C 54 ( released 2014-oct-06 )
* Bump to ICU4C 55 ( released 2015-apr-08)
* Timezone fixes, translation fixes, bug/performance fixes.
* Speed improvements in date formatting
* ICU4C 55 changelog: http://site.icu-project.org/download/55
* CLDR 27 changelog: http://cldr.unicode.org/index/downloads/cldr-27
* Retarget the file exclusions from ICU4C 54 to ICU4C 55
* (improves on-disk footprint on some platforms)
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Fixes: https://github.com/nodejs/node/issues/2292
PR-URL: https://github.com/nodejs/node/pull/2293
João Reis [Mon, 27 Jul 2015 16:39:04 +0000 (17:39 +0100)]
test: option to run a subset of tests
With this option, tests can be divided in groups and only one is run
from each group. This enables us to parallelize the tests across
multiple machines.
PR-URL: https://github.com/nodejs/io.js/pull/2260
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
Chad Johnston [Fri, 7 Aug 2015 02:42:10 +0000 (20:42 -0600)]
crypto: show exponent in decimal and hex
The exponent value was already in hex, but missing the 0x prefix which
could be confusing.
PR-URL: https://github.com/nodejs/io.js/pull/2320
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Roman Klauke [Tue, 11 Aug 2015 18:06:41 +0000 (20:06 +0200)]
src: add total_available_size to v8 statistics
v8 introduced the new flag `total_available_size` in version 4.4
and upwards. This flag is now available on `v8.getHeapStatistics`
with the name `total_available_size`. It contains the total
available heap size of v8.
Introduced with commit: v8/v8-git-mirror@
0a1352a7
PR-URL: https://github.com/nodejs/io.js/pull/2348
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Ben Noordhuis [Wed, 5 Aug 2015 12:44:21 +0000 (14:44 +0200)]
build: expand ~ in install prefix early
The install prefix gets written to config.gypi and config.mk. Tildes
were expanded in the first file but not in the second one, causing the
`make install` target to install files to a directory named `~` in
the current working directory.
Fixes: https://github.com/nodejs/node/issues/75
PR-URL: https://github.com/nodejs/io.js/pull/2307
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Rich Trott [Fri, 26 Jun 2015 01:54:25 +0000 (18:54 -0700)]
test: clarify dropMembership() call
According to docs, dropMembership() is automatically called
by the kernel when the socket is closed, and most apps will
never need to call it. It's called here as a sanity check
only so let's note that with a comment.
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/nodejs/io.js/pull/2062
Nathan Woltman [Fri, 31 Jul 2015 21:47:49 +0000 (17:47 -0400)]
path: remove dead code in favor of unit tests
Remove dead code paths that are created by assertions that will never
trigger. They may only trigger if either the `splitDeviceRe` or
`splitPathRe` regular expressions are modified. If at some point they
are modified, current unit tests will catch most of the resulting
errors and this commit adds extra tests to catch the remaining errors.
PR-URL: https://github.com/nodejs/io.js/pull/2282
Reviewed-By: Roman Reiss <me@silverwind.io>
Lucien Greathouse [Sun, 9 Aug 2015 05:56:08 +0000 (23:56 -0600)]
build: update manifest to include Windows 10
Windows 10 wasn't listed in the executable manifest.
This caused problems with trying to detect Windows 10
via `os.release()`.
PR-URL: https://github.com/nodejs/io.js/pull/2332
Reviewed-By: Roman Reiss <me@silverwind.io>
Christopher Monsanto [Wed, 10 Jun 2015 08:25:04 +0000 (04:25 -0400)]
util: display constructor when inspecting objects
This commit modifies util.inspect(obj) to additionally show the name of
the function that constructed the object. This often reveals useful
information about the object's prototype. In other words, instead of
> new Cls
{}
we have
> new Cls
Cls {}
This also works with exotic objects:
> class ArrayCls extends Array {}
> new ArrayCls(1, 2, 3)
ArrayCls [ 1, 2, 3 ]
The names of "trivial" constructors like Object and Array are not shown,
unless there is a mismatch between the object representation and the
prototype:
> Object.create([])
Array {}
This feature is inspired by browser devtools.
PR-URL: https://github.com/nodejs/io.js/pull/1935
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Fedor Indutny [Sat, 8 Aug 2015 01:14:54 +0000 (18:14 -0700)]
tls: fix check for reused session
When TLS Session Ticket is renewed by server - no Certificate record is
to the client. We are prepared for empty certificate in this case, but
this relies on the session reuse check, which was implemented
incorrectly and was returning false when the TLS Session Ticket was
renewed.
Use session reuse check provided by OpenSSL instead.
Fix: https://github.com/nodejs/io.js/issues/2304
PR-URL: https://github.com/nodejs/io.js/pull/2312
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Fedor Indutny [Sat, 8 Aug 2015 01:12:44 +0000 (18:12 -0700)]
tls: introduce internal `onticketkeycallback`
`enableTicketKeyCallback` and `onticketkeycallback` could be potentially
used to renew the TLS Session Tickets before they expire. However this
commit will introduce it only for private use yet, because we are not
sure about the API, and already need this feature for testing.
See: https://github.com/nodejs/io.js/issues/2304
PR-URL: https://github.com/nodejs/io.js/pull/2312
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
Sam Roberts [Wed, 10 Jun 2015 15:41:03 +0000 (08:41 -0700)]
test: make listen-fd-cluster/server more robust
- eliminate unnecessary intermediate process ("parent")
- children exit if runner dies unexpectedly (killed on a test timeout,
for example)
- use explicit messaging from children to parents to indicate when
worker is ready to accept http requests, rather than racing to see
whether runner will make request before worker is listening
PR-URL: https://github.com/nodejs/io.js/pull/1944
Reviewed-By: Johan Bergstrom <bugs@bergstroem.nu>
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
Ryan Graham [Thu, 2 Jul 2015 22:26:21 +0000 (15:26 -0700)]
net: ensure Socket reported address is current
Any time the connection state or the underlying handle itself changes,
the socket's name (aka, local address) can change.
To deal with this we need to reset the cached sockname any time we
set or unset the internal handle or an existing handle establishes a
connection.
PR-URL: https://github.com/nodejs/io.js/pull/2095
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Gireesh Punathil [Wed, 18 Mar 2015 08:12:16 +0000 (04:12 -0400)]
test: address timing issues in simple http tests
simple tests test-http-request-end.js, test-http-default-encoding.js
hangs in AIX. The root cause for both the failures is related to the
timing with which packets are sent between the client and server.
On the client side, one factor that affects the timing is Nagle's
algorithm. With Nagle enabled there may be a delay between two packets
as the stack may wait until either:
a. An acknowledgement for the first packet is received, or
b. 200 ms elapses.
before sending the second packet.
Similarly at the server side 2 sequential packages can be delivered to
the application either together or separatly.
On AIX we see that they are delivered separately to the server, while on
Linux delivered together. If we change the timing, for example disabling
Nagle on AIX we see the 2 packets delivered together and the tests pass.
In the test case simple/test-http-request-end.js, the client request
handler of the server receives and stores the data in a data callback,
closes the server in a request end callback, and writes to the client
and ends the response, in-line with the request receipt. An HTTP parser
module parses the incoming message, and invokes callback routines which
are registered for HTTP events (such as header, body, end etc.)
Because the termination sequence arrive in a separate packet, there is a
delay in parsing that message and identify that the client request ended
(and thereby invoke the request end call backhandler). Due to this delay,
the response close happens first, which in-turn destroys the server
socket leading to the fd and watcher removal from the uv loop abandoning
further events on this connection, and end call back never being called,
causing the reported hang. simple/test-http-default-encoding.js suffers
from the same problem.
Also, remove the timer logic from the test case. Test harness anyways
contain a timer which controls the individual tests so remove such
controls from the test case, as suggested by @tjfontaine
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: https://github.com/joyent/node/pull/9432
PORT-FROM: joyent/node @
13e1131406b2239f99962ecc05b8179aa781d0f8
PR-URL: https://github.com/nodejs/io.js/pull/2294
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
James M Snell [Wed, 24 Jun 2015 03:42:49 +0000 (20:42 -0700)]
doc: multiple documentation updates cherry picked from v0.12
* doc: improve http.abort description
* doc: mention that mode is ignored if file exists
* docs: Fix default options for fs.createWriteStream()
* Documentation update about Buffer initialization
* doc: add a note about readable in flowing mode
* doc: Document http.request protocol option
* doc, comments: Grammar and spelling fixes
* updated documentation for fs.createReadStream
* Update child_process.markdown, spelling
* doc: Clarified read method with specified size argument.
* docs:events clarify emitter.listener() behavior
* doc: two minor stream doc improvements
* doc: clarify Readable._read and Readable.push
* doc: stream.unshift does not reset reading state
* doc: readable event clarification
* doc: additional refinement to readable event
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noorduis <ben@strongloop.com>
PR-URL: https://github.com/nodejs/io.js/pull/2302
Rod Vagg [Wed, 5 Aug 2015 07:36:37 +0000 (00:36 -0700)]
Working on v4.0.0
Rod Vagg [Tue, 4 Aug 2015 21:23:27 +0000 (14:23 -0700)]
Working on v3.0.1
Rod Vagg [Sat, 1 Aug 2015 02:10:43 +0000 (12:10 +1000)]
2015-08-04 io.js v3.0.0 Release
Notable changes:
* buffer:
- Due to changes in V8, it has been necessary to reimplement Buffer
on top of V8's Uint8Array. While every effort has been made to
maintain performance, users are likely to experience a different
performance profile depending on how Buffer is used.
(Trevor Norris) #1825.
- Buffer can now take ArrayBuffers as a constructor argument
(Trevor Norris) #2002.
- When a single buffer is passed to Buffer.concat(), a new, copied
Buffer object will be returned; previous behavior was to return
the original Buffer object (Sakthipriyan Vairamani) #1937.
* build: PPC support has been added to core to allow compiling on
pLinux BE and LE (AIX support coming soon) (Michael Dawson) #2124.
* dgram: If an error occurs within socket.send() and a callback has
been provided, the error is only passed as the first argument to the
callback and not emitted on the socket object; previous behavior was
to do both (Matteo Collina & Chris Dickinson) #1796
* freelist: Deprecate the undocumented freelist core module
(Sakthipriyan Vairamani) #2176.
* http:
- Status codes now all use the official IANA names as per RFC7231,
e.g. http.STATUS_CODES[414] now returns 'URI Too Long' rather than
'Request-URI Too Large' (jomo) #1470.
- Calling .getName() on an HTTP agent no longer returns a trailing
colon, HTTPS agents will no longer return an extra colon near the
middle of the string (Brendan Ashworth) #1617.
* node:
- NODE_MODULE_VERSION has been bumped to 45 to reflect the break in
ABI (Rod Vagg) #2096.
- Introduce a new process.release object that contains a name
property set to 'io.js' and sourceUrl, headersUrl and libUrl
(Windows only) properties containing URLs for the relevant
resources; this is intended to be used by node-gyp
(Rod Vagg) #2154.
- The version of node-gyp bundled with io.js now downloads and uses
a tarball of header files from iojs.org rather than the full
source for compiling native add-ons; it is hoped this is a
temporary floating patch and the change will be upstreamed to
node-gyp soon (Rod Vagg) #2066.
* repl: Persistent history is now enabled by default. The history file
is located at ~/.node_repl_history, which can be overridden by the
new environment variable NODE_REPL_HISTORY. This deprecates the
previous NODE_REPL_HISTORY_FILE variable. Additionally, the format
of the file has been changed to plain text to better handle file
corruption. (Jeremiah Senkpiel) #2224.
* smalloc: The smalloc module has been removed as it is no longer
possible to provide the API due to changes in V8
(Ben Noordhuis) #2022.
* tls: Add server.getTicketKeys() and server.setTicketKeys() methods
for TLS session key rotation (Fedor Indutny) #2227.
* v8: Upgraded to 4.4.63.26
- ES6: Enabled computed property names
- ES6: Array can now be subclassed in strict mode
- ES6: Implement rest parameters in staging, use the
--harmony-rest-parameters command line flag
- ES6: Implement the spread operator in staging, use the
--harmony-spreadcalls command line flag
- Removed SetIndexedPropertiesToExternalArrayData and related APIs,
forcing a shift to Buffer to be reimplemented based on Uint8Array
- Introduction of Maybe and MaybeLocal C++ API for objects which may
or may not have a value.
- Added support for PPC
PR-URL: https://github.com/nodejs/io.js/pull/2299
Rod Vagg [Tue, 4 Aug 2015 20:59:23 +0000 (13:59 -0700)]
doc: fix heading levels for new repl documentation
PR-URL: https://github.com/nodejs/io.js/pull/2299
Reviewed-by: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Jeremiah Senkpiel [Mon, 3 Aug 2015 20:10:19 +0000 (13:10 -0700)]
repl: persist history in plain text
Persists the REPL history in plain text using the new NODE_REPL_HISTORY
environment variable. Deprecates NODE_REPL_HISTORY_FILE. The REPL will
notify the user and automatically convert the history to the new format
if files are specified.
PR-URL: https://github.com/nodejs/io.js/pull/2224
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Jeremiah Senkpiel [Tue, 4 Aug 2015 06:24:03 +0000 (23:24 -0700)]
repl: default persistence to ~/.node_repl_history
Makes the REPL persistently save history by default to
~/.node_repl_history when in terminal mode.
This can be disabled by setting NODE_REPL_HISTORY="".
PR-URL: https://github.com/nodejs/io.js/pull/2224
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Jeremiah Senkpiel [Sun, 2 Aug 2015 05:38:28 +0000 (22:38 -0700)]
test: add tests for persistent repl history
PR-URL: https://github.com/nodejs/io.js/pull/2224
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Jeremiah Senkpiel [Tue, 4 Aug 2015 06:33:48 +0000 (23:33 -0700)]
doc: document repl persistent history changes
PR-URL: https://github.com/nodejs/io.js/pull/2224
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Michaël Zasso [Thu, 30 Jul 2015 10:05:20 +0000 (12:05 +0200)]
src: disable vector ICs on arm
A bug on ARMv6 makes the process crash when the V8 debugger is used.
Disabling vector ICs as a workaround.
V8-Bug: https://code.google.com/p/v8/issues/detail?id=4338
PR-URL: https://github.com/nodejs/io.js/pull/2220
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Michaël Zasso [Mon, 27 Jul 2015 06:43:54 +0000 (08:43 +0200)]
deps: update V8 to 4.4.63.26
Includes cherry-picks for:
* JitCodeEvent patch: https://crrev.com/
f7969b1d5a55e66237221a463daf422ac7611788
* argparse patch: https://crrev.com/
44bc918458481d60b08d5566f0f31a79e39b85d7
PR-URL: https://github.com/nodejs/io.js/pull/2220
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Brendan Ashworth [Tue, 5 May 2015 02:24:59 +0000 (19:24 -0700)]
http: fix agent.getName() and add tests
This commit fixes agent.getName(), which returned an extra colon
according to the docs, and adds tests (it was previously not unit
tested).
PR-URL: https://github.com/nodejs/io.js/pull/1617
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Rich Trott [Thu, 21 May 2015 04:17:10 +0000 (21:17 -0700)]
readline: allow tabs in input
If tab completion is not being used, allow user to enter tab
characters.
PR-URL: https://github.com/nodejs/io.js/pull/1761
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Frederic Hemberger [Sat, 25 Jul 2015 11:33:32 +0000 (13:33 +0200)]
build: prepare Windows installer for i18n support
PR-URL: https://github.com/nodejs/io.js/pull/2247
Reviewed-By: Rod Vagg <rod@vagg.org>
Rod Vagg [Thu, 30 Jul 2015 12:12:01 +0000 (22:12 +1000)]
node: remove redundant --use-old-buffer
Accidentally left when upgrading to V8 4.4.63.9
PR-URL: https://github.com/nodejs/io.js/pull/2275
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Trevor Norris [Thu, 16 Jul 2015 21:19:01 +0000 (15:19 -0600)]
buffer: fix missing null/undefined check
The new implementation of Buffer missed the check for null/undefined as
the first argument to new Buffer(). Reintroduce the check and add test.
Fix: e8734c0 "buffer: implement Uint8Array backed Buffer"
Fix: https://github.com/nodejs/io.js/issues/2194
PR-URL: https://github.com/nodejs/io.js/pull/2195
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Rod Vagg [Fri, 24 Jul 2015 02:39:06 +0000 (12:39 +1000)]
build: add 'x86' option back in to configure
Accidentally removed @ https://github.com/nodejs/io.js/pull/2124
when ppc support was added
PR-URL: https://github.com/nodejs/io.js/pull/2233
Reviewed-By: Johan Bergstrom <bugs@bergstroem.nu>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Michael Dawson [Tue, 7 Jul 2015 18:15:03 +0000 (14:15 -0400)]
build: first set of updates to enable PPC support
These are the core changes that allow pLinux BE/LE compile. They
don't include all of the changes needed for AIX which will follow
once we have pLinux up and running in the builds
PR-URL: https://github.com/nodejs/io.js/pull/2124
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
Reviewed-By: Johan Bergstrom <bugs@bergstroem.nu>
Trevor Norris [Wed, 22 Jul 2015 19:06:54 +0000 (13:06 -0600)]
buffer: fix not return on error
Throwing a JS error from C++ does not mean the function will return
early. This must be done manually.
Also remove extraneous comment no longer relevant.
Fix: 2903030 "buffer: switch API to return MaybeLocal<T>"
PR-URL: https://github.com/nodejs/io.js/pull/2225
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Rod Vagg [Mon, 13 Jul 2015 03:35:02 +0000 (13:35 +1000)]
node-gyp: detect RC build with x.y.z-rc.n format
PR-URL: https://github.com/nodejs/io.js/pull/2171
Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Rod Vagg [Sun, 18 Jan 2015 06:41:37 +0000 (17:41 +1100)]
src: introduce process.release object
PR-URL: https://github.com/nodejs/io.js/pull/2154
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
jomo [Sat, 11 Jul 2015 00:01:52 +0000 (02:01 +0200)]
http: use official IANA Status Codes
* adds missing HTTP status codes
* corrects those with a wrong description
* the falsely included codes have been kept
PR-URL: https://github.com/nodejs/io.js/pull/1470
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Fedor Indutny [Sun, 5 Jul 2015 18:20:26 +0000 (11:20 -0700)]
node: do not override `message`/`stack` of error
Put the `...^` arrow string to the hidden property of the object, and
use it only when printing error to the stderr.
Fix: https://github.com/nodejs/io.js/issues/2104
PR-URL: https://github.com/nodejs/io.js/pull/2108
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Rod Vagg [Thu, 2 Jul 2015 04:34:49 +0000 (14:34 +1000)]
src: increment NODE_MODULE_VERSION to 45
PR-URL: https://github.com/nodejs/io.js/pull/2096
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Ben Noordhuis [Wed, 1 Jul 2015 22:50:48 +0000 (00:50 +0200)]
deps: upgrade v8 to 4.4.63.12
PR-URL: https://github.com/nodejs/io.js/pull/2092
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Rod Vagg [Tue, 30 Jun 2015 07:43:29 +0000 (17:43 +1000)]
Working on v3.0.0
Rod Vagg [Fri, 26 Jun 2015 12:19:30 +0000 (22:19 +1000)]
node-gyp: download header tarball for compile
Temporary fix only, node-gyp needs to be aware of whether it can even
download this file for the current runtime so that information needs to
come from the process itself.
Floating patch on npm.
PR-URL: https://github.com/nodejs/io.js/pull/2066
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Ryan Graham <ryan@strongloop.com>
Rod Vagg [Fri, 26 Jun 2015 12:17:02 +0000 (22:17 +1000)]
node-gyp: make aware of nightly, next-nightly & rc
A temporary fix only, node-gyp needs to be made more intelligent
upstream about figuring out where to find the download file by
inspecting the binary.
Floating patch on npm.
PR-URL: https://github.com/nodejs/io.js/pull/2066
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Ryan Graham <r.m.graham@gmail.com>
Ben Noordhuis [Fri, 19 Jun 2015 19:00:19 +0000 (21:00 +0200)]
buffer: rename internal/buffer_new.js to buffer.js
The old smalloc-based implementation has been removed, the typed array
implementation is the only one that is left now.
PR-URL: https://github.com/nodejs/io.js/pull/2022
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Fri, 19 Jun 2015 18:54:24 +0000 (20:54 +0200)]
test: remove two obsolete pummel tests
Remove two tests that assume creating big buffers fails. The size limit
is twice as big on 64 bits architectures now and is going to be removed
completely in the not too distant future.
PR-URL: https://github.com/nodejs/io.js/pull/2022
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Fri, 19 Jun 2015 18:45:30 +0000 (20:45 +0200)]
test: don't use arguments.callee
Fix a strict mode violation that made the test fail to run. It appears
to be a regression that was introduced in commit f29762f ("test: enable
linting for tests") which I was the sole reviewer of, so mea culpa.
PR-URL: https://github.com/nodejs/io.js/pull/2022
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Ben Noordhuis [Fri, 19 Jun 2015 11:23:56 +0000 (13:23 +0200)]
deps: update v8 to 4.4.63.9
Upgrade the bundled V8 and update code in src/ and lib/ to the new API.
Notable backwards incompatible changes are the removal of the smalloc
module and dropped support for CESU-8 decoding. CESU-8 support can be
brought back if necessary by doing UTF-8 decoding ourselves.
This commit includes https://codereview.chromium.org/
1192973004 to fix
a build error on python 2.6 systems. The original commit log follows:
Use optparse in js2c.py for python compatibility
Without this change, V8 won't build on RHEL/CentOS 6 because the
distro python is too old to know about the argparse module.
PR-URL: https://github.com/nodejs/io.js/pull/2022
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Trevor Norris [Wed, 17 Jun 2015 16:43:13 +0000 (10:43 -0600)]
buffer: allow ArrayBuffer as Buffer argument
Buffer now uses the ArrayBuffer as the backing store if passed to the
constructor.
Fixes: https://github.com/nodejs/io.js/issues/106
PR-URL: https://github.com/nodejs/io.js/pull/2002
Reviewed-By: Domenic Denicola <d@domenic.me>
Trevor Norris [Wed, 17 Jun 2015 17:42:00 +0000 (11:42 -0600)]
buffer: minor cleanup from rebase
PR-URL: https://github.com/nodejs/io.js/pull/2003
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Trevor Norris [Wed, 17 Jun 2015 17:34:12 +0000 (11:34 -0600)]
buffer: fix usage of kMaxLength
Starting in V8 v4.3 the maximum array index of a typed array is the same
as the largest Smi supported on a given architecture. To compensate for
these differences export kMaxLength from the buffer module with the
correct size for the given architecture.
PR-URL: https://github.com/nodejs/io.js/pull/2003
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
cjihrig [Thu, 11 Jun 2015 15:47:52 +0000 (11:47 -0400)]
cluster: do not unconditionally set --debug-port
Currently, each cluster worker is assigned an ever increasing
--debug-port argument. A long running cluster application that
does not use the debugger can run into errors related to the
port range. This commit mitigates the problem by only setting
the debug port if the master is started with debug arguments, or
the user explicitly defines debug arguments for the worker. This
commit also adds a new debug port offset counter that is only
incremented when a worker is created that utilizes debugging.
Fixes: https://github.com/joyent/node/issues/8159
Refs: https://github.com/nodejs/io.js/pull/1524
PR-URL: https://github.com/nodejs/io.js/pull/1949
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Oleg Elifantiev <oleg@elifantiev.ru>
Sakthipriyan Vairamani [Wed, 10 Jun 2015 17:06:15 +0000 (11:06 -0600)]
buffer: fix case of one buffer passed to concat
Fix Buffer.concat() so a copy is always returned regardless of the
number of buffers that were passed.
Previously if the array length was one then the same same buffer was
returned. This created a special case for the user where there was a
chance mutating the buffer returned by .concat() could mutate the buffer
passed in.
Also fixes an inconsistency when throwing if an array member was not a
Buffer instance. For example:
Buffer.concat([42]); // Returns 42
Buffer.concat([42, 1]); // Throws a TypeError
Now .concat() will always throw if an array member is not a Buffer
instance.
See: https://github.com/nodejs/io.js/issues/1891
PR-URL: https://github.com/nodejs/io.js/pull/1937
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fedor Indutny [Mon, 13 Apr 2015 14:31:57 +0000 (16:31 +0200)]
http_server: `prefinish` vs `finish`
Do not detach the socket from the response until all data is actually
sent to the other side.
See: https://github.com/iojs/io.js/pull/1373
PR-URL: https://github.com/nodejs/io.js/pull/1411
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Matteo Collina [Tue, 26 May 2015 07:17:00 +0000 (09:17 +0200)]
dgram: make send cb act as "error" event handler
Modifies the dgram send() method to not emit errors when a DNS
lookup fails if there is a callback. Given that the same UDP
socket can be used to send messages to different hosts, the socket
can be reused even if one of those send() fails.
This slightly changes the behavior of a stable API, so that it behaves
as users would expect to.
This is based on https://github.com/joyent/node/pull/7738, which
landed in
77266d7fadd8dfefb107ccb1e3fe97f9620f1288.
Fixes: https://github.com/joyent/node/issues/4846
Refs: https://github.com/joyent/node/pull/7738
PR-URL: https://github.com/nodejs/io.js/pull/1796
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Chris Dickinson [Thu, 5 Jun 2014 19:42:41 +0000 (12:42 -0700)]
dgram: make send cb act as "error" event handler
This allows users to provide a callback that handles potential
errors resulting from a `socket.send` call. The original behavior
of emitting the error event on the socket is preserved.
Fixes: https://github.com/joyent/node/issues/4846
PR-URL: https://github.com/joyent/node/pull/7738
PR-URL: https://github.com/nodejs/io.js/pull/1796
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Domenic Denicola [Mon, 1 Jun 2015 16:22:19 +0000 (12:22 -0400)]
vm: fix symbol access
By using the new SetHandler API instead of SetNamedPropertyHandler, we can
intercept symbols now. This forces us to use Maybes and MaybeLocals more,
since this new API does not have a non-maybe variant.
Fixes: https://github.com/nodejs/io.js/issues/884
PR-URL: https://github.com/nodejs/io.js/pull/1773
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Domenic Denicola [Sat, 23 May 2015 00:02:20 +0000 (20:02 -0400)]
vm: remove unnecessary access checks
No reason to install access checks if they're always going to return
true.
PR-URL: https://github.com/nodejs/io.js/pull/1773
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Domenic Denicola [Fri, 22 May 2015 23:41:28 +0000 (19:41 -0400)]
vm: fix property descriptors of sandbox properties
The GlobalPropertyQueryCallback was changed in 2010 to return an
integer instead of a boolean:
https://groups.google.com/forum/#!topic/v8-users/OOjHJrix-cU
This integer communicates the property descriptors of the property,
instead of just its presence or absence. However, the original
contextify code was probably written before this change, and it was
not updated when porting to Node.js.
Credit to @smikes for the test and the original PR of #885.
Fixes: https://github.com/nodejs/io.js/pull/864
Fixes: https://github.com/nodejs/io.js/pull/885
PR-URL: https://github.com/nodejs/io.js/pull/1773
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Trevor Norris [Tue, 2 Jun 2015 19:10:47 +0000 (13:10 -0600)]
crypto: remove kMaxLength on randomBytes()
New Buffer implementation allows greater than kMaxLength to be created.
So instead check if the passed value is a valid Smi.
PR-URL: https://github.com/nodejs/io.js/pull/1825
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Trevor Norris [Tue, 2 Jun 2015 18:53:30 +0000 (12:53 -0600)]
buffer: make additional changes to native API
Address comments and deprecations left in source files. These changes
include:
* Remove the deprecated API.
* Change Buffer::New() that did a copy of the data to Buffer::Copy()
* Change Buffer::Use() to Buffer::New()
PR-URL: https://github.com/nodejs/io.js/pull/1825
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Trevor Norris [Tue, 2 Jun 2015 17:09:03 +0000 (11:09 -0600)]
buffer: switch API to return MaybeLocal<T>
Instead of aborting in case of internal failure, return an empty
Local<Object>. Using the MaybeLocal<T> API, users must check their
return values.
PR-URL: https://github.com/nodejs/io.js/pull/1825
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Trevor Norris [Tue, 2 Jun 2015 16:18:01 +0000 (10:18 -0600)]
buffer: switch to using Maybe<T> API
Use the new Maybe<T> syntax for v8::Object::SetPrototype().
PR-URL: https://github.com/nodejs/io.js/pull/1825
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Trevor Norris [Mon, 1 Jun 2015 18:29:17 +0000 (12:29 -0600)]
buffer: finish implementing FreeCallback
Passing a FreeCallback to Buffer::New() now uses externalized
ArrayBuffer's.
PR-URL: https://github.com/nodejs/io.js/pull/1825
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Trevor Norris [Tue, 26 May 2015 18:42:14 +0000 (12:42 -0600)]
buffer: implement Uint8Array backed Buffer
With V8 4.4 removing the external array data API currently used by
Buffer, the new implementation uses the Uint8Array to back Buffer.
Buffers now have a maximum size of Smi::kMaxLength, as defined by V8.
Which is ~2 GB on 64 bit and ~1 GB on 32 bit.
The flag --use-old-buffer allows using the old Buffer implementation.
This flag will be removed once V8 4.4 has landed.
The two JS Buffer implementations have been split into two files for
simplicity.
Use getter to return expected .parent/.offset values for backwards
compatibility.
PR-URL: https://github.com/nodejs/io.js/pull/1825
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Trevor Norris [Tue, 26 May 2015 20:34:12 +0000 (14:34 -0600)]
buffer: allow ARGS_THIS to accept a name
Allowing the name to be passed to the ARGS_THIS macro will make it
easier to share code with the Uint8Array implementation.
PR-URL: https://github.com/nodejs/io.js/pull/1825
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Rod Vagg [Wed, 27 May 2015 00:34:17 +0000 (10:34 +1000)]
deps: backport
7b24219346 from v8 upstream
Original:
Fix lookup iterator checks in GetRealNamedProperty* methods
BUG=v8:4143
R=verwaest@chromium.org
LOG=n
Review URL: https://codereview.chromium.org/
1161553004
Cr-Commit-Position: refs/heads/master@{#28616}
PR-URL: https://github.com/nodejs/io.js/pull/1805
Reviewed-By: Domenic Denicola <domenic@domenicdenicola.com>