From 671b5be6e9d74fec9e94b1ab88d2b2648c540078 Mon Sep 17 00:00:00 2001
From: Fedor Indutny
Date: Fri, 27 Sep 2013 23:47:13 +0400
Subject: [PATCH 01/35] tls: fix sporadic hang and partial reads
Do not decrement size in read loop, its used later, when comparing to
`bytesRead`.
fix #6270
NOTE: Original patch contributed by @roadrunner2
---
lib/tls.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/tls.js b/lib/tls.js
index a758c8e01c..fe94a5121f 100644
--- a/lib/tls.js
+++ b/lib/tls.js
@@ -447,10 +447,9 @@ CryptoStream.prototype._read = function read(size) {
var bytesRead = 0,
start = this._buffer.offset;
do {
- var read = this._buffer.use(this.pair.ssl, out, size);
+ var read = this._buffer.use(this.pair.ssl, out, size - bytesRead);
if (read > 0) {
bytesRead += read;
- size -= read;
}
// Handle and report errors
From 994ce4c99fb1e284bcfdc2500ae62e0138bf140e Mon Sep 17 00:00:00 2001
From: Ben Noordhuis
Date: Sat, 28 Sep 2013 10:27:11 +0200
Subject: [PATCH 02/35] src: turn uv_pipe_open() failures into exceptions
uv_pipe_open() is unlikely to fail but when it does, the failure should
not be quietly ignored. Raise the error as an exception.
See joyent/libuv#941.
---
src/pipe_wrap.cc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc
index 3952a0799c..14104b1a5d 100644
--- a/src/pipe_wrap.cc
+++ b/src/pipe_wrap.cc
@@ -269,9 +269,10 @@ Handle PipeWrap::Open(const Arguments& args) {
UNWRAP(PipeWrap)
- int fd = args[0]->IntegerValue();
-
- uv_pipe_open(&wrap->handle_, fd);
+ if (uv_pipe_open(&wrap->handle_, args[0]->Int32Value())) {
+ uv_err_t err = uv_last_error(wrap->handle_.loop);
+ return ThrowException(UVException(err.code, "uv_pipe_open"));
+ }
return scope.Close(v8::Null());
}
From d7234c8d50a1af73f60d2d3c0cc7eed17429a481 Mon Sep 17 00:00:00 2001
From: Timothy J Fontaine
Date: Mon, 30 Sep 2013 13:52:48 -0700
Subject: [PATCH 03/35] 2013.09.30, Version 0.10.20 (Stable)
* tls: fix sporadic hang and partial reads (Fedor Indutny)
- fixes "npm ERR! cb() never called!"
---
ChangeLog | 8 +++++++-
src/node_version.h | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 54cc5a2b96..95afb81362 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2013.09.24, Version 0.10.19 (Stable)
+2013.09.30, Version 0.10.20 (Stable)
+
+* tls: fix sporadic hang and partial reads (Fedor Indutny)
+ - fixes "npm ERR! cb() never called!"
+
+
+2013.09.24, Version 0.10.19 (Stable), 6b5e6a5a3ec8d994c9aab3b800b9edbf1b287904
* uv: Upgrade to v0.10.17
diff --git a/src/node_version.h b/src/node_version.h
index f02dbe3c2a..f30216795f 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -26,7 +26,7 @@
#define NODE_MINOR_VERSION 10
#define NODE_PATCH_VERSION 20
-#define NODE_VERSION_IS_RELEASE 0
+#define NODE_VERSION_IS_RELEASE 1
#ifndef NODE_TAG
# define NODE_TAG ""
From d537992d57b5f012206bcafdfd570c9b4cf07146 Mon Sep 17 00:00:00 2001
From: Timothy J Fontaine
Date: Mon, 30 Sep 2013 15:06:14 -0700
Subject: [PATCH 04/35] Now working on 0.10.21
---
src/node_version.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/node_version.h b/src/node_version.h
index f30216795f..3073630f97 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -24,9 +24,9 @@
#define NODE_MAJOR_VERSION 0
#define NODE_MINOR_VERSION 10
-#define NODE_PATCH_VERSION 20
+#define NODE_PATCH_VERSION 21
-#define NODE_VERSION_IS_RELEASE 1
+#define NODE_VERSION_IS_RELEASE 0
#ifndef NODE_TAG
# define NODE_TAG ""
From a63079f34cd29c0d599c43ab6142b271db2705a2 Mon Sep 17 00:00:00 2001
From: Timothy J Fontaine
Date: Mon, 30 Sep 2013 15:06:14 -0700
Subject: [PATCH 05/35] blog: Post for v0.10.20
---
doc/blog/release/v0.10.20.md | 59 ++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
create mode 100644 doc/blog/release/v0.10.20.md
diff --git a/doc/blog/release/v0.10.20.md b/doc/blog/release/v0.10.20.md
new file mode 100644
index 0000000000..70db1fe92c
--- /dev/null
+++ b/doc/blog/release/v0.10.20.md
@@ -0,0 +1,59 @@
+date: Mon Sep 30 15:05:41 PDT 2013
+version: 0.10.20
+category: release
+title: Node v0.10.20 (Stable)
+slug: node-v0-10-20-stable
+
+2013.09.30, Version 0.10.20 (Stable)
+
+* tls: fix sporadic hang and partial reads (Fedor Indutny)
+ - fixes "npm ERR! cb() never called!"
+
+
+Source Code: http://nodejs.org/dist/v0.10.20/node-v0.10.20.tar.gz
+
+Macintosh Installer (Universal): http://nodejs.org/dist/v0.10.20/node-v0.10.20.pkg
+
+Windows Installer: http://nodejs.org/dist/v0.10.20/node-v0.10.20-x86.msi
+
+Windows x64 Installer: http://nodejs.org/dist/v0.10.20/x64/node-v0.10.20-x64.msi
+
+Windows x64 Files: http://nodejs.org/dist/v0.10.20/x64/
+
+Linux 32-bit Binary: http://nodejs.org/dist/v0.10.20/node-v0.10.20-linux-x86.tar.gz
+
+Linux 64-bit Binary: http://nodejs.org/dist/v0.10.20/node-v0.10.20-linux-x64.tar.gz
+
+Solaris 32-bit Binary: http://nodejs.org/dist/v0.10.20/node-v0.10.20-sunos-x86.tar.gz
+
+Solaris 64-bit Binary: http://nodejs.org/dist/v0.10.20/node-v0.10.20-sunos-x64.tar.gz
+
+Other release files: http://nodejs.org/dist/v0.10.20/
+
+Website: http://nodejs.org/docs/v0.10.20/
+
+Documentation: http://nodejs.org/docs/v0.10.20/api/
+
+Shasums:
+```
+6f827b5bb1184160a58e0aac711791b610c30afd node-v0.10.20-darwin-x64.tar.gz
+89869942f09351a5256f9ff68c3e1c363f108e7a node-v0.10.20-darwin-x86.tar.gz
+b7c0a79acddfaeda8af221acdd18640ef5c62e8a node-v0.10.20-linux-x64.tar.gz
+709cd1a646447036abe3f57ea6e33bb1d411c229 node-v0.10.20-linux-x86.tar.gz
+dbe318556bc7a4d7ea47947600edcdb375a92d8e node-v0.10.20-sunos-x64.tar.gz
+b003527f645bfc8c65d890854e20c92edc1feb86 node-v0.10.20-sunos-x86.tar.gz
+34015dac5e517492fec6584cacd2d9864056107e node-v0.10.20-x86.msi
+a0408be15afd0b5d34b8762edab6420339a8c4ff node-v0.10.20.pkg
+d8777ac318627c1413f01358ea5c455f0f86e4b5 node-v0.10.20.tar.gz
+5f61f783345dc3663b03322d6387800d96560cd5 node.exe
+bb81cb60eae4c6be9238aa05b5245f29609b6f96 node.exp
+e06eab29b27de1908aa2cf624d438e15ee126640 node.lib
+2495f7a88f0085df5206c0d0cb44131cf9715156 node.pdb
+6036d6b1f2cf34a5055ed59b6519cb09cc6f86ff pkgsrc/nodejs-ia32-0.10.20.tgz
+9b743d9a5d80758e8cd9d436e165c9569fa9d0fd pkgsrc/nodejs-x64-0.10.20.tgz
+1b574ef4fe2ad61ce398415599f8f376b576e65d x64/node-v0.10.20-x64.msi
+7137043329a25c36ad24d11d8e4ce6e5ff8a72b2 x64/node.exe
+624c5bdb06ddd726457fa7b04197069ba021016b x64/node.exp
+f61da5166124895495bd72520d6b6f730acc1cbc x64/node.lib
+efa36de57eda469254fab252f24ef67c17f96f00 x64/node.pdb
+```
From b7f36e187d1b5362a72b50779aff182d7131d8f5 Mon Sep 17 00:00:00 2001
From: Ben Noordhuis
Date: Tue, 1 Oct 2013 08:35:24 +0200
Subject: [PATCH 06/35] doc: link to pre-built binaries, add install note
lLnk to http://nodejs.org/download/ and add a short primer on how to
extract the tarballs.
Fixes #6292.
---
README.md | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/README.md b/README.md
index 2f018e5f9a..12fd05aa5f 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,19 @@ Windows:
vcbuild.bat
+You can download pre-built binaries for various operating systems from
+[http://nodejs.org/download/](http://nodejs.org/download/). The Windows
+and OS X installers will prompt you for the location to install to.
+The tarballs are self-contained; you can extract them to a local directory
+with:
+
+ tar xzf /path/to/node---.tar.gz
+
+Or system-wide with:
+
+ cd /usr/local && tar --strip-components 1 -xzf \
+ /path/to/node---.tar.gz
+
### To run the tests:
Unix/Macintosh:
From d97ea06d885c6c614bbe1d073cc9167cb66fd564 Mon Sep 17 00:00:00 2001
From: Ben Noordhuis
Date: Sat, 5 Oct 2013 14:45:10 +0200
Subject: [PATCH 07/35] doc: add warning to fs.exists() documentation
Warn against the open-if-exists anti-pattern, it's susceptible to
race conditions.
---
doc/api/fs.markdown | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown
index 129f3c5767..f940e6364f 100644
--- a/doc/api/fs.markdown
+++ b/doc/api/fs.markdown
@@ -595,6 +595,13 @@ Then call the `callback` argument with either true or false. Example:
util.debug(exists ? "it's there" : "no passwd!");
});
+`fs.exists()` is an anachronism and exists only for historical reasons.
+There should almost never be a reason to use it in your own code.
+
+In particular, checking if a file exists before opening it is an anti-pattern
+that leaves you vulnerable to race conditions: another process may remove the
+file between the calls to `fs.exists()` and `fs.open()`. Just open the file
+and handle the error when it's not there.
## fs.existsSync(path)
From b011811a9ffec89721e6486e263e68db17546699 Mon Sep 17 00:00:00 2001
From: Ben Noordhuis
Date: Tue, 8 Oct 2013 11:25:22 +0200
Subject: [PATCH 08/35] fs: fix fs.truncate() file content zeroing bug
fs.truncate() and its synchronous sibling are implemented in terms of
open() + ftruncate(). Unfortunately, it opened the target file with
mode 'w' a.k.a. 'write-only and create or truncate at open'.
The subsequent call to ftruncate() then moved the end-of-file pointer
from zero to the requested offset with the net result of a file that's
neatly truncated at the right offset and filled with zero bytes only.
This bug was introduced in commit 168a5557 but in fairness, before that
commit fs.truncate() worked like fs.ftruncate() so it seems we've never
had a working fs.truncate() until now.
Fixes #6233.
---
lib/fs.js | 4 +--
test/simple/test-fs-truncate-GH-6233.js | 44 +++++++++++++++++++++++++
2 files changed, 46 insertions(+), 2 deletions(-)
create mode 100644 test/simple/test-fs-truncate-GH-6233.js
diff --git a/lib/fs.js b/lib/fs.js
index 222efd1af6..2cc9431e45 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -556,7 +556,7 @@ fs.truncate = function(path, len, callback) {
len = 0;
}
callback = maybeCallback(callback);
- fs.open(path, 'w', function(er, fd) {
+ fs.open(path, 'r+', function(er, fd) {
if (er) return callback(er);
binding.ftruncate(fd, len, function(er) {
fs.close(fd, function(er2) {
@@ -575,7 +575,7 @@ fs.truncateSync = function(path, len) {
len = 0;
}
// allow error to be thrown, but still close fd.
- var fd = fs.openSync(path, 'w');
+ var fd = fs.openSync(path, 'r+');
try {
var ret = fs.ftruncateSync(fd, len);
} finally {
diff --git a/test/simple/test-fs-truncate-GH-6233.js b/test/simple/test-fs-truncate-GH-6233.js
new file mode 100644
index 0000000000..472afdcab9
--- /dev/null
+++ b/test/simple/test-fs-truncate-GH-6233.js
@@ -0,0 +1,44 @@
+// 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 common = require('../common');
+var assert = require('assert');
+var fs = require('fs');
+
+var filename = common.tmpDir + '/truncate-file.txt';
+
+// Synchronous test.
+(function() {
+ fs.writeFileSync(filename, '0123456789');
+ assert.equal(fs.readFileSync(filename).toString(), '0123456789');
+ fs.truncateSync(filename, 5);
+ assert.equal(fs.readFileSync(filename).toString(), '01234');
+})();
+
+// Asynchronous test.
+(function() {
+ fs.writeFileSync(filename, '0123456789');
+ assert.equal(fs.readFileSync(filename).toString(), '0123456789');
+ fs.truncate(filename, 5, common.mustCall(function(err) {
+ if (err) throw err;
+ assert.equal(fs.readFileSync(filename).toString(), '01234');
+ }));
+})();
From 98c57c7c0724a3518f18a01a63fcc7bef2daf9f6 Mon Sep 17 00:00:00 2001
From: Dave Pacheco
Date: Fri, 4 Oct 2013 15:02:42 -0700
Subject: [PATCH 09/35] dtrace: backport two byte string fix
This is a partial backport of 5921158
Re #6309
Closes #6319
---
src/v8abbr.h | 16 ++++++
src/v8ustack.d | 136 +++++++++++++++++++++++++++++++++++++++----------
2 files changed, 125 insertions(+), 27 deletions(-)
diff --git a/src/v8abbr.h b/src/v8abbr.h
index 9a51e09f5d..7c662f4258 100644
--- a/src/v8abbr.h
+++ b/src/v8abbr.h
@@ -43,10 +43,24 @@
/* Instance types */
#define V8_IT_FIXEDARRAY V8DBG_TYPE_FIXEDARRAY__FIXED_ARRAY_TYPE
#define V8_IT_CODE V8DBG_TYPE_CODE__CODE_TYPE
+#define V8_IT_SCRIPT V8DBG_TYPE_SCRIPT__SCRIPT_TYPE
/* Node-specific offsets */
#define NODE_OFF_EXTSTR_DATA sizeof(void*)
+/*
+ * Not all versions of V8 have the offset for the "chars" array in the
+ * SeqTwoByteString class, but it's the same as the one for SeqOneByteString,
+ * which used to be called SeqAsciiString.
+ */
+#ifndef V8DBG_CLASS_SEQTWOBYTESTRING__CHARS__CHAR
+#ifdef V8DBG_CLASS_SEQONEBYTESTRING__CHARS__CHAR
+#define V8DBG_CLASS_SEQTWOBYTESTRING__CHARS__CHAR V8DBG_CLASS_SEQONEBYTESTRING__CHARS__CHAR
+#else
+#define V8DBG_CLASS_SEQTWOBYTESTRING__CHARS__CHAR V8DBG_CLASS_SEQASCIISTRING__CHARS__CHAR
+#endif
+#endif
+
/* Heap class->field offsets */
#define V8_OFF_HEAP(off) ((off) - 1)
@@ -82,5 +96,7 @@
V8_OFF_HEAP(V8DBG_CLASS_HEAPOBJECT__MAP__MAP)
#define V8_OFF_MAP_ATTRS \
V8_OFF_HEAP(V8DBG_CLASS_MAP__INSTANCE_ATTRIBUTES__INT)
+#define V8_OFF_TWOBYTESTR_CHARS \
+ V8_OFF_HEAP(V8DBG_CLASS_SEQTWOBYTESTRING__CHARS__CHAR)
#endif /* V8_ABBR_H */
diff --git a/src/v8ustack.d b/src/v8ustack.d
index d643f8fb8c..0b03bfa251 100644
--- a/src/v8ustack.d
+++ b/src/v8ustack.d
@@ -31,6 +31,9 @@
#define V8_MAP_PTR(ptr) \
((ptr & ~V8_HeapObjectTagMask) | V8_HeapObjectTag)
+#define V8_TYPE_SCRIPT(type) \
+ ((type) == V8_IT_SCRIPT)
+
/*
* Determine the encoding and representation of a V8 string.
*/
@@ -53,8 +56,11 @@
#define ASCII_SEQSTR(value) \
(V8_TYPE_STRING(value) && V8_STRENC_ASCII(value) && V8_STRREP_SEQ(value))
-#define ASCII_CONSSTR(value) \
- (V8_TYPE_STRING(value) && V8_STRENC_ASCII(value) && V8_STRREP_CONS(value))
+#define TWOBYTE_SEQSTR(value) \
+ (V8_TYPE_STRING(value) && !V8_STRENC_ASCII(value) && V8_STRREP_SEQ(value))
+
+#define IS_CONSSTR(value) \
+ (V8_TYPE_STRING(value) && V8_STRREP_CONS(value))
#define ASCII_EXTSTR(value) \
(V8_TYPE_STRING(value) && V8_STRENC_ASCII(value) && V8_STRREP_EXT(value))
@@ -123,14 +129,16 @@
* "len": the string length
*
* "attrs": the type identifier for the string, which indicates the
- * encoding and representation. We're only interested in ASCII
- * encoded strings whose representation is one of:
+ * encoding and representation. We're only interested in strings
+ * whose representation is one of:
+ *
+ * SeqOneByteString stored directly as a char array inside the object
*
- * SeqString stored directly as a char array inside the object
+ * SeqTwoByteString stored as a UTF-16 char array inside the object
*
- * ConsString pointer to two strings that should be concatenated
+ * ConsString pointer to two strings that should be concatenated
*
- * ExternalString pointer to a char* outside the V8 heap
+ * ExternalString pointer to a char* outside the V8 heap
*/
/*
@@ -141,27 +149,79 @@
this->map = V8_MAP_PTR(COPYIN_PTR(str + V8_OFF_HEAPOBJ_MAP)); \
attrs = COPYIN_UINT8(this->map + V8_OFF_MAP_ATTRS);
+#define APPEND_SEQSTR(str, len, attrs) \
+ APPEND_SEQONEBYTESTR(str, len, attrs) \
+ APPEND_SEQTWOBYTESTR(str, len, attrs)
+
/*
- * Print out the given SeqString, or do nothing if the string is not an ASCII
- * SeqString.
+ * Print out the given SeqOneByteString, or do nothing if the string is not an ASCII
+ * SeqOneByteString.
*/
-#define APPEND_SEQSTR(str, len, attrs) \
- dtrace:helper:ustack: \
- /!this->done && len > 0 && ASCII_SEQSTR(attrs)/ \
- { \
+#define APPEND_SEQONEBYTESTR(str, len, attrs) \
+ dtrace:helper:ustack: \
+ /!this->done && len > 0 && ASCII_SEQSTR(attrs)/ \
+ { \
copyinto(str + V8_OFF_STR_CHARS, len, this->buf + this->off); \
this->off += len; \
}
+/*
+ * LOOP_ITER: macro to paste "block" while "ivar" is less than "dynmax" and
+ * "statmax". The subsequent LOOP_{4,8} macros facilitate pasting the same
+ * thing 4 and 8 times, respectively. Like much of the rest of the code in this
+ * file, this is regrettably necessary given the constraints under which we're
+ * expected to run.
+ */
+#define LOOP_ITER(ivar, dynmax, statmax, block) \
+ ((ivar) < (dynmax)) && ((ivar) < (statmax)) && (block); (ivar)++;
+
+#define LOOP_4(block) \
+ block \
+ block \
+ block \
+ block \
+
+#define LOOP_8(block) \
+ LOOP_4(block) \
+ LOOP_4(block)
+
+/*
+ * Print out the given SeqTwoByteString, or do nothing if the string is not an ASCII
+ * SeqTwoByteString. NOTE: if you bump MAX_TWOBYTESTR_CHARS, you'll also need
+ * to modify the LOOP_* macro calls below to match.
+ */
+#define MAX_TWOBYTESTR_CHARS 128
+#define MAX_TWOBYTESTR_BYTES (2 * MAX_TWOBYTESTR_CHARS)
+#define TO_ASCII(c) ((c) < 128 ? (c) : '?')
+
+#define APPEND_SEQTWOBYTESTR(str, len, attrs) \
+ dtrace:helper:ustack: \
+ /!this->done && len > 0 && TWOBYTE_SEQSTR(attrs)/ \
+ { \
+ this->i = 0; \
+ this->stbuf = (uint16_t *)alloca(MAX_TWOBYTESTR_BYTES + 2); \
+ copyinto(str + V8_OFF_TWOBYTESTR_CHARS, \
+ MAX_TWOBYTESTR_BYTES, this->stbuf); \
+ this->stbuf[MAX_TWOBYTESTR_BYTES - 1] = '\0'; \
+ this->stbuf[MAX_TWOBYTESTR_BYTES] = '\0'; \
+ \
+ LOOP_8(LOOP_8(LOOP_4(LOOP_ITER(this->i, len, \
+ MAX_TWOBYTESTR_CHARS, \
+ APPEND_CHR(TO_ASCII(this->stbuf[this->i])))))) \
+ \
+ this->i = 0; \
+ this->stbuf = 0; \
+ }
+
/*
* Print out the given Node.js ExternalString, or do nothing if the string is
* not an ASCII ExternalString.
*/
#define APPEND_NODESTR(str, len, attrs) \
- dtrace:helper:ustack: \
- /!this->done && len > 0 && ASCII_EXTSTR(attrs)/ \
- { \
- this->resource = COPYIN_PTR(str + V8_OFF_EXTSTR_RSRC); \
+ dtrace:helper:ustack: \
+ /!this->done && len > 0 && ASCII_EXTSTR(attrs)/ \
+ { \
+ this->resource = COPYIN_PTR(str + V8_OFF_EXTSTR_RSRC); \
this->dataptr = COPYIN_PTR(this->resource + NODE_OFF_EXTSTR_DATA); \
copyinto(this->dataptr, len, this->buf + this->off); \
this->off += len; \
@@ -226,7 +286,7 @@
*/
#define EXPAND_STR(str, len, attrs, s1s, s1l, s1a, s2s, s2l, s2a) \
dtrace:helper:ustack: \
- /!this->done && len > 0 && ASCII_CONSSTR(attrs)/ \
+ /!this->done && len > 0 && IS_CONSSTR(attrs)/ \
{ \
len = 0; \
\
@@ -316,6 +376,7 @@ dtrace:helper:ustack:
this->funcnamelen = 0;
this->funcnameattrs = 0;
this->script = (off_t) 0;
+ this->scriptattrs = 0;
this->scriptnamestr = (off_t) 0;
this->scriptnamelen = 0;
this->scriptnameattrs = 0;
@@ -477,24 +538,38 @@ dtrace:helper:ustack:
APPEND_V8STR(this->funcnamestr, this->funcnamelen, this->funcnameattrs)
/*
- * Now look for the name of the script where the function was defined.
+ * Now look for the name of the script where the function was defined. The
+ * "script" itself may be undefined for special functions like "RegExp".
*/
dtrace:helper:ustack:
/!this->done/
{
this->script = COPYIN_PTR(this->shared + V8_OFF_SHARED_SCRIPT);
+ this->map = V8_MAP_PTR(COPYIN_PTR(this->script + V8_OFF_HEAPOBJ_MAP));
+ this->scriptattrs = COPYIN_UINT8(this->map + V8_OFF_MAP_ATTRS);
+}
+
+dtrace:helper:ustack:
+/!this->done && !V8_TYPE_SCRIPT(this->scriptattrs)/
+{
+ APPEND_CHR('\0');
+ this->done = 1;
+ stringof(this->buf);
+}
+
+
+dtrace:helper:ustack:
+/!this->done/
+{
this->scriptnamestr = COPYIN_PTR(this->script + V8_OFF_SCRIPT_NAME);
LOAD_STRFIELDS(this->scriptnamestr, this->scriptnamelen,
this->scriptnameattrs);
-
- APPEND_CHR4(' ','a','t',' ');
}
dtrace:helper:ustack:
-/!this->done && this->scriptnamelen == 0/
+/!this->done && this->scriptnamelen != 0/
{
- APPEND_CHR8('<','u','n','k','n','o','w','n');
- APPEND_CHR('>');
+ APPEND_CHR4(' ','a','t',' ');
}
APPEND_V8STR(this->scriptnamestr, this->scriptnamelen, this->scriptnameattrs)
@@ -511,6 +586,14 @@ dtrace:helper:ustack:
this->le_attrs = COPYIN_UINT8(this->map + V8_OFF_MAP_ATTRS);
}
+dtrace:helper:ustack:
+/!this->done && this->le_attrs != V8_IT_FIXEDARRAY && this->position == 0/
+{
+ APPEND_CHR('\0');
+ this->done = 1;
+ stringof(this->buf);
+}
+
dtrace:helper:ustack:
/!this->done && this->le_attrs != V8_IT_FIXEDARRAY/
{
@@ -519,10 +602,9 @@ dtrace:helper:ustack:
* undefined because V8 has not had to compute it yet. In this case we
* just show the raw position and call it a day.
*/
- APPEND_CHR8(' ','p','o','s','i','t','i','o');
- APPEND_CHR('n');
+ APPEND_CHR4(' ','p','o','s');
APPEND_CHR(' ');
- APPEND_NUM(this->position);
+ APPEND_NUM(SMI_VALUE(this->position));
APPEND_CHR('\0');
this->done = 1;
stringof(this->buf);
From 9777890f5d9ce95f15c64d29f1c0a55c12d24c3e Mon Sep 17 00:00:00 2001
From: Ben Noordhuis
Date: Wed, 9 Oct 2013 17:46:17 +0200
Subject: [PATCH 10/35] tls: fix premature connection termination
Destroying the TLS session implies destroying the underlying socket but
before this commit, that was done with net.Socket#destroy() rather than
net.Socket#destroySoon(). The former closes the connection right away,
even when there is still data to write. In other words, sometimes the
final TLS record got truncated.
Fixes #6107.
---
lib/tls.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/tls.js b/lib/tls.js
index fe94a5121f..dcdd99a193 100644
--- a/lib/tls.js
+++ b/lib/tls.js
@@ -1400,7 +1400,7 @@ function pipe(pair, socket) {
// Encrypted should be unpiped from socket to prevent possible
// write after destroy.
pair.encrypted.unpipe(socket);
- socket.destroy();
+ socket.destroySoon();
});
});
From 9c65387673eb51bfa17143edb24fc925045e62de Mon Sep 17 00:00:00 2001
From: isaacs
Date: Mon, 9 Sep 2013 12:31:05 +0100
Subject: [PATCH 11/35] blog: Remove wp-to-markdown script
---
tools/blog/wp-to-markdown.js | 189 -----------------------------------
1 file changed, 189 deletions(-)
delete mode 100644 tools/blog/wp-to-markdown.js
diff --git a/tools/blog/wp-to-markdown.js b/tools/blog/wp-to-markdown.js
deleted file mode 100644
index 65ec2d5b72..0000000000
--- a/tools/blog/wp-to-markdown.js
+++ /dev/null
@@ -1,189 +0,0 @@
-var sax = require('sax');
-var fs = require('fs');
-var parser = sax.parser(false, { lowercase: true });
-var assert = require('assert');
-var mkdirp = require('mkdirp');
-var url = require('url');
-
-var input = fs.createReadStream(process.argv[2]);
-input.on('data', function(c) {
- parser.write(c.toString());
-});
-input.on('end', parser.end.bind(parser));
-
-var post = null;
-var author = null;
-var authors = {};
-mkdirp.sync('out');
-
-parser.onopentag = function (tag) {
- switch (tag.name) {
- case 'wp:author':
- assert(author === null);
- author = {};
- author.text = '';
- return;
-
- case 'wp:author_login':
- assert(author);
- author.field = 'login';
- author.text = '';
- return;
-
- case 'wp:author_display_name':
- assert(author);
- author.field = 'name';
- author.text = '';
- return
-
- case 'wp:author_first_name':
- assert(author);
- author.field = 'first_name';
- author.text = '';
- return;
-
- case 'wp:author_last_name':
- assert(author);
- author.field = 'last_name';
- author.text = '';
- return;
-
- case 'item':
- assert(post === null);
- post = {};
- post.text = '';
- return;
-
- case 'title':
- if (post === null) return;
- post.field = 'title';
- return
-
- case 'pubDate':
- case 'wp:post_date':
- post.field = 'date';
- return;
-
- case 'dc:creator':
- post.field = 'author';
- return;
-
- case 'wp:status':
- post.field = 'status';
- return;
-
- case 'category':
- post.field = 'category';
- return;
-
- case 'content:encoded':
- post.field = 'body';
- return;
-
- case 'link':
- if (post) post.field = 'link';
- return;
-
- default:
- if (post) post.field = null;
- if (author) author.field = null;
- return;
- }
-};
-
-parser.onclosetag = function (tagName, tag) {
- switch (tagName) {
- case 'wp:author':
- assert(author);
- finishAuthor();
- return;
- case 'item':
- assert(post);
- finishPost();
- return;
- default:
- if (post && post.field || author && author.field) finishField();
- return;
- }
-};
-
-parser.ontext = parser.oncdata = function (text) {
- if (author) {
- if (author.field) author.text += text;
- else author.text = '';
- } else if (post) {
- if (post.field) post.text += text;
- else post.field = '';
- }
-};
-
-function finishField() {
- if (post && post.field) {
- post[post.field] = post.text;
- post.field = null;
- post.text = '';
- } else if (author && author.field) {
- author[author.field] = author.text;
- author.field = null;
- author.text = '';
- }
-}
-
-function finishPost() {
- // don't port drafts.
- if (post.status === 'draft') {
- return post = null;
- }
- post.date = new Date(post.date);
-
- if (post.link) {
- post.slug =
- url.parse(post.link)
- .pathname
- .replace(/\/+$/, '')
- .split('/')
- .pop();
- }
- if (!post.slug) {
- post.slug =
- (post.title + '-' + post.date.toISOString())
- .replace(/[^a-z0-9]+/gi, '-')
- .replace(/^-|-$/g, '')
- .toLowerCase();
- }
- post.slug = post.slug || '-';
-
- delete post.text
- delete post.link
- delete post.field
- post.author = authors[post.author] || post.author;
-
- post.body = post.body || '';
-
- // actually write it!
- var output = [];
- Object.keys(post)
- .filter(function (f) { return f !== 'body' }).forEach(function (k) {
- output.push(k + ': ' + post[k]);
- })
- output = output.join('\n') + '\n\n' + post.body.trim() + '\n';
-
- var f = 'out/' + post.category + '/' + post.slug + '.md';
- console.log(f, post.title);
- mkdirp.sync('out/' + post.category)
- fs.writeFileSync(f, output, 'utf8');
-
- post = null;
-}
-
-function finishAuthor () {
- author.name = author.name ||
- (author.first_name + ' ' + author.last_name) ||
- author.login;
- delete author.first_name
- delete author.last_name
- delete author.text
- delete author.field
- authors[author.login] = author.name
- author = null;
-}
From 51cdce8322b78814a8dbc9e1b8bd19eb305af312 Mon Sep 17 00:00:00 2001
From: Ben Noordhuis
Date: Thu, 10 Oct 2013 14:09:38 +0200
Subject: [PATCH 12/35] doc: addon: fix object instantiation examples
* Extend examples to show how to handle non-constructor invocation in
constructor callback functions.
* Fix up examples to initialize member variables at object construction.
* Fix up a few naming inconsistencies.
Fixes #5701.
---
doc/api/addons.markdown | 112 +++++++++++++++++++++++++---------------
1 file changed, 71 insertions(+), 41 deletions(-)
diff --git a/doc/api/addons.markdown b/doc/api/addons.markdown
index cb44538c82..65dce52e45 100644
--- a/doc/api/addons.markdown
+++ b/doc/api/addons.markdown
@@ -323,12 +323,13 @@ Then in `myobject.h` make your wrapper inherit from `node::ObjectWrap`:
static void Init(v8::Handle exports);
private:
- MyObject();
+ explicit MyObject(double value = 0);
~MyObject();
static v8::Handle New(const v8::Arguments& args);
static v8::Handle PlusOne(const v8::Arguments& args);
- double counter_;
+ static v8::Persistent constructor;
+ double value_;
};
#endif
@@ -343,8 +344,13 @@ prototype:
using namespace v8;
- MyObject::MyObject() {};
- MyObject::~MyObject() {};
+ Persistent MyObject::constructor;
+
+ MyObject::MyObject(double value) : value_(value) {
+ }
+
+ MyObject::~MyObject() {
+ }
void MyObject::Init(Handle
From 808a968409b6c6cc305506efd3caa4477a376125 Mon Sep 17 00:00:00 2001
From: Ben Noordhuis
Date: Wed, 23 Oct 2013 13:42:53 +0200
Subject: [PATCH 32/35] build: fix test-gc weakref build rule
Make the build rule depend on the build artifact (weakref.node) itself
rather than the directory it's built in. Depending on the directory
means that a build failure won't trigger a rebuild on the next
invocation because the directory's timestamp has been updated.
This is a back-port of commit 1189571 from the master branch that
hopefully fixes the following CI error:
executing: make test/gc/node_modules/weak/build/
make: *** No rule to make target `test/gc/node_modules/weak/build/'.
Command exited with non-zero: make test/gc/node_modules/weak/build/
Build step 'Execute NodeJS script' marked build as failure
---
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 01c689db53..14aeca3b8a 100644
--- a/Makefile
+++ b/Makefile
@@ -82,16 +82,16 @@ test-http1: all
test-valgrind: all
$(PYTHON) tools/test.py --mode=release --valgrind simple message
-test/gc/node_modules/weak/build:
+test/gc/node_modules/weak/build/Release/weakref.node:
@if [ ! -f node ]; then make all; fi
./node deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
--directory="$(shell pwd)/test/gc/node_modules/weak" \
--nodedir="$(shell pwd)"
-test-gc: all test/gc/node_modules/weak/build
+test-gc: all test/gc/node_modules/weak/build/Release/weakref.node
$(PYTHON) tools/test.py --mode=release gc
-test-all: all test/gc/node_modules/weak/build
+test-all: all test/gc/node_modules/weak/build/Release/weakref.node
$(PYTHON) tools/test.py --mode=debug,release
make test-npm
From f6f176e10872cac9dcdcd46a92c9ebfe4740f117 Mon Sep 17 00:00:00 2001
From: isaacs
Date: Thu, 24 Oct 2013 09:21:59 -0700
Subject: [PATCH 33/35] npm@1.3.12
---
deps/npm/Makefile | 6 +-
deps/npm/doc/cli/npm-cache.md | 8 +-
deps/npm/doc/cli/npm-dedupe.md | 4 +
deps/npm/doc/cli/npm-install.md | 4 +-
deps/npm/doc/cli/npm-outdated.md | 4 +
deps/npm/doc/cli/npm-prune.md | 4 +
deps/npm/doc/cli/npm-tag.md | 15 +
deps/npm/doc/misc/npm-config.md | 2 +-
deps/npm/html/doc/README.html | 2 +-
deps/npm/html/doc/api/npm-bin.html | 2 +-
deps/npm/html/doc/api/npm-bugs.html | 2 +-
deps/npm/html/doc/api/npm-commands.html | 2 +-
deps/npm/html/doc/api/npm-config.html | 2 +-
deps/npm/html/doc/api/npm-deprecate.html | 2 +-
deps/npm/html/doc/api/npm-docs.html | 2 +-
deps/npm/html/doc/api/npm-edit.html | 2 +-
deps/npm/html/doc/api/npm-explore.html | 2 +-
deps/npm/html/doc/api/npm-help-search.html | 2 +-
deps/npm/html/doc/api/npm-init.html | 2 +-
deps/npm/html/doc/api/npm-install.html | 2 +-
deps/npm/html/doc/api/npm-link.html | 2 +-
deps/npm/html/doc/api/npm-load.html | 2 +-
deps/npm/html/doc/api/npm-ls.html | 2 +-
deps/npm/html/doc/api/npm-outdated.html | 2 +-
deps/npm/html/doc/api/npm-owner.html | 2 +-
deps/npm/html/doc/api/npm-pack.html | 2 +-
deps/npm/html/doc/api/npm-prefix.html | 2 +-
deps/npm/html/doc/api/npm-prune.html | 2 +-
deps/npm/html/doc/api/npm-publish.html | 2 +-
deps/npm/html/doc/api/npm-rebuild.html | 2 +-
deps/npm/html/doc/api/npm-restart.html | 2 +-
deps/npm/html/doc/api/npm-root.html | 2 +-
deps/npm/html/doc/api/npm-run-script.html | 2 +-
deps/npm/html/doc/api/npm-search.html | 2 +-
deps/npm/html/doc/api/npm-shrinkwrap.html | 2 +-
deps/npm/html/doc/api/npm-start.html | 2 +-
deps/npm/html/doc/api/npm-stop.html | 2 +-
deps/npm/html/doc/api/npm-submodule.html | 2 +-
deps/npm/html/doc/api/npm-tag.html | 2 +-
deps/npm/html/doc/api/npm-test.html | 2 +-
deps/npm/html/doc/api/npm-uninstall.html | 2 +-
deps/npm/html/doc/api/npm-unpublish.html | 2 +-
deps/npm/html/doc/api/npm-update.html | 2 +-
deps/npm/html/doc/api/npm-version.html | 2 +-
deps/npm/html/doc/api/npm-view.html | 2 +-
deps/npm/html/doc/api/npm-whoami.html | 2 +-
deps/npm/html/doc/api/npm.html | 4 +-
deps/npm/html/doc/api/repo.html | 2 +-
deps/npm/html/doc/cli/npm-adduser.html | 2 +-
deps/npm/html/doc/cli/npm-bin.html | 2 +-
deps/npm/html/doc/cli/npm-bugs.html | 2 +-
deps/npm/html/doc/cli/npm-build.html | 2 +-
deps/npm/html/doc/cli/npm-bundle.html | 2 +-
deps/npm/html/doc/cli/npm-cache.html | 10 +-
deps/npm/html/doc/cli/npm-completion.html | 2 +-
deps/npm/html/doc/cli/npm-config.html | 2 +-
deps/npm/html/doc/cli/npm-dedupe.html | 6 +-
deps/npm/html/doc/cli/npm-deprecate.html | 2 +-
deps/npm/html/doc/cli/npm-docs.html | 2 +-
deps/npm/html/doc/cli/npm-edit.html | 2 +-
deps/npm/html/doc/cli/npm-explore.html | 2 +-
deps/npm/html/doc/cli/npm-help-search.html | 2 +-
deps/npm/html/doc/cli/npm-help.html | 2 +-
deps/npm/html/doc/cli/npm-init.html | 2 +-
deps/npm/html/doc/cli/npm-install.html | 6 +-
deps/npm/html/doc/cli/npm-link.html | 2 +-
deps/npm/html/doc/cli/npm-ls.html | 4 +-
deps/npm/html/doc/cli/npm-outdated.html | 6 +-
deps/npm/html/doc/cli/npm-owner.html | 2 +-
deps/npm/html/doc/cli/npm-pack.html | 2 +-
deps/npm/html/doc/cli/npm-prefix.html | 2 +-
deps/npm/html/doc/cli/npm-prune.html | 8 +-
deps/npm/html/doc/cli/npm-publish.html | 2 +-
deps/npm/html/doc/cli/npm-rebuild.html | 2 +-
deps/npm/html/doc/cli/npm-restart.html | 2 +-
deps/npm/html/doc/cli/npm-rm.html | 2 +-
deps/npm/html/doc/cli/npm-root.html | 2 +-
deps/npm/html/doc/cli/npm-run-script.html | 2 +-
deps/npm/html/doc/cli/npm-search.html | 2 +-
deps/npm/html/doc/cli/npm-shrinkwrap.html | 2 +-
deps/npm/html/doc/cli/npm-star.html | 2 +-
deps/npm/html/doc/cli/npm-stars.html | 2 +-
deps/npm/html/doc/cli/npm-start.html | 2 +-
deps/npm/html/doc/cli/npm-stop.html | 2 +-
deps/npm/html/doc/cli/npm-submodule.html | 2 +-
deps/npm/html/doc/cli/npm-tag.html | 17 +-
deps/npm/html/doc/cli/npm-test.html | 2 +-
deps/npm/html/doc/cli/npm-uninstall.html | 2 +-
deps/npm/html/doc/cli/npm-unpublish.html | 2 +-
deps/npm/html/doc/cli/npm-update.html | 2 +-
deps/npm/html/doc/cli/npm-version.html | 2 +-
deps/npm/html/doc/cli/npm-view.html | 2 +-
deps/npm/html/doc/cli/npm-whoami.html | 2 +-
deps/npm/html/doc/cli/npm.html | 4 +-
deps/npm/html/doc/cli/repo.html | 2 +-
deps/npm/html/doc/files/npm-folders.html | 2 +-
deps/npm/html/doc/files/npm-global.html | 2 +-
deps/npm/html/doc/files/npm-json.html | 2 +-
deps/npm/html/doc/files/npmrc.html | 2 +-
deps/npm/html/doc/files/package.json.html | 2 +-
deps/npm/html/doc/index.html | 2 +-
deps/npm/html/doc/misc/npm-coding-style.html | 2 +-
deps/npm/html/doc/misc/npm-config.html | 4 +-
deps/npm/html/doc/misc/npm-developers.html | 2 +-
deps/npm/html/doc/misc/npm-disputes.html | 2 +-
deps/npm/html/doc/misc/npm-faq.html | 2 +-
deps/npm/html/doc/misc/npm-index.html | 2 +-
deps/npm/html/doc/misc/npm-registry.html | 2 +-
deps/npm/html/doc/misc/npm-scripts.html | 2 +-
deps/npm/html/doc/misc/removing-npm.html | 2 +-
deps/npm/html/doc/misc/semver.html | 2 +-
deps/npm/lib/cache.js | 5 +-
deps/npm/lib/dedupe.js | 9 +-
deps/npm/lib/docs.js | 14 +-
deps/npm/lib/ls.js | 2 +
deps/npm/lib/outdated.js | 58 ++-
deps/npm/lib/repo.js | 10 +-
deps/npm/lib/unbuild.js | 5 +-
deps/npm/lib/utils/error-handler.js | 2 +-
deps/npm/lib/utils/lifecycle.js | 71 ++--
deps/npm/make.bat | 3 +
deps/npm/man/man1/npm-README.1 | 2 +-
deps/npm/man/man1/npm-adduser.1 | 2 +-
deps/npm/man/man1/npm-bin.1 | 2 +-
deps/npm/man/man1/npm-bugs.1 | 2 +-
deps/npm/man/man1/npm-build.1 | 2 +-
deps/npm/man/man1/npm-bundle.1 | 2 +-
deps/npm/man/man1/npm-cache.1 | 9 +-
deps/npm/man/man1/npm-completion.1 | 2 +-
deps/npm/man/man1/npm-config.1 | 2 +-
deps/npm/man/man1/npm-dedupe.1 | 7 +-
deps/npm/man/man1/npm-deprecate.1 | 2 +-
deps/npm/man/man1/npm-docs.1 | 2 +-
deps/npm/man/man1/npm-edit.1 | 2 +-
deps/npm/man/man1/npm-explore.1 | 2 +-
deps/npm/man/man1/npm-help-search.1 | 2 +-
deps/npm/man/man1/npm-help.1 | 2 +-
deps/npm/man/man1/npm-init.1 | 2 +-
deps/npm/man/man1/npm-install.1 | 6 +-
deps/npm/man/man1/npm-link.1 | 2 +-
deps/npm/man/man1/npm-ls.1 | 4 +-
deps/npm/man/man1/npm-outdated.1 | 7 +-
deps/npm/man/man1/npm-owner.1 | 2 +-
deps/npm/man/man1/npm-pack.1 | 2 +-
deps/npm/man/man1/npm-prefix.1 | 2 +-
deps/npm/man/man1/npm-prune.1 | 7 +-
deps/npm/man/man1/npm-publish.1 | 2 +-
deps/npm/man/man1/npm-rebuild.1 | 2 +-
deps/npm/man/man1/npm-restart.1 | 2 +-
deps/npm/man/man1/npm-rm.1 | 2 +-
deps/npm/man/man1/npm-root.1 | 2 +-
deps/npm/man/man1/npm-run-script.1 | 2 +-
deps/npm/man/man1/npm-search.1 | 2 +-
deps/npm/man/man1/npm-shrinkwrap.1 | 2 +-
deps/npm/man/man1/npm-star.1 | 2 +-
deps/npm/man/man1/npm-stars.1 | 2 +-
deps/npm/man/man1/npm-start.1 | 2 +-
deps/npm/man/man1/npm-stop.1 | 2 +-
deps/npm/man/man1/npm-submodule.1 | 2 +-
deps/npm/man/man1/npm-tag.1 | 39 +-
deps/npm/man/man1/npm-test.1 | 2 +-
deps/npm/man/man1/npm-uninstall.1 | 2 +-
deps/npm/man/man1/npm-unpublish.1 | 2 +-
deps/npm/man/man1/npm-update.1 | 2 +-
deps/npm/man/man1/npm-version.1 | 2 +-
deps/npm/man/man1/npm-view.1 | 2 +-
deps/npm/man/man1/npm-whoami.1 | 2 +-
deps/npm/man/man1/npm.1 | 4 +-
deps/npm/man/man1/repo.1 | 2 +-
deps/npm/man/man3/npm-bin.3 | 2 +-
deps/npm/man/man3/npm-bugs.3 | 2 +-
deps/npm/man/man3/npm-commands.3 | 2 +-
deps/npm/man/man3/npm-config.3 | 2 +-
deps/npm/man/man3/npm-deprecate.3 | 2 +-
deps/npm/man/man3/npm-docs.3 | 2 +-
deps/npm/man/man3/npm-edit.3 | 2 +-
deps/npm/man/man3/npm-explore.3 | 2 +-
deps/npm/man/man3/npm-help-search.3 | 2 +-
deps/npm/man/man3/npm-init.3 | 2 +-
deps/npm/man/man3/npm-install.3 | 2 +-
deps/npm/man/man3/npm-link.3 | 2 +-
deps/npm/man/man3/npm-load.3 | 2 +-
deps/npm/man/man3/npm-ls.3 | 2 +-
deps/npm/man/man3/npm-outdated.3 | 2 +-
deps/npm/man/man3/npm-owner.3 | 2 +-
deps/npm/man/man3/npm-pack.3 | 2 +-
deps/npm/man/man3/npm-prefix.3 | 2 +-
deps/npm/man/man3/npm-prune.3 | 2 +-
deps/npm/man/man3/npm-publish.3 | 2 +-
deps/npm/man/man3/npm-rebuild.3 | 2 +-
deps/npm/man/man3/npm-restart.3 | 2 +-
deps/npm/man/man3/npm-root.3 | 2 +-
deps/npm/man/man3/npm-run-script.3 | 2 +-
deps/npm/man/man3/npm-search.3 | 2 +-
deps/npm/man/man3/npm-shrinkwrap.3 | 2 +-
deps/npm/man/man3/npm-start.3 | 2 +-
deps/npm/man/man3/npm-stop.3 | 2 +-
deps/npm/man/man3/npm-submodule.3 | 2 +-
deps/npm/man/man3/npm-tag.3 | 2 +-
deps/npm/man/man3/npm-test.3 | 2 +-
deps/npm/man/man3/npm-uninstall.3 | 2 +-
deps/npm/man/man3/npm-unpublish.3 | 2 +-
deps/npm/man/man3/npm-update.3 | 2 +-
deps/npm/man/man3/npm-version.3 | 2 +-
deps/npm/man/man3/npm-view.3 | 2 +-
deps/npm/man/man3/npm-whoami.3 | 2 +-
deps/npm/man/man3/npm.3 | 4 +-
deps/npm/man/man3/repo.3 | 2 +-
deps/npm/man/man5/npm-folders.5 | 2 +-
deps/npm/man/man5/npm-global.5 | 2 +-
deps/npm/man/man5/npm-json.5 | 2 +-
deps/npm/man/man5/npmrc.5 | 2 +-
deps/npm/man/man5/package.json.5 | 2 +-
deps/npm/man/man7/npm-coding-style.7 | 2 +-
deps/npm/man/man7/npm-config.7 | 4 +-
deps/npm/man/man7/npm-developers.7 | 2 +-
deps/npm/man/man7/npm-disputes.7 | 2 +-
deps/npm/man/man7/npm-faq.7 | 2 +-
deps/npm/man/man7/npm-index.7 | 2 +-
deps/npm/man/man7/npm-registry.7 | 2 +-
deps/npm/man/man7/npm-scripts.7 | 2 +-
deps/npm/man/man7/removing-npm.7 | 2 +-
deps/npm/man/man7/semver.7 | 2 +-
deps/npm/node_modules/ansi/README.md | 8 -
deps/npm/node_modules/ansi/color-spaces.pl | 67 ++++
.../ansi/examples/cursorPosition.js | 12 +-
.../ansi/examples/imgcat/index.js | 50 ---
.../ansi/examples/imgcat/yoshi.png | Bin 1341 -> 0 bytes
.../node_modules/ansi/examples/starwars.js | 9 +-
deps/npm/node_modules/ansi/lib/ansi.js | 45 ++-
deps/npm/node_modules/ansi/package.json | 28 +-
deps/npm/node_modules/cmd-shim/.npmignore | 32 +-
deps/npm/node_modules/cmd-shim/.travis.yml | 4 +
deps/npm/node_modules/cmd-shim/LICENSE | 54 +--
deps/npm/node_modules/cmd-shim/README.md | 82 ++--
deps/npm/node_modules/cmd-shim/index.js | 360 +++++++++---------
deps/npm/node_modules/cmd-shim/package.json | 12 +-
.../node_modules/cmd-shim/test/00-setup.js | 70 ++--
deps/npm/node_modules/cmd-shim/test/basic.js | 336 ++++++++--------
.../node_modules/cmd-shim/test/zz-cleanup.js | 26 +-
deps/npm/node_modules/editor/LICENSE | 18 +
deps/npm/node_modules/editor/package.json | 9 +-
.../node_modules/fstream-npm/fstream-npm.js | 2 +-
.../node_modules/fstream-ignore/package.json | 6 +-
.../npm/node_modules/fstream-npm/package.json | 6 +-
.../github-url-from-username-repo/.npmignore | 13 +
.../github-url-from-username-repo/.travis.yml | 4 +
.../github-url-from-username-repo/LICENSE | 27 ++
.../github-url-from-username-repo/README.md | 14 +
.../github-url-from-username-repo/index.js | 9 +
.../package.json | 33 ++
.../test/index.js | 21 +
deps/npm/node_modules/mkdirp/package.json | 9 +-
.../node_modules/config-chain/index.js | 2 +-
.../node_modules/proto-list/package.json | 1 +
.../node_modules/config-chain/package.json | 6 +-
.../node_modules/config-chain/test/get.js | 15 +
deps/npm/node_modules/npmconf/package.json | 9 +-
deps/npm/node_modules/npmlog/package.json | 6 +-
deps/npm/node_modules/npmlog/test/basic.js | 265 +------------
deps/npm/node_modules/once/README.md | 18 +
deps/npm/node_modules/once/once.js | 11 +-
deps/npm/node_modules/once/package.json | 12 +-
deps/npm/node_modules/once/test/once.js | 4 +-
.../normalize-package-data/AUTHORS | 3 +-
.../normalize-package-data/README.md | 2 +
.../lib/core_module_names.json | 29 ++
.../lib/extract_description.js | 1 +
.../normalize-package-data/lib/fixer.js | 35 +-
.../normalize-package-data/package.json | 16 +-
.../test/consistency.js | 2 +-
.../test/fixtures/no-description.json | 4 +
.../normalize-package-data/test/normalize.js | 68 ++++
.../read-package-json/package.json | 6 +-
deps/npm/node_modules/slide/package.json | 2 +-
deps/npm/package.json | 28 +-
.../packages/npm-test-peer-deps/npm-ls.json | 4 +-
.../packages/npm-test-peer-deps/package.json | 2 +-
.../npm-test-shrinkwrap/npm-shrinkwrap.json | 2 +-
.../packages/npm-test-shrinkwrap/package.json | 2 +-
.../test/tap/fixtures/underscore-1-3-3.json | 1 -
deps/npm/test/tap/fixtures/underscore.json | 1 -
deps/npm/test/tap/ls-no-results.js | 12 +
.../tap/outdated-include-devdependencies.js | 23 ++
.../package.json | 8 +
deps/npm/test/tap/outdated-new-versions.js | 38 ++
.../tap/outdated-new-versions/package.json | 11 +
deps/npm/test/tap/prepublish.js | 90 +++++
deps/npm/test/tap/publish-config.js | 4 +-
deps/npm/test/tap/uninstall-package.js | 24 ++
.../test/tap/uninstall-package/package.json | 9 +
291 files changed, 1712 insertions(+), 1186 deletions(-)
create mode 100644 deps/npm/make.bat
create mode 100644 deps/npm/node_modules/ansi/color-spaces.pl
delete mode 100755 deps/npm/node_modules/ansi/examples/imgcat/index.js
delete mode 100644 deps/npm/node_modules/ansi/examples/imgcat/yoshi.png
create mode 100644 deps/npm/node_modules/cmd-shim/.travis.yml
mode change 100755 => 100644 deps/npm/node_modules/cmd-shim/test/basic.js
create mode 100644 deps/npm/node_modules/editor/LICENSE
create mode 100644 deps/npm/node_modules/github-url-from-username-repo/.npmignore
create mode 100644 deps/npm/node_modules/github-url-from-username-repo/.travis.yml
create mode 100644 deps/npm/node_modules/github-url-from-username-repo/LICENSE
create mode 100644 deps/npm/node_modules/github-url-from-username-repo/README.md
create mode 100644 deps/npm/node_modules/github-url-from-username-repo/index.js
create mode 100644 deps/npm/node_modules/github-url-from-username-repo/package.json
create mode 100644 deps/npm/node_modules/github-url-from-username-repo/test/index.js
create mode 100644 deps/npm/node_modules/npmconf/node_modules/config-chain/test/get.js
create mode 100644 deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/core_module_names.json
create mode 100644 deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/no-description.json
delete mode 100644 deps/npm/test/tap/fixtures/underscore-1-3-3.json
delete mode 100644 deps/npm/test/tap/fixtures/underscore.json
create mode 100644 deps/npm/test/tap/ls-no-results.js
create mode 100644 deps/npm/test/tap/outdated-include-devdependencies.js
create mode 100644 deps/npm/test/tap/outdated-include-devdependencies/package.json
create mode 100644 deps/npm/test/tap/outdated-new-versions.js
create mode 100644 deps/npm/test/tap/outdated-new-versions/package.json
create mode 100644 deps/npm/test/tap/prepublish.js
create mode 100644 deps/npm/test/tap/uninstall-package.js
create mode 100644 deps/npm/test/tap/uninstall-package/package.json
diff --git a/deps/npm/Makefile b/deps/npm/Makefile
index 28c7ff6b3f..326d6f0d50 100644
--- a/deps/npm/Makefile
+++ b/deps/npm/Makefile
@@ -71,7 +71,7 @@ link: uninstall
node cli.js link -f
clean: ronnclean doc-clean uninstall
- rm npmrc
+ rm -rf npmrc
node cli.js cache clean
uninstall:
@@ -154,13 +154,13 @@ html/doc/misc/%.html: doc/misc/%.md $(html_docdeps)
ronn: node_modules/.bin/ronn
node_modules/.bin/ronn:
- node cli.js install ronn
+ node cli.js install ronn --no-global
doc: man
man: $(cli_docs) $(api_docs)
-test:
+test: doc
node cli.js test
publish: link doc
diff --git a/deps/npm/doc/cli/npm-cache.md b/deps/npm/doc/cli/npm-cache.md
index 90a55d9b2a..af3cfac4da 100644
--- a/deps/npm/doc/cli/npm-cache.md
+++ b/deps/npm/doc/cli/npm-cache.md
@@ -33,9 +33,9 @@ Used to add, list, or clear the npm cache folder.
## DETAILS
-npm stores cache data in `$HOME/.npm`. For each package that is added
-to the cache, three pieces of information are stored in
-`{cache}/{name}/{version}`:
+npm stores cache data in the directory specified in `npm config get cache`.
+For each package that is added to the cache, three pieces of information are
+stored in `{cache}/{name}/{version}`:
* .../package/:
A folder containing the package contents as they appear in the tarball.
@@ -57,7 +57,7 @@ they do not make an HTTP request to the registry.
### cache
-Default: `$HOME/.npm` on Posix, or `$HOME/npm-cache` on Windows.
+Default: `~/.npm` on Posix, or `%AppData%/npm-cache` on Windows.
The root cache folder.
diff --git a/deps/npm/doc/cli/npm-dedupe.md b/deps/npm/doc/cli/npm-dedupe.md
index 849d98f20a..d3be01050c 100644
--- a/deps/npm/doc/cli/npm-dedupe.md
+++ b/deps/npm/doc/cli/npm-dedupe.md
@@ -47,6 +47,10 @@ registry.
This feature is experimental, and may change in future versions.
+The `--tag` argument will apply to all of the affected dependencies. If a
+tag with the given name exists, the tagged version is preferred over newer
+versions.
+
## SEE ALSO
* npm-ls(1)
diff --git a/deps/npm/doc/cli/npm-install.md b/deps/npm/doc/cli/npm-install.md
index 07ba2b03f9..a537bb878d 100644
--- a/deps/npm/doc/cli/npm-install.md
+++ b/deps/npm/doc/cli/npm-install.md
@@ -152,7 +152,9 @@ For example:
npm install sax@">=0.1.0 <0.2.0" bench supervisor
-The `--tag` argument will apply to all of the specified install targets.
+The `--tag` argument will apply to all of the specified install targets. If a
+tag with the given name exists, the tagged version is preferred over newer
+versions.
The `--force` argument will force npm to fetch remote resources even if a
local copy exists on disk.
diff --git a/deps/npm/doc/cli/npm-outdated.md b/deps/npm/doc/cli/npm-outdated.md
index 25269eb8c0..4d58353787 100644
--- a/deps/npm/doc/cli/npm-outdated.md
+++ b/deps/npm/doc/cli/npm-outdated.md
@@ -10,6 +10,10 @@ npm-outdated(1) -- Check for outdated packages
This command will check the registry to see if any (or, specific) installed
packages are currently outdated.
+The resulting field 'wanted' shows the latest version according to the
+version specified in the package.json, the field 'latest' the very latest
+version of the package.
+
## SEE ALSO
* npm-update(1)
diff --git a/deps/npm/doc/cli/npm-prune.md b/deps/npm/doc/cli/npm-prune.md
index 0410214d8d..88c54754bb 100644
--- a/deps/npm/doc/cli/npm-prune.md
+++ b/deps/npm/doc/cli/npm-prune.md
@@ -4,6 +4,7 @@ npm-prune(1) -- Remove extraneous packages
## SYNOPSIS
npm prune [ [ [@
+
+When installing dependencies, a preferred tagged version may be specified:
+
+ npm install --tag
+
+This also applies to `npm dedupe`.
+
+Publishing a package always sets the "latest" tag to the published version.
+
## SEE ALSO
* npm-publish(1)
+* npm-install(1)
+* npm-dedupe(1)
* npm-registry(7)
* npm-config(1)
* npm-config(7)
diff --git a/deps/npm/doc/misc/npm-config.md b/deps/npm/doc/misc/npm-config.md
index 19eaf9347e..750b80972c 100644
--- a/deps/npm/doc/misc/npm-config.md
+++ b/deps/npm/doc/misc/npm-config.md
@@ -146,7 +146,7 @@ See also the `strict-ssl` config.
### cache
-* Default: Windows: `%APPDATA%\npm-cache`, Posix: `~/.npm`
+* Default: Windows: `%AppData%\npm-cache`, Posix: `~/.npm`
* Type: path
The location of npm's cache directory. See `npm-cache(1)`
diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html
index 94f7abc340..b17848121b 100644
--- a/deps/npm/html/doc/README.html
+++ b/deps/npm/html/doc/README.html
@@ -239,7 +239,7 @@ will no doubt tell you to put the output in a gist or email.
-
+