From 5ce50ece16e52dad94834f977313f36f83732273 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Tue, 19 Nov 2013 11:38:48 +0400 Subject: [PATCH 1/5] dgram: fix abort when getting `fd` of closed dgram v8's `messages.js` file's `CallSiteGetMethodName` is running through all object properties and getter to figure out method name of function that appears in stack trace. This run-through will also read `fd` property of `UDPWrap` instance's javascript object, making `UNWRAP()` fail. As a simple alternative to the test case above, one could just keep reference to the dgram handle and try accessing `handle.fd` after it has been fully closed. fix #6536 --- src/udp_wrap.cc | 2 +- test/simple/test-dgram-close.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index 73b722f6759..b33f4e881de 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -144,7 +144,7 @@ Handle UDPWrap::GetFD(Local, const AccessorInfo& args) { return v8::Null(); #else HandleScope scope; - UNWRAP(UDPWrap) + UNWRAP_NO_ABORT(UDPWrap) int fd = (wrap == NULL) ? -1 : wrap->handle_.io_watcher.fd; return scope.Close(Integer::New(fd)); #endif diff --git a/test/simple/test-dgram-close.js b/test/simple/test-dgram-close.js index 90ba05a2ca1..77af6f13b80 100644 --- a/test/simple/test-dgram-close.js +++ b/test/simple/test-dgram-close.js @@ -30,5 +30,14 @@ var buf = new Buffer(1024); buf.fill(42); var socket = dgram.createSocket('udp4'); +var handle = socket._handle; socket.send(buf, 0, buf.length, common.PORT, 'localhost'); socket.close(); +socket = null; + +// Verify that accessing handle after closure doesn't throw +setImmediate(function() { + setImmediate(function() { + console.log('Handle fd is: ', handle.fd); + }); +}); From 5885f464f0ad372efa7ef44a72df6d44acec3085 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Tue, 19 Nov 2013 11:02:26 +0400 Subject: [PATCH 2/5] net: fix `new net.Socket` documentation `Socket` no longer accepts `type` option, and also accepts `readable`, `writable` options. fix #6541 --- doc/api/net.markdown | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/api/net.markdown b/doc/api/net.markdown index d80e80b4a54..513acb117e1 100644 --- a/doc/api/net.markdown +++ b/doc/api/net.markdown @@ -281,12 +281,14 @@ Construct a new socket object. `options` is an object with the following defaults: { fd: null - type: null - allowHalfOpen: false + allowHalfOpen: false, + readable: false, + writable: false } -`fd` allows you to specify the existing file descriptor of socket. `type` -specified underlying protocol. It can be `'tcp4'`, `'tcp6'`, or `'unix'`. +`fd` allows you to specify the existing file descriptor of socket. +Set `readable` and/or `writable` to `true` to allow reads and/or writes on this +socket (NOTE: Works only when `fd` is passed). About `allowHalfOpen`, refer to `createServer()` and `'end'` event. ### socket.connect(port, [host], [connectListener]) From fce0eb416b47f205605fe3dde47550dec337c673 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Tue, 19 Nov 2013 10:58:23 +0400 Subject: [PATCH 3/5] events: do not accept NaN in setMaxListeners --- lib/events.js | 2 +- test/simple/test-event-emitter-max-listeners.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/events.js b/lib/events.js index 8c02a558ec7..f43df093d49 100644 --- a/lib/events.js +++ b/lib/events.js @@ -45,7 +45,7 @@ exports.EventEmitter = EventEmitter; // that to be increased. Set to zero for unlimited. var defaultMaxListeners = 10; EventEmitter.prototype.setMaxListeners = function(n) { - if (typeof n !== 'number' || n < 0) + if (typeof n !== 'number' || n < 0 || isNaN(n)) throw TypeError('n must be a positive number'); this._maxListeners = n; }; diff --git a/test/simple/test-event-emitter-max-listeners.js b/test/simple/test-event-emitter-max-listeners.js index 3dea94bccf3..dfc3e1352d0 100644 --- a/test/simple/test-event-emitter-max-listeners.js +++ b/test/simple/test-event-emitter-max-listeners.js @@ -38,4 +38,16 @@ e.on('maxListeners', function() { // Should not corrupt the 'maxListeners' queue. e.setMaxListeners(42); +assert.throws(function() { + e.setMaxListeners(NaN); +}); + +assert.throws(function() { + e.setMaxListeners(-1); +}); + +assert.throws(function() { + e.setMaxListeners("and even this"); +}); + e.emit('maxListeners'); From 88dc1fcb62f40c3c906802dcaa8a8e9dfef2a264 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Sat, 19 Oct 2013 14:38:58 +0400 Subject: [PATCH 4/5] crypto: `randomBytes` is non-blocking Add NOTE section in documentation, mentioning that `randomBytes` won't block when entropy sources are drained. fix #6372 --- doc/api/crypto.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/crypto.markdown b/doc/api/crypto.markdown index e0fe26f5bdd..1aba68ee366 100644 --- a/doc/api/crypto.markdown +++ b/doc/api/crypto.markdown @@ -465,8 +465,14 @@ Generates cryptographically strong pseudo-random data. Usage: console.log('Have %d bytes of random data: %s', buf.length, buf); } catch (ex) { // handle error + // most likely, entropy sources are drained } +NOTE: Will throw error or invoke callback with error, if there is not enough +accumulated entropy to generate cryptographically strong data. In other words, +`crypto.randomBytes` without callback will not block even if all entropy sources +are drained. + ## crypto.pseudoRandomBytes(size, [callback]) Generates *non*-cryptographically strong pseudo-random data. The data From c1452f4c6fac17dd8ab974372daee05cd5cdbdec Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 20 Nov 2013 11:08:52 -0800 Subject: [PATCH 5/5] npm: Upgrade to v1.3.15 --- deps/npm/Makefile | 2 +- deps/npm/doc/cli/npm.md | 4 - 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 | 2 +- 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 | 2 +- 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 | 2 +- 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 | 2 +- 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 | 2 +- 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 | 2 +- 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 | 8 +- 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 | 2 +- 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/dedupe.js | 2 - deps/npm/lib/npm.js | 2 +- deps/npm/lib/utils/lifecycle.js | 6 +- deps/npm/man/man1/npm-ls.1 | 2 +- deps/npm/man/man1/npm.1 | 5 +- deps/npm/man/man3/npm.3 | 2 +- deps/npm/node_modules/glob/glob.js | 5 + deps/npm/node_modules/glob/package.json | 7 +- .../node_modules/glob/test/bash-results.json | 1 + .../glob/test/new-glob-optional-options.js | 10 + .../example/example-basic.js | 8 + .../example/example-default.js | 7 + .../{example.js => example/example-npm.js} | 7 +- .../example/init/basic-init.js | 1 + .../node_modules/promzard/package.json | 1 + .../init-package-json/package.json | 8 +- deps/npm/node_modules/node-gyp/gyp/AUTHORS | 2 + deps/npm/node_modules/node-gyp/gyp/DEPS | 2 - deps/npm/node_modules/node-gyp/gyp/MANIFEST | 21 - .../node_modules/node-gyp/gyp/PRESUBMIT.py | 1 - .../node-gyp/gyp/buildbot/buildbot_run.py | 148 +++ deps/npm/node_modules/node-gyp/gyp/gyp | 19 +- deps/npm/node_modules/node-gyp/gyp/gyp.bat | 2 +- .../npm/node_modules/node-gyp/gyp/gyp_main.py | 18 + deps/npm/node_modules/node-gyp/gyp/gyptest.py | 23 +- .../node-gyp/gyp/pylib/gyp/MSVSNew.py | 19 +- .../node-gyp/gyp/pylib/gyp/MSVSSettings.py | 7 +- .../node-gyp/gyp/pylib/gyp/MSVSUtil.py | 79 +- .../node-gyp/gyp/pylib/gyp/MSVSVersion.py | 48 +- .../node-gyp/gyp/pylib/gyp/SCons.py | 199 --- .../node-gyp/gyp/pylib/gyp/__init__.py | 129 +- .../node-gyp/gyp/pylib/gyp/common.py | 26 +- .../pylib/gyp/{sun_tool.py => flock_tool.py} | 12 +- .../gyp/pylib/gyp/generator/android.py | 120 +- .../gyp/generator/dump_dependency_json.py | 14 +- .../gyp/pylib/gyp/generator/eclipse.py | 63 +- .../node-gyp/gyp/pylib/gyp/generator/make.py | 79 +- .../node-gyp/gyp/pylib/gyp/generator/msvs.py | 205 +++- .../node-gyp/gyp/pylib/gyp/generator/ninja.py | 861 +++++++++---- .../gyp/pylib/gyp/generator/ninja_test.py | 48 +- .../node-gyp/gyp/pylib/gyp/generator/scons.py | 1072 ----------------- .../node-gyp/gyp/pylib/gyp/generator/xcode.py | 73 +- .../gyp/pylib/gyp/generator/xcode_test.py | 23 + .../node-gyp/gyp/pylib/gyp/input.py | 280 +++-- .../node-gyp/gyp/pylib/gyp/input_test.py | 90 ++ .../node-gyp/gyp/pylib/gyp/mac_tool.py | 73 +- .../node-gyp/gyp/pylib/gyp/msvs_emulation.py | 143 ++- .../node-gyp/gyp/pylib/gyp/ninja_syntax.py | 18 +- .../node-gyp/gyp/pylib/gyp/win_tool.py | 53 +- .../node-gyp/gyp/pylib/gyp/xcode_emulation.py | 313 ++++- .../node-gyp/gyp/pylib/gyp/xcodeproj_file.py | 56 +- deps/npm/node_modules/node-gyp/gyp/setup.py | 11 +- .../node-gyp/gyp/tools/emacs/gyp.el | 1 + .../node_modules/node-gyp/lib/configure.js | 134 +-- deps/npm/node_modules/node-gyp/package.json | 8 +- deps/npm/node_modules/npmconf/config-defs.js | 16 + .../node_modules/proto-list/package.json | 6 +- .../node_modules/config-chain/package.json | 6 +- deps/npm/node_modules/npmconf/package.json | 10 +- deps/npm/node_modules/npmconf/test/basic.js | 1 + deps/npm/node_modules/npmconf/test/builtin.js | 3 +- .../form-data/node_modules/async/package.json | 6 +- .../node_modules/delayed-stream/package.json | 6 +- .../node_modules/combined-stream/package.json | 6 +- .../hawk/node_modules/boom/package.json | 6 +- .../hawk/node_modules/cryptiles/package.json | 6 +- .../hawk/node_modules/hoek/package.json | 6 +- .../hawk/node_modules/sntp/package.json | 6 +- deps/npm/package.json | 8 +- deps/npm/scripts/install.sh | 6 +- deps/npm/test/common-tap.js | 2 + deps/npm/test/tap/ignore-shrinkwrap.js | 11 +- deps/npm/test/tap/lifecycle-signal.js | 17 + .../test/tap/lifecycle-signal/package.json | 3 + .../test/tap/noargs-install-config-save.js | 17 +- .../tap/outdated-include-devdependencies.js | 19 +- deps/npm/test/tap/outdated-new-versions.js | 10 +- deps/npm/test/tap/outdated.js | 22 +- deps/npm/test/tap/outdated/README.md | 1 + deps/npm/test/tap/outdated/package.json | 4 +- deps/npm/test/tap/peer-deps-invalid.js | 3 +- .../tap/peer-deps-without-package-json.js | 5 +- deps/npm/test/tap/publish-config.js | 5 +- deps/npm/test/tap/uninstall-package.js | 35 +- .../test/tap/uninstall-package/package.json | 6 +- 190 files changed, 2546 insertions(+), 2501 deletions(-) create mode 100644 deps/npm/node_modules/glob/test/new-glob-optional-options.js create mode 100644 deps/npm/node_modules/init-package-json/example/example-basic.js create mode 100644 deps/npm/node_modules/init-package-json/example/example-default.js rename deps/npm/node_modules/init-package-json/{example.js => example/example-npm.js} (54%) create mode 100644 deps/npm/node_modules/init-package-json/example/init/basic-init.js delete mode 100644 deps/npm/node_modules/node-gyp/gyp/MANIFEST create mode 100755 deps/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py create mode 100755 deps/npm/node_modules/node-gyp/gyp/gyp_main.py delete mode 100644 deps/npm/node_modules/node-gyp/gyp/pylib/gyp/SCons.py rename deps/npm/node_modules/node-gyp/gyp/pylib/gyp/{sun_tool.py => flock_tool.py} (82%) delete mode 100644 deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/scons.py create mode 100644 deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py create mode 100755 deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py create mode 100644 deps/npm/test/common-tap.js create mode 100644 deps/npm/test/tap/lifecycle-signal.js create mode 100644 deps/npm/test/tap/lifecycle-signal/package.json create mode 100644 deps/npm/test/tap/outdated/README.md diff --git a/deps/npm/Makefile b/deps/npm/Makefile index 326d6f0d509..d2338baba6e 100644 --- a/deps/npm/Makefile +++ b/deps/npm/Makefile @@ -214,6 +214,6 @@ release: @bash scripts/release.sh sandwich: - @[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || echo "make it yourself" && exit 13 + @[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || (echo "make it yourself" && exit 13) .PHONY: all latest install dev link doc clean uninstall test man doc-publish doc-clean docclean docpublish release zip-publish diff --git a/deps/npm/doc/cli/npm.md b/deps/npm/doc/cli/npm.md index 91357e93007..0f9b30b226e 100644 --- a/deps/npm/doc/cli/npm.md +++ b/deps/npm/doc/cli/npm.md @@ -132,10 +132,6 @@ as expected. The `npm-debug.log` file is also helpful to provide. You can also look for isaacs in #node.js on irc://irc.freenode.net. He will no doubt tell you to put the output in a gist or email. -## HISTORY - -See npm-changelog(1) - ## AUTHOR [Isaac Z. Schlueter](http://blog.izs.me/) :: diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html index 515f262dfb4..9a34b83adb2 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.

- +