Browse Source

Merge remote branch 'origin/v0.6'

Conflicts:
	deps/v8/src/debug.cc
	deps/v8/src/version.cc
	src/node_version.h
v0.7.4-release
Ryan Dahl 13 years ago
parent
commit
2003593143
  1. 14
      .travis.yml
  2. 7
      ChangeLog
  3. 6
      LICENSE
  4. 2
      README.md
  5. 21
      deps/npm/lib/utils/tar.js
  6. 10
      deps/uv/src/unix/core.c
  7. 1
      deps/uv/src/unix/error.c
  8. 4
      deps/v8/test/mjsunit/mjsunit.status
  9. 15
      doc/index.html
  10. 15
      doc/template.html
  11. 2
      doc/v0.4_announcement.html
  12. 2
      lib/child_process.js
  13. 16
      lib/net.js
  14. 11
      lib/tty.js
  15. 30
      src/handle_wrap.cc
  16. 1
      src/handle_wrap.h
  17. 6
      src/node.cc
  18. 7
      src/node.js
  19. 1
      src/pipe_wrap.cc
  20. 1
      src/tty_wrap.cc
  21. 6
      test/simple/test-fs-long-path.js
  22. 32
      test/simple/test-process-exit.js
  23. 2
      test/simple/test-setproctitle.js
  24. 27
      test/simple/test-stdin-child-proc.js
  25. 37
      test/simple/test-stdin-pause-resume.js
  26. 4
      tools/osx-pkg.pmdoc/index.xml
  27. 2
      wscript

14
.travis.yml

@ -0,0 +1,14 @@
language: node_js
before_script:
- "./configure"
- "make"
script:
- "make test"
notifications:
email: false
irc:
- "irc.freenode.net#libuv"

7
ChangeLog

@ -1,3 +1,10 @@
2011.12.04, Version 0.6.5 (stable)
* npm workaround Windows antivirus software (isaacs)
* Upgrade V8 to 3.6.6.11
2011.12.02, Version 0.6.4 (stable), 9170077f13e5e5475b23d1d3c2e7f69bfe139727
* doc improvements (Kyle Young, Tim Oxley, Roman Shtylman, Mathias Bynens)

6
LICENSE

@ -79,8 +79,8 @@ The externally maintained libraries used by Node are:
licensed under a permissive free software license. See
deps/zlib/LICENSE.
- deps/npm NPM is a package manager program copyright 2009, 2010, 2011
Isaac Z. Schlueter and licensed under MIT. NPM includes several
- deps/npm npm is a package manager program copyright 2009, 2010, 2011
Isaac Z. Schlueter and licensed under MIT. npm includes several
subpackages MIT or Apache licenses, see deps/npm/LICENSE for more
information. NPM is included in the Node .msi and .pkg distributions
information. npm is included in the Node .msi and .pkg distributions
but not in the Node binary itself.

2
README.md

