0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
Commit Graph

11891 Commits

Author SHA1 Message Date
Jeremiah Senkpiel
f7d5e4c618 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>
2015-08-04 11:56:18 -07:00
Jeremiah Senkpiel
ceee8d2807 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>
2015-08-04 11:56:18 -07:00
Jeremiah Senkpiel
1721968b22 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>
2015-08-04 11:56:18 -07:00
Michaël Zasso
d20093246b 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>
2015-08-04 11:56:18 -07:00
Michaël Zasso
3d3c687012 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>
2015-08-04 11:56:17 -07:00
Brendan Ashworth
2965442308 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>
2015-08-04 11:56:17 -07:00
Rich Trott
4cffaa3f55 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>
2015-08-04 11:56:17 -07:00
Frederic Hemberger
971de5e417 build: prepare Windows installer for i18n support
PR-URL: https://github.com/nodejs/io.js/pull/2247
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-08-04 11:56:17 -07:00
Rod Vagg
ba9ccf227e 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>
2015-08-04 11:56:17 -07:00
Trevor Norris
60a974d200 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>
2015-08-04 11:56:17 -07:00
Rod Vagg
2ba8b23661 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>
2015-08-04 11:56:16 -07:00
Michael Dawson
b4226e797a 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>
2015-08-04 11:56:16 -07:00
Trevor Norris
e6ab2d92bc 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>
2015-08-04 11:56:16 -07:00
Rod Vagg
9f727f5e03 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>
2015-08-04 11:56:16 -07:00
Rod Vagg
04fd4fad46 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>
2015-08-04 11:56:16 -07:00
jomo
2d9456e3e6 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>
2015-08-04 11:56:16 -07:00
Fedor Indutny
ef65321083 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>
2015-08-04 11:56:16 -07:00
Rod Vagg
9d34bd1147 src: increment NODE_MODULE_VERSION to 45
PR-URL: https://github.com/nodejs/io.js/pull/2096
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-08-04 11:56:15 -07:00
Ben Noordhuis
3aad4fa89a 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>
2015-08-04 11:56:15 -07:00
Rod Vagg
6f40b03a91 Working on v3.0.0 2015-08-04 11:56:15 -07:00
Rod Vagg
e52f963632 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>
2015-08-04 11:56:15 -07:00
Rod Vagg
902c9ca51d 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>
2015-08-04 11:56:15 -07:00
Ben Noordhuis
1057d1186b 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>
2015-08-04 11:56:15 -07:00
Ben Noordhuis
8e1a8ffe24 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>
2015-08-04 11:56:15 -07:00
Ben Noordhuis
ae731ec0fa 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>
2015-08-04 11:56:14 -07:00
Ben Noordhuis
70d1f32f56 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>
2015-08-04 11:56:14 -07:00
Trevor Norris
4643b8b667 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>
2015-08-04 11:56:13 -07:00
Trevor Norris
e5ada116cd buffer: minor cleanup from rebase
PR-URL: https://github.com/nodejs/io.js/pull/2003
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2015-08-04 11:56:13 -07:00
Trevor Norris
b625ab4242 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>
2015-08-04 11:56:12 -07:00
cjihrig
423d8944ce 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>
2015-08-04 11:56:12 -07:00
Sakthipriyan Vairamani
eea66e2a7b 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>
2015-08-04 11:56:12 -07:00
Fedor Indutny
11e4249227 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>
2015-08-04 11:56:12 -07:00
Matteo Collina
ef2c8cd4ec 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 77266d7fad.

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>
2015-08-04 11:56:12 -07:00
Chris Dickinson
3da057fef6 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>
2015-08-04 11:56:12 -07:00
Domenic Denicola
3b021efe11 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>
2015-08-04 11:56:11 -07:00
Domenic Denicola
7b81e4ba36 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>
2015-08-04 11:56:11 -07:00
Domenic Denicola
659dadd410 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>
2015-08-04 11:56:11 -07:00
Trevor Norris
944f68046c 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>
2015-08-04 11:56:11 -07:00
Trevor Norris
8664084166 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>
2015-08-04 11:56:11 -07:00
Trevor Norris
36f78f4c1c 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>
2015-08-04 11:56:11 -07:00
Trevor Norris
571ec13841 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>
2015-08-04 11:56:11 -07:00
Trevor Norris
d75f5c8d0e 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>
2015-08-04 11:56:10 -07:00
Trevor Norris
63da0dfd3a 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>
2015-08-04 11:56:10 -07:00
Trevor Norris
23be6ca189 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>
2015-08-04 11:56:10 -07:00
Rod Vagg
deb7ee93a7 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>
2015-08-04 11:56:10 -07:00
Julien Gilli
9bc2e26720 net: do not set V4MAPPED on FreeBSD
V4MAPPED is not supported on recent FreeBSD versions, at least on 10.1.
Thus, do not set this flag in net.connect on FreeBSD.

Fixes: https://github.com/joyent/node/issues/8540
Fixes: https://github.com/joyent/node/issues/9204
PR-URL: https://github.com/joyent/node/pull/18204
PR-URL: https://github.com/iojs/io.js/pull/1555
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-08-04 11:56:10 -07:00
cjihrig
df1994fe53 Revert "dns: remove AI_V4MAPPED hint flag on FreeBSD"
This reverts commit 04bea9f9c2.

PR-URL: https://github.com/iojs/io.js/pull/1555
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-08-04 11:56:10 -07:00
Michaël Zasso
d12df7f159 doc: update v8 flags in man page
PR-URL: https://github.com/iojs/io.js/pull/1701
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-08-04 11:56:09 -07:00
Chris Dickinson
d58e780504 deps: update v8 to 4.3.61.21
* @indutny's SealHandleScope patch (484bebc38319fc7c622478037922ad73b2edcbf9)
  has been cherry picked onto the top of V8 to make it compile.
* There's some test breakage in contextify.
* This was merged at the request of the TC.

PR-URL: https://github.com/iojs/io.js/pull/1632
2015-08-04 11:56:09 -07:00
Chris Dickinson
21d31c08e7 test: remove obsolete harmony flags 2015-08-04 11:56:08 -07:00