Commit Graph

11224 Commits (45814216ee29b8d6c5faa00c6d27b721f628a1ea)

Author SHA1 Message Date
Brendan Ashworth 45814216ee doc: fix format docs discrepancy
Only objects and symbols use `util.inspect`, others are simply
concatenated.

Fixes: https://github.com/iojs/io.js/issues/935
PR-URL: https://github.com/iojs/io.js/pull/1255
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-03-25 08:47:41 -07:00
Brian White 8a945814dd string_decoder: optimize write()
By limiting property getting/setting to only where they are
absolutely necessary, we can achieve greater performance
especially with small utf8 inputs and any size base64 inputs.

PR-URL: https://github.com/iojs/io.js/pull/1209
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Nicu Micleușanu <micnic90@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2015-03-25 00:34:34 -04:00
Bert Belder 3d46fefe0c win,node-gyp: allow node.exe/iojs.exe to be renamed
On Windows, when node or io.js attempts to dynamically load a compiled
addon, the compiled addon tries to load node.exe or iojs.exe again -
depending on which import library the module used when it was linked.
This makes it impossible to rename node.exe or iojs.exe, because when
that happens the module can't find its dependencies.

With this patch, a delay-load hook is added to all modules that are
compiled with node-gyp. The delay-load hook ensures that whenever a
module tries to load imports from node.exe/iojs.exe, it'll just refer
back to the process image, thus making it possible to rename the
iojs/node binary.

Bug: https://github.com/iojs/io.js/issues/751
Bug: https://github.com/iojs/io.js/issues/965
Upstream PR: https://github.com/TooTallNate/node-gyp/pull/599

PR-URL: https://github.com/iojs/io.js/pull/1251
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-03-24 21:18:26 -07:00
Olov Lassus c9207f7fc2 fs: fix corruption in writeFile and writeFileSync
1. writeFileSync bumps position incorrectly, causing it to drift in
iteration three and onwards.

2. Append mode files will get corrupted in the middle if writeFile or
writeFileSync iterates multiple times, unless running on Linux. position
starts out as null so first write is OK, but then position will refer to
a location inside an existing file, corrupting that data. Linux ignores
position for append mode files so it doesn't happen there.

This commit fixes these two related issues by bumping position correctly
and by always using null as the position argument to write/writeSync for
append mode files.