@ -1,4 +1,4 @@
Evented I/O for V8 javascript.
Evented I/O for V8 javascript. [![Build Status](https://secure.travis-ci.org/joyent/node.png)](http://travis-ci.org/joyent/node)
===
### To build:

21
deps/npm/lib/utils/tar.js

@ -144,7 +144,8 @@ function unpack_ ( tarball, unpackTarget, dMode, fMode, uid, gid, cb ) {
rm(unpackTarget, function (er) {
if (er) return cb(er)
log.verbose(unpackTarget, "rm'ed")
fs.rename(folder, unpackTarget, function (er) {
moveIntoPlace(folder, unpackTarget, function (er) {
if (er) return cb(er)
log.verbose([folder, unpackTarget], "renamed")
// curse you, nfs! It will lie and tell you that the
@ -161,6 +162,24 @@ function unpack_ ( tarball, unpackTarget, dMode, fMode, uid, gid, cb ) {
})
}
// on Windows, A/V software can lock the directory, causing this
// to fail with an EACCES. Try again on failure, for up to 1 second.
// XXX Fix this by not unpacking into a temp directory, instead just
// renaming things on the way out of the tarball.
function moveIntoPlace (folder, unpackTarget, cb) {
var start = Date.now()
fs.rename(folder, unpackTarget, function CB (er) {
if (er
&& process.platform === "win32"
&& er.code === "EACCES"
&& Date.now() - start < 1000) {
return fs.rename(folder, unpackTarget, CB)
}
cb(er)
})
}
function gunzTarPerm (tarball, tmp, dMode, fMode, uid, gid, cb) {
if (!dMode) dMode = npm.modes.exec
if (!fMode) fMode = npm.modes.file

10
deps/uv/src/unix/core.c

@ -169,7 +169,15 @@ uv_loop_t* uv_loop_new(void) {
void uv_loop_delete(uv_loop_t* loop) {
uv_ares_destroy(loop, loop->channel);
ev_loop_destroy(loop->ev);
free(loop);
#ifndef NDEBUG
memset(loop, 0, sizeof *loop);
#endif
if (loop == default_loop_ptr)
default_loop_ptr = NULL;
else
free(loop);
}

1
deps/uv/src/unix/error.c

@ -82,6 +82,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case EHOSTUNREACH: return UV_EHOSTUNREACH;
case EAI_NONAME: return UV_ENOENT;
case ESRCH: return UV_ESRCH;
case ETIMEDOUT: return UV_ETIMEDOUT;
default: return UV_UNKNOWN;
}

4
deps/v8/test/mjsunit/mjsunit.status

@ -34,6 +34,10 @@ bugs: FAIL
# Fails.
regress/regress-1119: FAIL
#############################################################################
# Fails due to r10102 which reverts precise stepping on the 3.6 branch.
debug-step-2: FAIL
##############################################################################
# Issue 1845: http://code.google.com/p/v8/issues/detail?id=1845

15
doc/index.html

@ -26,7 +26,7 @@
<li><a href="#download">Download</a></li>
<li><a href="https://github.com/joyent/node/wiki/ChangeLog">ChangeLog</a></li>
<li><a href="#about">About</a></li>
<li><a href="http://nodejs.org/docs/v0.6.4/api">v0.6.4 docs</a></li>
<li><a href="http://nodejs.org/docs/v0.6.5/api">v0.6.5 docs</a></li>
<br/>
<li><a href="https://github.com/joyent/node/wiki">Wiki</a></li>
<li><a href="http://blog.nodejs.org/">Blog</a></li>
@ -105,14 +105,15 @@ server.listen(1337, "127.0.0.1");
<h2 id="download">Download</h2>
<p>2011.12.02 v0.6.4
<p>2011.12.04 v0.6.5
<ul class="release">
<li><a href="http://nodejs.org/dist/v0.6.4/node-v0.6.4.tar.gz"><code>node-v0.6.4.tar.gz</code>
<li><a href="http://nodejs.org/dist/v0.6.5/node-v0.6.5.tar.gz"><code>node-v0.6.5.tar.gz</code>
Source code</a> (<a href="https://github.com/joyent/node/wiki/Installation">build instructions</a>)
<li><a href="http://nodejs.org/dist/v0.6.4/node-v0.6.4.msi"><code>node-v0.6.4.msi</code> Windows installer</a>
<li><a href="http://nodejs.org/dist/v0.6.4/node-v0.6.4.pkg"><code>node-v0.6.4.pkg</code> Macintosh installer</a>
<li><a href="http://nodejs.org/docs/v0.6.4/api/index.html">Documentation</a>
<li><a href="http://nodejs.org/dist/v0.6.4">Other release files
<li><a href="http://nodejs.org/dist/v0.6.5/node-v0.6.5.msi"><code>node-v0.6.5.msi</code> Windows installer</a>
<li><a href="http://nodejs.org/dist/v0.6.5/node-v0.6.5.pkg"><code>node-v0.6.5.pkg</code> Macintosh installer</a>
<li><a href="http://nodejs.org/docs/v0.6.5/api/index.html">Documentation</a>
<li><a href="https://raw.github.com/joyent/node/v0.6.5/LICENSE">License</a>
<li><a href="http://nodejs.org/dist/v0.6.5">Other release files
(like <code>.exe</code> and <code>.pdb</code>)</a>
</ul>

15
doc/template.html

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8" />
<title>{{section}}Node.js v0.6.4 Manual &amp; Documentation</title>
<title>{{section}}Node.js v0.6.5 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css" />
<link rel="stylesheet" href="assets/sh.css" />
<link rel="canonical" href="http://nodejs.org/docs/latest/api/{{filename}}.html"/>
@ -10,7 +10,7 @@
<body>
<div id="container">
<header>
<h1>Node.js v0.6.4 Manual &amp; Documentation</h1>
<h1>Node.js v0.6.5 Manual &amp; Documentation</h1>
<div id="gtoc">
<p><a href="index.html">Index</a> | <a href="all.html">View on single page</a></p>
</div>
@ -21,5 +21,16 @@
<script src="assets/sh_main.js"></script>
<script src="assets/sh_javascript.min.js"></script>
<script>highlight(undefined, undefined, 'pre');</script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ?
"https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-10874194-2");
pageTracker._trackPageview();
} catch(err) {}</script>
<script type="text/javascript">highlight(undefined, undefined, 'pre');</script>
</body>
</html>

2
doc/v0.4_announcement.html

@ -43,7 +43,7 @@
<li> With a good amount of experience now, some modifications to the
module loading system were made to better support package managers.
In particular, NPM was forced to resort to deep symlinks and "shim"
In particular, npm was forced to resort to deep symlinks and "shim"
modules to work around missing features in <code>require()</code>. The main
changes are:
<ol>

2
lib/child_process.js

@ -33,7 +33,7 @@ var Pipe;
function createPipe(ipc) {
// Lazy load
if (!Pipe) {
Pipe = new process.binding('pipe_wrap').Pipe;
Pipe = process.binding('pipe_wrap').Pipe;
}
return new Pipe(ipc);

16
lib/net.js

@ -101,7 +101,7 @@ function Socket(options) {
if (typeof options == 'number') {
// Legacy interface.
// Must support legacy interface. NPM depends on it.
// Must support legacy interface. Old versions of npm depend on it.
// https://github.com/isaacs/npm/blob/c7824f412f0cb59d6f55cf0bc220253c39e6029f/lib/utils/output.js#L110
var fd = options;
@ -194,13 +194,25 @@ Object.defineProperty(Socket.prototype, 'bufferSize', {
Socket.prototype.pause = function() {
this._handle.readStop();
if (this._handle) {
this._handle.readStop();
// this adds an undesireable boundary crossing for pipe streams.
// the .unref() method is omitted on TCP streams, because it is
// unnecessary.
if (this._handle.unref) this._handle.unref();
}
};
Socket.prototype.resume = function() {
if (this._handle) {
this._handle.readStart();
// this adds an undesireable boundary crossing for pipe streams.
// the .ref() method is omitted on TCP streams, because it is
// unnecessary.
if (this._handle.ref) this._handle.ref();
}
};

11
lib/tty.js

@ -83,8 +83,19 @@ function ReadStream(fd) {
this.on('newListener', onNewListener);
}
inherits(ReadStream, net.Socket);
exports.ReadStream = ReadStream;
ReadStream.prototype.pause = function() {
this._handle.unref();
return net.Socket.prototype.pause.call(this);
};
ReadStream.prototype.resume = function() {
this._handle.ref();
return net.Socket.prototype.resume.call(this);
};
ReadStream.prototype.isTTY = true;

30
src/handle_wrap.cc

@ -64,8 +64,10 @@ Handle<Value> HandleWrap::Unref(const Arguments& args) {
UNWRAP
// Calling this function twice should never happen.
assert(wrap->unref == false);
// Calling unnecessarily is a no-op
if (wrap->unref) {
return v8::Undefined();
}
wrap->unref = true;
uv_unref(uv_default_loop());
@ -74,6 +76,24 @@ Handle<Value> HandleWrap::Unref(const Arguments& args) {
}
// Adds a reference to keep uv alive because of this thing.
Handle<Value> HandleWrap::Ref(const Arguments& args) {
HandleScope scope;
UNWRAP
// Calling multiple times is a no-op
if (!wrap->unref) {
return v8::Undefined();
}
wrap->unref = false;
uv_ref(uv_default_loop());
return v8::Undefined();
}
Handle<Value> HandleWrap::Close(const Arguments& args) {
HandleScope scope;
@ -82,10 +102,8 @@ Handle<Value> HandleWrap::Close(const Arguments& args) {
assert(!wrap->object_.IsEmpty());
uv_close(wrap->handle__, OnClose);
if (wrap->unref) {
uv_ref(uv_default_loop());
wrap->unref = false;
}
HandleWrap::Ref(args);
wrap->StateChange();

1
src/handle_wrap.h

@ -49,6 +49,7 @@ class HandleWrap {
static void Initialize(v8::Handle<v8::Object> target);
static v8::Handle<v8::Value> Close(const v8::Arguments& args);
static v8::Handle<v8::Value> Unref(const v8::Arguments& args);
static v8::Handle<v8::Value> Ref(const v8::Arguments& args);
protected:
HandleWrap(v8::Handle<v8::Object> object, uv_handle_t* handle);

6
src/node.cc

@ -2217,8 +2217,12 @@ static void PrintHelp() {
" --vars print various compiled-in variables\n"
" --max-stack-size=val set max v8 stack size (bytes)\n"
"\n"
"Enviromental variables:\n"
"Environment variables:\n"
#ifdef _WIN32
"NODE_PATH ';'-separated list of directories\n"
#else
"NODE_PATH ':'-separated list of directories\n"
#endif
" prefixed to the module search path.\n"
"NODE_MODULE_CONTEXTS Set to 1 to load modules in their own\n"
" global contexts.\n"

7
src/node.js

@ -336,8 +336,13 @@
};
startup.processKillAndExit = function() {
var exiting = false;
process.exit = function(code) {
process.emit('exit', code || 0);
if (!exiting) {
exiting = true;
process.emit('exit', code || 0);
}
process.reallyExit(code || 0);
};

1
src/pipe_wrap.cc

@ -85,6 +85,7 @@ void PipeWrap::Initialize(Handle<Object> target) {
NODE_SET_PROTOTYPE_METHOD(t, "close", HandleWrap::Close);
NODE_SET_PROTOTYPE_METHOD(t, "unref", HandleWrap::Unref);
NODE_SET_PROTOTYPE_METHOD(t, "ref", HandleWrap::Ref);
NODE_SET_PROTOTYPE_METHOD(t, "readStart", StreamWrap::ReadStart);
NODE_SET_PROTOTYPE_METHOD(t, "readStop", StreamWrap::ReadStop);

1
src/tty_wrap.cc

@ -69,6 +69,7 @@ class TTYWrap : StreamWrap {
NODE_SET_PROTOTYPE_METHOD(t, "close", HandleWrap::Close);
NODE_SET_PROTOTYPE_METHOD(t, "unref", HandleWrap::Unref);
NODE_SET_PROTOTYPE_METHOD(t, "ref", HandleWrap::Ref);
NODE_SET_PROTOTYPE_METHOD(t, "readStart", StreamWrap::ReadStart);
NODE_SET_PROTOTYPE_METHOD(t, "readStop", StreamWrap::ReadStop);

6
test/simple/test-fs-long-path.js

@ -19,6 +19,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var common = require('../common');
var fs = require('fs');
var path = require('path');
var assert = require('assert');
@ -26,9 +27,8 @@ var assert = require('assert');
var successes = 0;
// make a path that will be at least 260 chars long.
var cwd = process.cwd();
var fileNameLen = Math.max(260 - cwd.length - 1, 1);
var fileName = new Array(fileNameLen + 1).join('x');
var fileNameLen = Math.max(260 - common.tmpDir.length - 1, 1);
var fileName = path.join(common.tmpDir, new Array(fileNameLen + 1).join('x'));
var fullPath = path.resolve(fileName);
console.log({ filenameLength: fileName.length,

32
test/simple/test-process-exit.js

@ -0,0 +1,32 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var assert = require('assert');
// recursively calling .exit() should not overflow the call stack
var nexits = 0;
process.on('exit', function() {
assert.equal(nexits++, 0);
process.exit();
});
process.exit();

2
test/simple/test-setproctitle.js

@ -22,7 +22,7 @@
// Original test written by Jakub Lekstan <kuebzky@gmail.com>
// FIXME add sunos support
if ('linux darwin freebsd'.indexOf(process.platform) === -1) {
if ('linux freebsd'.indexOf(process.platform) === -1) {
console.error("Skipping test, platform not supported.");
process.exit();
}

27
test/simple/test-stdin-child-proc.js

@ -0,0 +1,27 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// This tests that pausing and resuming stdin does not hang and timeout
// when done in a child process. See test/simple/test-stdin-pause-resume.js
var child_process = require('child_process');
var path = require('path');
child_process.spawn(process.execPath,
[ path.resolve(__dirname, 'test-stdin-pause-resume.js') ]);

37
test/simple/test-stdin-pause-resume.js

@ -0,0 +1,37 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
console.error("before opening stdin");
process.stdin.resume();
console.error("stdin opened");
setTimeout(function() {
console.error("pausing stdin");
process.stdin.pause();
setTimeout(function() {
console.error("opening again");
process.stdin.resume();
setTimeout(function() {
console.error("pausing again");
process.stdin.pause();
console.error("should exit now");
}, 1);
}, 1);
}, 1);

4
tools/osx-pkg.pmdoc/index.xml

@ -12,8 +12,8 @@
\
/usr/local/bin/node\
\
NPM was installed at\
npm was installed at\
\
/usr/local/bin/npm\
\
Make sure that /usr/local/bin is in your $PATH.}]]></resource></locale></resources><flags/><item type="file">01local.xml</item><item type="file">02npm.xml</item><mod>properties.title</mod><mod>properties.userDomain</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>
Make sure that /usr/local/bin is in your $PATH.}]]></resource></locale></resources><flags/><item type="file">01local.xml</item><item type="file">02npm.xml</item><mod>properties.title</mod><mod>properties.userDomain</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>

2
wscript

@ -980,7 +980,7 @@ def install_npm(bld):
start_dir = bld.path.find_dir('deps/npm')
# The chmod=-1 is a Node hack. We changed WAF so that when chmod was set to
# -1 that the same permission in this tree are used. Necessary to get
# npm-cli.js to be executable without having to list every file in NPM.
# npm-cli.js to be executable without having to list every file in npm.
bld.install_files('${LIBDIR}/node_modules/npm',
start_dir.ant_glob('**/*'),
cwd=start_dir,

Loading…
Cancel
Save