PR-URL: https://github.com/iojs/io.js/pull/1063
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-03-24 18:18:16 -07:00
Roman Reiss 4e9bf93e9c doc: clarify real name requirement
CONTRIBUTING.md didn't make our rule for requiring real names from
contributors clear enough. This commit shall clarify that part.

Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
PR-URL: https://github.com/iojs/io.js/pull/1250
2015-03-24 23:47:43 +01:00
Roman Reiss e84dd5f651 doc: document repl on-demand module loading
Fixes: https://github.com/iojs/io.js/issues/992
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
PR-URL: https://github.com/iojs/io.js/pull/1249
2015-03-24 22:10:26 +01:00
Mayhem 1832743e18 lib: add missing `new` for errors lib/*.js
Not including `new` adds a useless frame and removes a potentially
useful frame.

PR-URL: https://github.com/iojs/io.js/pull/1246
Reviewed-By: Petka Antonov <petka_antonov@hotmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
2015-03-24 12:42:15 -07:00
Alex Yursha 7dd5e824be assert: simplify logic of testing buffer equality
Delegate buffer equality check to `buffer.equals()`

PR-URL: https://github.com/iojs/io.js/pull/1171
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Christian Vaagland Tellnes <christian@tellnes.com>
2015-03-23 19:10:04 -07:00
cjihrig 269e46be37 deps: make node-gyp work with io.js
Every npm version bump requires a few patches to be floated on
node-gyp for io.js compatibility. These patches are found in
03d199276e,
5de334c230, and
da730c76e9. This commit squashes
them into a single commit.

PR-URL: https://github.com/iojs/io.js/pull/990
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-23 16:31:42 -07:00
Forrest L Norvell b542fb94a4 deps: upgrade npm to 2.7.3
PR-URL: https://github.com/iojs/io.js/pull/1219
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-03-23 16:31:02 -07:00
Ben Noordhuis 2e5b87a147 src: remove unnecessary environment lookups
Remove some unnecessary environment lookups and delete a few superfluous
HandleScope variables.

PR-URL: https://github.com/iojs/io.js/pull/1238
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-03-23 10:40:45 +01:00
Ben Noordhuis 7e88a9322c src: make accessors immune to context confusion
It's possible for an accessor or named interceptor to get called with
a different execution context than the one it lives in, see the test
case for an example using the debug API.

This commit fortifies against that by passing the environment as a
data property instead of looking it up through the current context.

Fixes: https://github.com/iojs/io.js/issues/1190 (again)
PR-URL: https://github.com/iojs/io.js/pull/1238
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-03-23 10:40:12 +01:00
Rod Vagg 20c4498e76 Working on v1.6.3 2015-03-23 16:28:45 +11:00
Rod Vagg 33c57354aa 2015-03-23 io.js v1.6.2 Release
Notable Changes:

* Windows: The ongoing work in improving the state of Windows support
  has resulted in full test suite passes once again. As noted in the
  release notes for v1.4.2, CI system and configuration problems
  prevented it from properly reporting problems with the Windows
  tests, the problems with the CI and the codebase appear to have been
  fully resolved.
* FreeBSD: A kernel bug impacting io.js/Node.js was discovered and a
  patch has been introduced to prevent it causing problems for io.js
  (Fedor Indutny) #1218.
* module: you can now require('.') instead of having to require('./'),
  this is considered a bugfix (Michaël Zasso) #1185.
* v8: updated to 4.1.0.25 including patches for --max_old_space_size
  values above 4096 and Solaris support, both of which are already
  included in io.js.
2015-03-23 16:26:28 +11:00
Connor Peet 849319a260 util: Check input to util.inherits
PR-URL: https://github.com/iojs/io.js/pull/1240
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Petka Antonov <petka_antonov@hotmail.com>
2015-03-22 20:45:35 -07:00
Johan Bergström fe4434b77a deps: upgrade v8 to 4.1.0.25
PR-URL: https://github.com/iojs/io.js/pull/1224
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-23 13:28:27 +11:00
Ben Noordhuis 9705a34e96 test: move sequential/test-signal-unregister
Move sequential/test-signal-unregister to test/parallel, it doesn't
need to run in sequential mode.

PR-URL: https://github.com/iojs/io.js/pull/1227
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-03-23 00:56:16 +01:00
Ben Noordhuis 10a9c00563 test: fix timing issue in signal test
Change sequential/test-signal-unregister so it doesn't use fixed
timeouts for sending the signal and expecting the child to quit.

Fixes: https://github.com/iojs/io.js/issues/1223
PR-URL: https://github.com/iojs/io.js/pull/1227
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-03-23 00:55:34 +01:00
Ben Noordhuis cf081a4712 vm: fix crash on fatal error in debug context
Ensure that the debug context has an Environment assigned in case
a fatal error is raised.

The fatal exception handler in node.cc is not equipped to deal with
contexts that don't have one and can't easily be taught that due to
a deficiency in the V8 API: there is no way for the embedder to tell
if the data index is in use.

Fixes: https://github.com/iojs/io.js/issues/1190
PR-URL: https://github.com/iojs/io.js/pull/1229
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-03-22 20:07:49 +01:00
Rod Vagg d8f383ba3f doc: update AUTHORS list
Update AUTHORS file using tools/update-authors.sh

PR-URL: https://github.com/iojs/io.js/pull/1234
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-23 00:37:08 +11:00
Mathieu Darse bc9c1a5a7b doc: fix typo in CHANGELOG
PR-URL: https://github.com/iojs/io.js/pull/1230
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-03-22 17:32:28 +11:00
Fedor Indutny 9ae1a61214 node: ensure that streams2 won't `.end()` stdin
Stdin is purely read-only stream. Although, `net.Socket` might be used
to create it if stdin is in fact a Pipe or TCP socket, the
`stream.Duplex` should not try to call `.end()` on it.

Fix: https://github.com/iojs/io.js/issues/1068
PR-URL: https://github.com/iojs/io.js/pull/1233
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
2015-03-21 19:51:08 -07:00
Brendan Ashworth 999fbe9d96 test: fix crypto-binary-default bad crypto check
This commit fixes a small bug introduced in 671fbd5
that caused the test to not be run. crypto was properly
checked, but since tls was not imported, a TypeError
would be thrown in the `try {} catch {}` block and
falsely reported as no crypto.

This is now fixed.

PR-URL: https://github.com/iojs/io.js/pull/1141
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-03-21 17:22:27 -07:00
Ben Noordhuis 99c79f8d41 doc: call js function in null context
It's good practice now to call JS functions that don't execute in a
specific scope with v8::Null() as the receiver.  Update the addons
documentation.

PR-URL: https://github.com/iojs/io.js/pull/1125
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-03-21 14:05:20 +01:00
Ben Noordhuis 55abf34be5 doc: don't use `using namespace v8`
Wholesale importing an entire namespace with `using namespace` is a bad
practice.  Remove it from the addons documentation and replace it with
proper `using` directives.  Wrap code in a namespace while we are here.

PR-URL: https://github.com/iojs/io.js/pull/1125
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-03-21 14:05:18 +01:00
Ben Noordhuis c4e1b82120 doc: replace v8::Handle<T> with v8::Local<T>
v8::Handle is on its way out, to be replaced with v8::Local.  Update the
addons documentation accordingly.

PR-URL: https://github.com/iojs/io.js/pull/1125
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-03-21 14:05:15 +01:00
Ben Noordhuis 2f1b78347c doc: remove unnecessary v8::HandleScopes
Remove unnecessary v8::HandleScope uses from the addons documentation.

C++ API callbacks run in an implicit v8::HandleScope, there is no need
to declare one in the callback function.

PR-URL: https://github.com/iojs/io.js/pull/1125
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-03-21 14:05:11 +01:00
Ben Noordhuis 409d413363 doc: remove uses of v8::Isolate::GetCurrent()
v8::Isolate::GetCurrent() is slated for deprecation.  Replace its uses
in the addons documentation with v8::Object::GetIsolate(), etc.

PR-URL: https://github.com/iojs/io.js/pull/1125
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-03-21 14:03:02 +01:00
Ben Noordhuis 2b3b2d392f test: add setTimeout/setInterval multi-arg tests
It turns out we have little to no test coverage for setTimeout() and
setInterval() calls with optional arguments.  Now we do.

PR-URL: https://github.com/iojs/io.js/pull/1221
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-03-20 23:42:27 +01:00
Ben Noordhuis 33fea6ed5f lib: don't penalize setInterval() common case
The common case is where setInterval() is called with two arguments,
the callback and the timeout.  Specifying optional arguments in
the parameter list forces common case calls to go through an arguments
adaptor stack frame.

PR-URL: https://github.com/iojs/io.js/pull/1221
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-03-20 23:42:26 +01:00
Ben Noordhuis 31da9758a0 lib: don't penalize setTimeout() common case
The common case is where setTimeout() is called with two arguments,
the callback and the timeout.  Specifying optional arguments in the
parameter list forces common case calls to go through an arguments
adaptor stack frame.

PR-URL: https://github.com/iojs/io.js/pull/1221
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-03-20 23:42:26 +01:00
Fedor Indutny b64983d77c src: reset signal handler to SIG_DFL on FreeBSD
FreeBSD has a nasty bug with SA_RESETHAND reseting the SA_SIGINFO,
that is in turn set for a libthr wrapper. This leads to a crash.
Work around the issue by manually setting SIG_DFL in the signal
handler.

Fix: https://github.com/joyent/node/issues/9326
PR-URL: https://github.com/iojs/io.js/pull/1218
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-20 14:10:35 -07:00
Michaël Zasso 6fc5e95354 module: allow require('.')
Previously, the minimal argument to require the current directory was
require('./'). This commits allows to skip the trailing slash.

Fixes: https://github.com/iojs/io.js/issues/1178
PR-URL: https://github.com/iojs/io.js/pull/1185
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Christian Tellnes <christian@tellnes.no>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-03-20 18:17:25 +01:00
Rod Vagg a0d32ff5ae Working on v1.6.2 2015-03-20 13:24:09 +11:00
Rod Vagg 4b91d502b1 2015-03-20 io.js v1.6.1 Release
Notable Changes:

* path: New type-checking on path.resolve()
  <https://github.com/iojs/io.js/pull/1153> uncovered some edge-cases
  being relied upon in the wild, most notably path.dirname(undefined).
  Type-checking has been loosened for path.dirname(), path.basename(),
  and path.extname(), (Colin Ihrig)
  <https://github.com/iojs/io.js/pull/1216>.
* querystring: Internal optimizations in querystring.parse() and
  querystring.stringify() <https://github.com/iojs/io.js/pull/847>
  prevented Number literals from being properly converted via
  querystring.escape() <https://github.com/iojs/io.js/pull/1208>,
  exposing a blind-spot in the test suite. The bug and the tests have
  now been fixed (Jeremiah Senkpiel)
  <https://github.com/iojs/io.js/pull/1213>.
2015-03-20 13:19:18 +11:00
Jeremiah Senkpiel c9aec2b716 querystring: fix broken stringifyPrimitive
stringifyPrimitive has always failed to stringify numbers since its
introduction in 422d3c9. This went uncaught due to encodeURIComponent's
string coercion.

Fixes: https://github.com/iojs/io.js/issues/1208
PR-URL: https://github.com/iojs/io.js/pull/1213
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Brian White <mscdex@mscdex.net>
2015-03-19 21:47:41 -04:00
Jeremiah Senkpiel a89f5c2156 querystring: parse numbers correctly
Fixes a number parsing regression introduced in 85a92a3

Fixes: https://github.com/iojs/io.js/issues/1208
PR-URL: https://github.com/iojs/io.js/pull/1213
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Brian White <mscdex@mscdex.net>
2015-03-19 21:45:38 -04:00
cjihrig 8de78e470d path: reduce type checking on some methods
a465840313 added strict type
checking for the methods in the path module. However, dirname(),
basename(), and extname() actually had some undocumented uses
in the wild. This commit loosens the type checking on those
methods.

Fixes: https://github.com/iojs/io.js/issues/1215
PR-URL: https://github.com/iojs/io.js/pull/1216
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-03-19 21:11:12 -04:00
Johan Bergström 3b9eab9779 build: make check aliases test
A common convention in auto* is to call make check rather than
make test. Let one alias the other

PR-URL: https://github.com/iojs/io.js/pull/1211
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-20 10:43:09 +11:00
Ben Noordhuis 4c731042d4 configure: use cc and c++ as defaults on os x
Commit 8b2363d ("configure: use gcc and g++ as CC and CXX defaults")
switches the CC and CXX defaults but it turns out that GYP uses cc
and c++ as defaults on OS X.

It also made the configure script complain about old compilers because
the xcode gcc identifies as v4.2.1, whereas cc is less ambiguous about
it being a clang hybrid.

PR-URL: https://github.com/iojs/io.js/pull/1210
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-03-19 23:48:39 +01:00
Ben Noordhuis 2034137385 smalloc: don't mix malloc() and new char[]
It's technically undefined behavior to mix malloc with delete[] and
new char[] with free().  smalloc was using new char[] in one place and
malloc() in another but in both cases the memory was freed with free().

PR-URL: https://github.com/iojs/io.js/pull/1205
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-03-19 22:34:17 +01:00
Chris Dickinson 465552142f Working on v1.6.1 2015-03-19 11:28:03 -07:00
Chris Dickinson 8e3a9d8de0 2015-03-19 io.js v1.6.0 Release
Notable Changes:

* node: a new -r or --require command-line option can be used to
  pre-load modules at start-up (Ali Ijaz Sheikh)
* querystring: parse() and stringify() are now faster (Brian White)
* http: the http.ClientRequest#flush() method has been deprecated and
  replaced with http.ClientRequest#flushHeaders() to match the same
  change now in Node.js v0.12 as per
  https://github.com/joyent/node/pull/9048 (Yosuke Furukawa)
* net: allow server.listen() to accept a String option for port, e.g.
  { port: "1234" }, to match the same option being accepted in
  net.connect() as of https://github.com/joyent/node/pull/9268 (Ben
  Noordhuis)
* tls: further work on the reported memory leak although there appears
  to be a minor leak remaining for the use-case in question, track
  progress at https://github.com/iojs/io.js/issues/1075.
* v8: backport a fix for an integer overflow when --max_old_space_size
  values above 4096 are used (Ben Noordhuis)
* platforms: the io.js CI system now reports passes on FreeBSD and
  SmartOS (_Solaris_).
* npm: upgrade npm to 2.7.1. See the npm CHANGELOG.md for details.
  https://github.com/npm/npm/blob/master/CHANGELOG.md#v271-2015-03-05
2015-03-19 11:12:05 -07:00
Shigeki Ohtsu a84ea66b35 deps: upgrade to openssl-1.0.1m
All sources are just extracted from tarball into deps/openssl/openssl.

change all openssl/include/openssl/*.h to include resolved symbolic
links and openssl/crypto/opensslconf.h to refer config/opensslconf.h

sha256-x86_64.pl does not exist in the origin openssl distribution. It
was copied from sha512-x86_64.pl and both sha256/sha512 scripts were
modified so as to generates only one asm file specified as its key
hash length.

`x86masm.pl` was mistakenly using .486 instruction set, why `cpuid`
(and perhaps others) are requiring .686.

removed vpaesni-x86_64.asm in x64-win32-masm - it is no longer used.

Fixes: https://github.com/iojs/io.js/issues/1186
PR-URL: https://github.com/iojs/io.js/pull/1206
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-19 10:08:13 -07:00
Aleksanteri Negru-Vode 3bc445f6c2 doc: fix a broken collaborator github link
PR-URL: https://github.com/iojs/io.js/pull/1204
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-03-19 13:02:57 -04:00
Thorsten Lorenz 813a536126 buffer: removing duplicate code
- using an overload of Alloc that does the same that was being done
  inside `Buffer::New`

The overload we now call inside `smalloc.cc` takes care of the same as
the code that was removed:

    if (length == 0)
      return Alloc(env, obj, nullptr, length, type);

    char* data = static_cast<char*>(malloc(length));
    if (data == nullptr) {
      FatalError("node::smalloc::Alloc(v8::Handle<v8::Object>, size_t,"
                  " v8::ExternalArrayType)", "Out Of Memory");
    }

    Alloc(env, obj, data, length, type);

PR-URL: https://github.com/iojs/io.js/pull/1144
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-03-19 13:27:35 +01:00
Ali Ijaz Sheikh 1514b82355 src: add -r/--require flags for preloading modules
This patch adds a command line option (-r/--require) that allows one
to provide modules on the command line that will be 'required' during
node startup. This can be useful for debugging, tracing, memory leak
analysis etc. to be preloaded without explicit changes to the user
script. The option can be repeated to preload multiple modules.

PR-URL: https://github.com/iojs/io.js/pull/881
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-03-19 21:42:16 +11:00
Rod Vagg f600111d82 test: cache lazy properties, fix style nits
inFreeBSDJail involves an execSync() and is used by localhost_ipv4 so
will be unnecessarily expensive, so cache both values and reuse
rather than re-evaluate each time.

Renamed localhost_ipv4 to localhostIPv4 for style consistency.

PR-URL: https://github.com/iojs/io.js/pull/1196
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-03-19 16:27:45 +11:00
Fedor Indutny 3038b8ee6a test: double timeout in tls-wrap-timeout.js
The test is timing dependent, ensure that it won't fail on the busy CI
boxes.

Fix: https://github.com/iojs/io.js/issues/1200
PR-URL: https://github.com/iojs/io.js/pull/1201
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-03-18 21:47:03 -07:00
Jeremiah Senkpiel dd37fb4c48 build: remove incorrect argument in vcbuild.bat
This change had been incorrectly committed in f19e9b6

PR-URL: https://github.com/iojs/io.js/pull/1198
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-03-18 21:30:15 -04:00