From e61ee49c7a2f577eb1338ee35f8768d79010ebc9 Mon Sep 17 00:00:00 2001 From: Chris Dickinson Date: Fri, 17 Apr 2015 14:52:50 -0700 Subject: [PATCH 01/33] Working on v2.0.0 --- src/node_version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node_version.h b/src/node_version.h index f629c697fdde03..ee885bc947c3ea 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -1,11 +1,11 @@ #ifndef SRC_NODE_VERSION_H_ #define SRC_NODE_VERSION_H_ -#define NODE_MAJOR_VERSION 1 -#define NODE_MINOR_VERSION 8 +#define NODE_MAJOR_VERSION 2 +#define NODE_MINOR_VERSION 0 #define NODE_PATCH_VERSION 0 -#define NODE_VERSION_IS_RELEASE 1 +#define NODE_VERSION_IS_RELEASE 0 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n) From 68707648fddf104cc7d34309d9a8e29a4e1af152 Mon Sep 17 00:00:00 2001 From: Brendan Ashworth Date: Sat, 18 Apr 2015 11:11:52 -0700 Subject: [PATCH 02/33] doc: update CONTRIBUTING.md This commit: - fixes development branch (v1.x -> master) - updates stability index wording - use iojs binary instead of node PR-URL: https://github.com/iojs/io.js/pull/1466 Reviewed-By: Ben Noordhuis --- CONTRIBUTING.md | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dfb68c43c6d566..d2edd60a0ee245 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,13 +34,8 @@ $ git remote add upstream git://github.com/iojs/io.js.git #### Which branch? -Now decide if you want your feature or bug fix to go into the master branch -or the stable branch. As a rule of thumb, bug fixes go into the stable branch -while new features go into the master branch. - -The stable branch is effectively frozen; patches that change the io.js -API/ABI or affect the run-time behavior of applications get rejected. The -current stable branch is set as the default branch on GitHub. +For developing new features and bug fixes, the `master` branch should be pulled +and built upon. #### Respect the stability index @@ -49,7 +44,7 @@ The rules for the master branch are less strict; consult the In a nutshell, modules are at varying levels of API stability. Bug fixes are always welcome but API or behavioral changes to modules at stability level 3 -and up are off-limits. +(Locked) are off-limits. #### Dependencies @@ -71,12 +66,9 @@ does not align with the project team. Create a feature branch and start hacking: ```text -$ git checkout -b my-feature-branch -t origin/v1.x +$ git checkout -b my-feature-branch -t origin/master ``` -(Where `v1.x` is the latest stable branch as of this writing.) - - ### Step 3: Commit Make sure git knows your name and email address: @@ -123,7 +115,7 @@ Use `git rebase` (not `git merge`) to sync your work from time to time. ```text $ git fetch upstream -$ git rebase upstream/v1.x # or upstream/master +$ git rebase upstream/master ``` @@ -147,10 +139,10 @@ can use this syntax to run it exactly as the test harness would: $ python tools/test.py -v --mode=release parallel/test-stream2-transform ``` -You can run tests directly with node: +You can run tests directly with iojs: ```text -$ node ./test/parallel/test-streams2-transform.js +$ iojs ./test/parallel/test-streams2-transform.js ``` From 718059777c6eb41d930db787eec8748ab35f7deb Mon Sep 17 00:00:00 2001 From: Brendan Ashworth Date: Sat, 18 Apr 2015 13:22:34 -0700 Subject: [PATCH 03/33] Revert "http: don't bother making a copy of the options" This reverts commit 06cfff935012ed2826cac56284cea982630cbc27. Reverted because it introduced a regression where (because options were modified in the later functionality) options.host and options.port would be overridden with values provided in other, supported ways. PR-URL: https://github.com/iojs/io.js/pull/1467 Reviewed-By: Ben Noordhuis --- lib/_http_client.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/_http_client.js b/lib/_http_client.js index daa37ef064e3fc..200a08e5d5bf85 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -21,6 +21,8 @@ function ClientRequest(options, cb) { if (typeof options === 'string') { options = url.parse(options); + } else { + options = util._extend({}, options); } var agent = options.agent; From 6bf85bc81e7e61b4126c50d05555d5928343423b Mon Sep 17 00:00:00 2001 From: Brendan Ashworth Date: Sat, 18 Apr 2015 13:26:15 -0700 Subject: [PATCH 04/33] test: add test for 06cfff9 regression This commit adds a test to ensure all options are NOT modified after passing them to http.request. Specifically options.host and options.port are the most prominent that would previously error, but add the other options that have default values. options.host and options.port were overridden for the one-argument net.createConnection(options) call. PR-URL: https://github.com/iojs/io.js/pull/1467 Reviewed-By: Ben Noordhuis --- ...test-http-request-dont-override-options.js | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test/parallel/test-http-request-dont-override-options.js diff --git a/test/parallel/test-http-request-dont-override-options.js b/test/parallel/test-http-request-dont-override-options.js new file mode 100644 index 00000000000000..66d82caeac930d --- /dev/null +++ b/test/parallel/test-http-request-dont-override-options.js @@ -0,0 +1,45 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +var requests = 0; + +http.createServer(function(req, res) { + res.writeHead(200); + res.end('ok'); + + requests++; +}).listen(common.PORT).unref(); + +var agent = new http.Agent(); +agent.defaultPort = common.PORT; + +// options marked as explicitly undefined for readability +// in this test, they should STAY undefined as options should not +// be mutable / modified +var options = { + host: undefined, + hostname: common.localhostIPv4, + port: undefined, + defaultPort: undefined, + path: undefined, + method: undefined, + agent: agent +}; + +http.request(options, function(res) { + res.resume(); +}).end(); + +process.on('exit', function() { + assert.equal(requests, 1); + + assert.strictEqual(options.host, undefined); + assert.strictEqual(options.hostname, common.localhostIPv4); + assert.strictEqual(options.port, undefined); + assert.strictEqual(options.defaultPort, undefined); + assert.strictEqual(options.path, undefined); + assert.strictEqual(options.method, undefined); +}); From 26327757f8b342eb91df71f1fdf34a855e29aa71 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Mon, 20 Apr 2015 18:55:04 +1000 Subject: [PATCH 05/33] doc: update AUTHORS list Update AUTHORS list using tools/update-authors.sh PR-URL: https://github.com/iojs/io.js/pull/1476 Reviewed-By: Ben Noordhuis --- AUTHORS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index a46220775054f6..cd2b3aa983003f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -744,5 +744,8 @@ Giovanny Andres Gongora Granada Jeffrey Jagoda Kelsey Breseman Peter Petrov +Andrew Crites +Marat Abdullin +Dan Varga # Generated by tools/update-authors.sh From b16a328edee8a8e9c86b079525ece0579859e426 Mon Sep 17 00:00:00 2001 From: Nick Raienko Date: Wed, 22 Apr 2015 14:27:04 +0300 Subject: [PATCH 06/33] doc: add spaces to child.kill example PR-URL: https://github.com/iojs/io.js/pull/1503 Reviewed-By: Colin Ihrig Reviewed-By: Evan Lucas --- doc/api/child_process.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/child_process.markdown b/doc/api/child_process.markdown index 1ca5cd7fbac6ed..315670581bba4f 100644 --- a/doc/api/child_process.markdown +++ b/doc/api/child_process.markdown @@ -192,7 +192,7 @@ be sent `'SIGTERM'`. See `signal(7)` for a list of available signals. grep = spawn('grep', ['ssh']); grep.on('close', function (code, signal) { - console.log('child process terminated due to receipt of signal '+signal); + console.log('child process terminated due to receipt of signal ' + signal); }); // send SIGHUP to process From 22aafa55971ef762863ec8badcd76228581d40c6 Mon Sep 17 00:00:00 2001 From: Jeremiah Senkpiel Date: Wed, 22 Apr 2015 20:46:06 -0400 Subject: [PATCH 07/33] doc: add Fishrock123 to the TC as per https://github.com/iojs/io.js/issues/1502 PR-URL: https://github.com/iojs/io.js/pull/1507 Reviewed-By: Chris Dickinson Reviewed-By: Ben Noordhuis --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67164f5725de54..ca5ab327b8ba39 100644 --- a/README.md +++ b/README.md @@ -280,7 +280,7 @@ information about the governance of the io.js project, see - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D * **Thorsten Lorenz** ([@thlorenz](https://github.com/thlorenz)) <thlorenz@gmx.de> * **Stephen Belanger** ([@qard](https://github.com/qard)) <admin@stephenbelanger.com> -* **Jeremiah Senkpiel** ([@fishrock123](https://github.com/fishrock123)) <fishrock123@rocketmail.com> +* **Jeremiah Senkpiel** ([@fishrock123](https://github.com/fishrock123)) <fishrock123@rocketmail.com> (Technical Committee) - Release GPG key: FD3A5288F042B6850C66B31F09FE44734EB7990E * **Evan Lucas** ([@evanlucas](https://github.com/evanlucas)) <evanlucas@me.com> * **Brendan Ashworth** ([@brendanashworth](https://github.com/brendanashworth)) <brendan.ashworth@me.com> From a7d74633f20e285395f5e2860bdac56381603476 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Tue, 21 Apr 2015 18:24:13 -0300 Subject: [PATCH 08/33] tls_wrap: use localhost if options.host is empty tls.connect(options) with no options.host should accept a certificate with CN: 'localhost'. Fix Error: Hostname/IP doesn't match certificate's altnames: "Host: undefined. is not cert's CN: localhost" 'localhost' is not added directly to defaults because that is not always desired (for example, when using options.socket) PR-URL: https://github.com/iojs/io.js/pull/1493 Fixes: https://github.com/iojs/io.js/issues/1489 Reviewed-By: Brendan Ashworth Reviewed-By: Roman Reiss --- lib/_tls_wrap.js | 3 +- test/parallel/test-tls-connect-no-host.js | 34 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-tls-connect-no-host.js diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 3e091b0fc1be0d..c1037a7096a755 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -858,7 +858,8 @@ exports.connect = function(/* [port, host], options, cb */) { var hostname = options.servername || options.host || - options.socket && options.socket._host, + (options.socket && options.socket._host) || + 'localhost', NPN = {}, context = tls.createSecureContext(options); tls.convertNPNProtocols(options.NPNProtocols, NPN); diff --git a/test/parallel/test-tls-connect-no-host.js b/test/parallel/test-tls-connect-no-host.js new file mode 100644 index 00000000000000..41aac1acabd781 --- /dev/null +++ b/test/parallel/test-tls-connect-no-host.js @@ -0,0 +1,34 @@ +var common = require('../common'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + process.exit(); +} +var tls = require('tls'); + +var assert = require('assert'); +var fs = require('fs'); +var path = require('path'); + +var cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')); +var key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')); + +// https://github.com/iojs/io.js/issues/1489 +// tls.connect(options) with no options.host should accept a cert with +// CN:'localhost' +tls.createServer({ + key: key, + cert: cert +}).listen(common.PORT); + +var socket = tls.connect({ + port: common.PORT, + ca: cert, + // No host set here. 'localhost' is the default, + // but tls.checkServerIdentity() breaks before the fix with: + // Error: Hostname/IP doesn't match certificate's altnames: + // "Host: undefined. is not cert's CN: localhost" +}, function() { + assert(socket.authorized); + process.exit(); +}); From 7384ca83f97a28b0cecaabe879e9af0fe8631b62 Mon Sep 17 00:00:00 2001 From: Chris Yip Date: Tue, 21 Apr 2015 15:13:27 +0800 Subject: [PATCH 09/33] module: remove '' from Module.globalPaths If `$NODE_PATH` contains trailing separators, `Module.globalPaths` will contains empty strings. When `Module` try to resolve a module's path, `path.resolve('', 'index.js')` will boil down to `$PWD/index.js`, which makes sub modules can access global modules and get unexpected result. PR-URL: https://github.com/iojs/io.js/pull/1488 Reviewed-By: Roman Reiss --- lib/module.js | 4 +++- test/parallel/test-module-globalpaths-nodepath.js | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/module.js b/lib/module.js index 02f0ec700f150d..eba3de81713fe8 100644 --- a/lib/module.js +++ b/lib/module.js @@ -489,7 +489,9 @@ Module._initPaths = function() { var nodePath = process.env['NODE_PATH']; if (nodePath) { - paths = nodePath.split(path.delimiter).concat(paths); + paths = nodePath.split(path.delimiter).filter(function(path) { + return !!path; + }).concat(paths); } modulePaths = paths; diff --git a/test/parallel/test-module-globalpaths-nodepath.js b/test/parallel/test-module-globalpaths-nodepath.js index d0261e81f7a802..6cfa17933ce869 100644 --- a/test/parallel/test-module-globalpaths-nodepath.js +++ b/test/parallel/test-module-globalpaths-nodepath.js @@ -6,20 +6,22 @@ var module = require('module'); var isWindows = process.platform === 'win32'; var partA, partB; +var partC = ''; if (isWindows) { partA = 'C:\\Users\\Rocko Artischocko\\AppData\\Roaming\\npm'; partB = 'C:\\Program Files (x86)\\nodejs\\'; - process.env['NODE_PATH'] = partA + ';' + partB; + process.env['NODE_PATH'] = partA + ';' + partB + ';' + partC; } else { partA = '/usr/test/lib/node_modules'; partB = '/usr/test/lib/node'; - process.env['NODE_PATH'] = partA + ':' + partB; + process.env['NODE_PATH'] = partA + ':' + partB + ':' + partC; } module._initPaths(); assert.ok(module.globalPaths.indexOf(partA) !== -1); assert.ok(module.globalPaths.indexOf(partB) !== -1); +assert.ok(module.globalPaths.indexOf(partC) === -1); -assert.ok(Array.isArray(module.globalPaths)); \ No newline at end of file +assert.ok(Array.isArray(module.globalPaths)); From bb254b533b1bfced8e39661485488f4a3f8969cc Mon Sep 17 00:00:00 2001 From: Roman Reiss Date: Thu, 23 Apr 2015 17:22:38 +0200 Subject: [PATCH 10/33] doc: update branch to master Update the remaining markdown files to refer to the master branch. PR-URL: https://github.com/iojs/io.js/pull/1511 Reviewed-By: Jeremiah Senkpiel --- COLLABORATOR_GUIDE.md | 12 ++++++------ WORKING_GROUPS.md | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 20949eeefbab5b..792dbf3d4d668a 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -119,14 +119,14 @@ $ git rebase --abort Checkout proper target branch ```text -$ git checkout v1.x +$ git checkout master ``` Update the tree ```text $ git fetch origin -$ git merge --ff-only origin/v1.x +$ git merge --ff-only origin/master ``` Apply external patches @@ -138,13 +138,13 @@ $ curl -L https://github.com/iojs/io.js/pull/xxx.patch | git am --whitespace=fix Check and re-review the changes ```text -$ git diff origin/v1.x +$ git diff origin/master ``` Check number of commits and commit messages ```text -$ git log origin/v1.x...v1.x +$ git log origin/master...master ``` If there are multiple commits that relate to the same feature or @@ -152,7 +152,7 @@ one with a feature and separate with a test for that feature - you'll need to squash them (or strictly speaking `fixup`). ```text -$ git rebase -i origin/v1.x +$ git rebase -i origin/master ``` This will open a screen like this (in the default shell editor): @@ -210,7 +210,7 @@ line. Time to push it: ```text -$ git push origin v1.x +$ git push origin master ``` ### I just made a mistake diff --git a/WORKING_GROUPS.md b/WORKING_GROUPS.md index 05cb41e5a97a82..c5c7cc1d746a50 100644 --- a/WORKING_GROUPS.md +++ b/WORKING_GROUPS.md @@ -1,7 +1,7 @@ # io.js Working Groups io.js Working Groups are autonomous projects created by the -[Technical Committee (TC)](https://github.com/iojs/io.js/blob/v1.x/GOVERNANCE.md#technical-committee). +[Technical Committee (TC)](https://github.com/iojs/io.js/blob/master/GOVERNANCE.md#technical-committee). Working Groups can be formed at any time but must be ratified by the TC. Once formed the work defined in the Working Group charter is the From 3d3083b91f02ca14acddde97612cec98e97ffe38 Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Thu, 16 Apr 2015 11:29:02 +0800 Subject: [PATCH 11/33] buffer: little improve for Buffer.concat method When buffer list less than 2, no need to calculate the length. The change's benchmark result is here: https://gist.github.com/JacksonTian/2c9e2bdec00018e010e6 It improve 15% ~ 25% speed when list only have one buffer, to other cases no effect. PR-URL: https://github.com/iojs/io.js/pull/1437 Reviewed-By: Trevor Norris Reviewed-By: Brendan Ashworth --- lib/buffer.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/buffer.js b/lib/buffer.js index 8f4e34d289fc27..dc2b656d7a7a33 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -247,6 +247,11 @@ Buffer.concat = function(list, length) { if (!Array.isArray(list)) throw new TypeError('list argument must be an Array of Buffers.'); + if (list.length === 0) + return new Buffer(0); + else if (list.length === 1) + return list[0]; + if (length === undefined) { length = 0; for (var i = 0; i < list.length; i++) @@ -255,11 +260,6 @@ Buffer.concat = function(list, length) { length = length >>> 0; } - if (list.length === 0) - return new Buffer(0); - else if (list.length === 1) - return list[0]; - var buffer = new Buffer(length); var pos = 0; for (var i = 0; i < list.length; i++) { From 1bef71747678c19c7214048de5b9e3848889248d Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Wed, 22 Apr 2015 16:46:21 -0500 Subject: [PATCH 12/33] net: cleanup connect logic Separates out the lookup logic for net.Socket. In the event the `host` property is an IP address, the lookup is skipped. PR-URL: https://github.com/iojs/io.js/pull/1505 Reviewed-By: Chris Dickinson Reviewed-By: Yosuke Furukawa --- lib/net.js | 119 ++++++++++++---------- test/parallel/test-net-dns-lookup-skip.js | 18 ++++ test/parallel/test-net-dns-lookup.js | 2 +- 3 files changed, 85 insertions(+), 54 deletions(-) create mode 100644 test/parallel/test-net-dns-lookup-skip.js diff --git a/lib/net.js b/lib/net.js index 847e417e67f4ca..ce2033f9daf101 100644 --- a/lib/net.js +++ b/lib/net.js @@ -881,64 +881,77 @@ Socket.prototype.connect = function(options, cb) { connect(self, options.path); } else { - const dns = require('dns'); - var host = options.host || 'localhost'; - var port = 0; - var localAddress = options.localAddress; - var localPort = options.localPort; - var dnsopts = { - family: options.family, - hints: 0 - }; - - if (localAddress && !exports.isIP(localAddress)) - throw new TypeError('localAddress must be a valid IP: ' + localAddress); - - if (localPort && typeof localPort !== 'number') - throw new TypeError('localPort should be a number: ' + localPort); - - port = options.port; - if (typeof port !== 'undefined') { - if (typeof port !== 'number' && typeof port !== 'string') - throw new TypeError('port should be a number or string: ' + port); - if (!isLegalPort(port)) - throw new RangeError('port should be >= 0 and < 65536: ' + port); - } - port |= 0; + lookupAndConnect(self, options); + } + return self; +}; - if (dnsopts.family !== 4 && dnsopts.family !== 6) - dnsopts.hints = dns.ADDRCONFIG | dns.V4MAPPED; - debug('connect: find host ' + host); - debug('connect: dns options ' + dnsopts); - self._host = host; - dns.lookup(host, dnsopts, function(err, ip, addressType) { - self.emit('lookup', err, ip, addressType); +function lookupAndConnect(self, options) { + const dns = require('dns'); + var host = options.host || 'localhost'; + var port = options.port; + var localAddress = options.localAddress; + var localPort = options.localPort; - // It's possible we were destroyed while looking this up. - // XXX it would be great if we could cancel the promise returned by - // the look up. - if (!self._connecting) return; + if (localAddress && !exports.isIP(localAddress)) + throw new TypeError('localAddress must be a valid IP: ' + localAddress); - if (err) { - // net.createConnection() creates a net.Socket object and - // immediately calls net.Socket.connect() on it (that's us). - // There are no event listeners registered yet so defer the - // error event to the next tick. - process.nextTick(connectErrorNT, self, err, options); - } else { - self._unrefTimer(); - connect(self, - ip, - port, - addressType, - localAddress, - localPort); - } - }); + if (localPort && typeof localPort !== 'number') + throw new TypeError('localPort should be a number: ' + localPort); + + if (typeof port !== 'undefined') { + if (typeof port !== 'number' && typeof port !== 'string') + throw new TypeError('port should be a number or string: ' + port); + if (!isLegalPort(port)) + throw new RangeError('port should be >= 0 and < 65536: ' + port); } - return self; -}; + port |= 0; + + // If host is an IP, skip performing a lookup + // TODO(evanlucas) should we hot path this for localhost? + var addressType = exports.isIP(host); + if (addressType) { + connect(self, host, port, addressType, localAddress, localPort); + return; + } + + var dnsopts = { + family: options.family, + hints: 0 + }; + + if (dnsopts.family !== 4 && dnsopts.family !== 6) + dnsopts.hints = dns.ADDRCONFIG | dns.V4MAPPED; + + debug('connect: find host ' + host); + debug('connect: dns options ' + dnsopts); + self._host = host; + dns.lookup(host, dnsopts, function(err, ip, addressType) { + self.emit('lookup', err, ip, addressType); + + // It's possible we were destroyed while looking this up. + // XXX it would be great if we could cancel the promise returned by + // the look up. + if (!self._connecting) return; + + if (err) { + // net.createConnection() creates a net.Socket object and + // immediately calls net.Socket.connect() on it (that's us). + // There are no event listeners registered yet so defer the + // error event to the next tick. + process.nextTick(connectErrorNT, self, err, options); + } else { + self._unrefTimer(); + connect(self, + ip, + port, + addressType, + localAddress, + localPort); + } + }); +} function connectErrorNT(self, err, options) { diff --git a/test/parallel/test-net-dns-lookup-skip.js b/test/parallel/test-net-dns-lookup-skip.js new file mode 100644 index 00000000000000..7a129b979510b7 --- /dev/null +++ b/test/parallel/test-net-dns-lookup-skip.js @@ -0,0 +1,18 @@ +var common = require('../common'); +var assert = require('assert'); +var net = require('net'); + +function check(addressType) { + var server = net.createServer(function(client) { + client.end(); + server.close(); + }); + + var address = addressType === 4 ? '127.0.0.1' : '::1'; + server.listen(common.PORT, address, function() { + net.connect(common.PORT, address).on('lookup', assert.fail); + }); +} + +check(4); +common.hasIPv6 && check(6); diff --git a/test/parallel/test-net-dns-lookup.js b/test/parallel/test-net-dns-lookup.js index e7c058fe144a56..92ba794d74520c 100644 --- a/test/parallel/test-net-dns-lookup.js +++ b/test/parallel/test-net-dns-lookup.js @@ -9,7 +9,7 @@ var server = net.createServer(function(client) { }); server.listen(common.PORT, '127.0.0.1', function() { - net.connect(common.PORT, '127.0.0.1').on('lookup', function(err, ip, type) { + net.connect(common.PORT, 'localhost').on('lookup', function(err, ip, type) { assert.equal(err, null); assert.equal(ip, '127.0.0.1'); assert.equal(type, '4'); From 4abe2fa1cfcc434952570c1c979dd4ce150fba67 Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Wed, 22 Apr 2015 17:05:29 -0500 Subject: [PATCH 13/33] net: add lookup option to Socket.prototype.connect Allows customization of the lookup function used when Socket.prototype.connect is called using a hostname. PR-URL: https://github.com/iojs/io.js/pull/1505 Reviewed-By: Chris Dickinson Reviewed-By: Yosuke Furukawa --- doc/api/net.markdown | 2 ++ lib/net.js | 6 +++- test/parallel/test-net-dns-custom-lookup.js | 40 +++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-net-dns-custom-lookup.js diff --git a/doc/api/net.markdown b/doc/api/net.markdown index e3ce8fb5863aa0..aadf8a84c1c1a6 100644 --- a/doc/api/net.markdown +++ b/doc/api/net.markdown @@ -355,6 +355,8 @@ For TCP sockets, `options` argument should be an object which specifies: - `localPort`: Local port to bind to for network connections. - `family` : Version of IP stack. Defaults to `4`. + + - `lookup` : Custom lookup function. Defaults to `dns.lookup`. For local domain sockets, `options` argument should be an object which specifies: diff --git a/lib/net.js b/lib/net.js index ce2033f9daf101..867e1df7ccc252 100644 --- a/lib/net.js +++ b/lib/net.js @@ -916,6 +916,9 @@ function lookupAndConnect(self, options) { return; } + if (options.lookup && typeof options.lookup !== 'function') + throw new TypeError('options.lookup should be a function.'); + var dnsopts = { family: options.family, hints: 0 @@ -927,7 +930,8 @@ function lookupAndConnect(self, options) { debug('connect: find host ' + host); debug('connect: dns options ' + dnsopts); self._host = host; - dns.lookup(host, dnsopts, function(err, ip, addressType) { + var lookup = options.lookup || dns.lookup; + lookup(host, dnsopts, function(err, ip, addressType) { self.emit('lookup', err, ip, addressType); // It's possible we were destroyed while looking this up. diff --git a/test/parallel/test-net-dns-custom-lookup.js b/test/parallel/test-net-dns-custom-lookup.js new file mode 100644 index 00000000000000..3979bbf0b6d2c5 --- /dev/null +++ b/test/parallel/test-net-dns-custom-lookup.js @@ -0,0 +1,40 @@ +var common = require('../common'); +var assert = require('assert'); +var net = require('net'); +var dns = require('dns'); +var ok = false; + +function check(addressType, cb) { + var server = net.createServer(function(client) { + client.end(); + server.close(); + cb && cb(); + }); + + var address = addressType === 4 ? '127.0.0.1' : '::1'; + server.listen(common.PORT, address, function() { + net.connect({ + port: common.PORT, + host: 'localhost', + lookup: lookup + }).on('lookup', function(err, ip, type) { + assert.equal(err, null); + assert.equal(ip, address); + assert.equal(type, addressType); + ok = true; + }); + }); + + function lookup(host, dnsopts, cb) { + dnsopts.family = addressType; + dns.lookup(host, dnsopts, cb); + } +} + +check(4, function() { + common.hasIPv6 && check(6); +}); + +process.on('exit', function() { + assert.ok(ok); +}); From f3cc50f8112df46a95188d12552f6f0a5636849b Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Wed, 22 Apr 2015 14:52:43 +1000 Subject: [PATCH 14/33] doc: add TC meeting 2015-04-08 minutes PR-URL: #1497 Reviewed-By: Chris Dickinson Reviewed-By: Jeremiah Senkpiel --- doc/tc-meetings/2015-04-08.md | 184 ++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 doc/tc-meetings/2015-04-08.md diff --git a/doc/tc-meetings/2015-04-08.md b/doc/tc-meetings/2015-04-08.md new file mode 100644 index 00000000000000..0ffa95395a00be --- /dev/null +++ b/doc/tc-meetings/2015-04-08.md @@ -0,0 +1,184 @@ +# io.js TC Meeting 2015-04-08 + +## Links + +* **Public YouTube feed**: http://www.youtube.com/watch?v=OjlK8k10oyo +* **Google Plus Event page**: https://plus.google.com/events/c1c3234uog6svplgrapqucb557k +* **GitHub Issue**: https://github.com/iojs/io.js/issues/1369 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/1EsDjfRGpVKFABH4LcNXNxsAsBTnHsU-i5cehmAcp1A8 + +## Agenda + +Extracted from https://github.com/iojs/io.js/labels/tc-agenda prior to meeting. + +* [#1101](https://github.com/iojs/io.js/pull/1101) http: allow HTTP to return an HTTPS server / @silverwind / the use of a `tls` option to trigger `https` module functionality +* [#1301](https://github.com/iojs/io.js/pull/1301) Util(.is*) Deprecations / @Fishrock123 & @brendanashworth / [this comment](https://github.com/iojs/io.js/pull/1301#issuecomment-90829575) asking for an opinion from the TC on how to move forward +* Discuss https://github.com/jasnell/dev-policy [[comment by @mikeal]](https://github.com/iojs/io.js/issues/1369#issuecomment-90955688) +* Discuss / Review the `require(‘.’)` situation [[comments by @silverwind and @Fishrock123]](https://github.com/iojs/io.js/issues/1369#issuecomment-90933134) + + +### Present + +* Bert (TC) +* Domenic +* Trevor (TC) +* Ben (TC) +* Fedor (TC) +* Jeremiah +* Mikeal +* Chris (TC) + +### Review of last meeting + +* reconciliation update (Mikeal and Bert) +* doc: add NAN WG [#1226](https://github.com/iojs/io.js/issues/1226) +* Proposal: Authorise @Fishrock123 to create releases [#1225](https://github.com/iojs/io.js/issues/1225) +* governance: Raise the bar for changes in membership and governance policy. [#1222](https://github.com/iojs/io.js/issues/1222) +* Nominating Rod Vagg @rvagg to the TC [#1134](https://github.com/iojs/io.js/issues/1131) + +### Quick stand-up + +* Ben: fixing bugs, reviewing PRs. Looked into adding `Generator.prototype.return()` in V8, but more complicated than expected (crashes and can’t figure out why). Fedor might help. +* Bert: working on a CI status dashboard. Reviewing a patch that makes Node use Chakra instead of V8 (!) +* Chris: worked on a patch to add a UTF8 consumer to utils, for the purposes of eventually adding UTF8 validation as well as being able to externalize buffer-strings. Talked about standardizing destroy() behavior on streams +* Domenic: Not much on io.js, reviewed some dev policy stuff especially with regard to V8 +* Fedor: bugs and PRs +* Jeremiah: bugs and PRs and 1.6.4 release +* Mikeal: worked on dev policy for the foundation, continuing to iterate; distilling feedback from worried-about-reconciliation thread, but had to lock it in the end with links to other places to address such things. +* Trevor: code reviews + +## Minutes + +### [#1101](https://github.com/iojs/io.js/pull/1101) http: allow HTTP to return an HTTPS server + +***@silverwind / the use of a `tls` option to trigger `https` module functionality*** + +Jeremiah: two options we have (that we’ve discussed) are a tls option, or just auto-detect if you provide appropriate options. + +Ben: why is this a TC issue? + +Jeremiah/Domenic: three or four weeks without consensus. + +Mikeal: related to issue in NG, where you could pass options to listen() instead of createServer(). + +Chris/Jeremiah: there is a PR for it in joyent/node; not merged yet. + +Fedor: to me the problem is `http.request` vs. `https.request`. + +Mikeal: (advocates for .listen again) + +Trevor: -1 for doing it .listen; it’s too complicated internally; there is lots of weirdness going on here already. + +Fedor: would be harder to share a server among workers in a cluster. + +DD: but this particular PR is just a simple change to allow you to avoid having to decide between require('http') vs. require('https'). + +Bert: I kind of like the version where you put the options in listen(). + +Ben: what happens when iojs is compiled without TLS support? + +**Conclusion**: punt on this. Initial feedback is that if we were to go down this route, we would slightly prefer the explicit tls option; however, there needs to be a discussion about the listen() idea, and also about compilation without TLS. + +### [#1301](https://github.com/iojs/io.js/pull/1301) Util(.is*) Deprecations + +***@Fishrock123 & @brendanashworth / [this comment](https://github.com/iojs/io.js/pull/1301#issuecomment-90829575) asking for an opinion from the TC on how to move forward*** + +Bert: what’s the point? + +Trevor: that we won’t really fix bugs in these. + +Mikeal: this is just in the docs? + +Ben: also util.deprecate to log a warning + +Mikeal: that just sounds annoying + +Trevor: it’s supposed to be; fix your code + +Mikeal: yeah but it’s not always your code… + +Bert: we already have two levels of deprecation, warning and not warning + +Domenic: however we only use the latter for domains, since we don’t have an alternative for them + +Mikeal: can we do staged deprecations, marking things in the docs for one major release cycle, then in the next major release cycle start warning + +Domenic: could we add an option to show the deprecation warnings for people who are contentious? + +Mikeal: I don’t think anyone would actually turn that on… + +Chris: I might be able to run my tooling over all of npm to detect uses + +Bert: we need a better strategy in general for moving things out of core. The reason we want to deprecate these is that we don’t really want to fix it because that would be backward incompatible, so this is really too big to be in core. Any ideas for making these better? Maybe if you install a module called util it can take precedence over the one in node? So then we can release the fixed one on npm? + +Mikeal: that does sound better than versioning core modules … we hit a flag that lets you replace the core one with a new one. Over time we’ll be able to get data. + +Bert: there were some talks about doing this in browsers? + +Domenic: not really, nobody wants to ship two versions. + +**Conclusions: mark util.isXYZ deprecated in the docs, but do not show a warning in the console this version** + +### [Dev Policy](https://github.com/jasnell/dev-policy) + +Chris: looking good to me, on the right path, some minor issues still being worked out. E.g. around using priority tags and ways to funnel work to smaller number of contributors in joyent/node vs. just adding more contributors as we do. + +Jeremiah: Node has a CI Jenkins PR integration thing that they are in favor of using + +Domenic: honestly anything that prevents people from committing things that turn the build red would be awesome… + +Bert: agree. + +Bert: there’s an issue about version numbers + +Mikeal: if we merge, it’ll be a 2.0.0, and we’ll bring in the backward incompatible changes we’ve been sitting on for a while + +Mikeal: more on this tomorrow, audio will be public after it happens (due to technology being used it won’t be live). Please review dev policy beforehand. + +### Isaac + +Ben: Isaac doesn’t seem to be involved anymore. What do we do when a TC member goes AWOL? + +Mikeal: well, we cancelled two meetings he was ready to attend, and then he went on vacation for two weeks, so AWOL isn’t quite the right characterization… But yeah, he’s not doing too much. We can just ask if he wants to be there, or we can vote it off. + +Bert: I asked him and didn’t get an extremely clear answer; we’ll probably get more clarity when he’s back from vacation. I would not suggest throwing him off right now. + +Ben: yeah, there’s no urgency, just… + +Bert: yes, but I agree that if you’re on the TC you should show up to meetings + +Fedor: what if we made votes exponentially decay in power based on attendance… + +### `require('.')` + +Mikeal: if we knew the impact of this change would we have done a major? + +Chris: if we would have done a major we wouldn’t have done it at all because the API is locked and only bugfixes are allowed. + +Jeremiah: that being said the only thing that breaks is a strange workflow from an undocumented feature. + +Ben: I am not very sympathetic to that argument; we broke someone’s workflow, and that’s bad. + +Domenic: I don’t think that’s fair. Every change is breaking to someone; even changing error messages will break people who parse error messages. The question is what side of the line this is on. + +Mikeal: it seemed weird… + +Domenic: I always thought NODE_PATH was deprecated. Should we warn about people using it? + +Ben: I understand that someone is already using the new require behavior, so reverting it would be backward-incompatible. So we have a few options: 1) add a hack that makes NODE_PATH interactions with require('.') work as they used to; 2) say “sorry” and keep as-is + +Bert: I’m sympathetic to adding the hack and a warning. + +Domenic: agree. And maybe try to kill NODE_PATH in 3.x. + +**Conclusion: hack plus a warning that shows up in this hacky case (“hey, you’re using the require-dot trick with NODE_PATH; we made it work because we’re nice people, but we want to take it away in 2.x, so gear up”). In 2.x, probably warn on any use of NODE_PATH at all.** + +### Bert shows off his CI prototype + +It’s pretty cool. + +It groups tests in interesting ways that are useful. (OS, flakiness, …) + +### Next meeting + +* 2015-04-15 From 5178f93bc0f5b4e16cb68001e6f4684b4fd4ed7c Mon Sep 17 00:00:00 2001 From: Julian Duque Date: Sat, 25 Apr 2015 08:38:55 -0500 Subject: [PATCH 15/33] doc: Add Addon API (NAN) to working group list Also update nan and examples repositories links to io.js organization PR-URL: #1523 Reviewed-By: Jeremiah Senkpiel --- WORKING_GROUPS.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/WORKING_GROUPS.md b/WORKING_GROUPS.md index c5c7cc1d746a50..55aafd02ad2b0a 100644 --- a/WORKING_GROUPS.md +++ b/WORKING_GROUPS.md @@ -26,6 +26,7 @@ back in to the TC. * [Evangelism](#evangelism) * [Roadmap](#roadmap) * [Docker](#docker) +* [Addon API](#addon-api) * [Starting a Working Group](#starting-a-wg) * [Bootstrap Governance](#bootstrap-governance) @@ -179,7 +180,7 @@ Their responsibilities are: * Maintain and improve the images' documentation. -### Addon API +### [Addon API](https://github.com/iojs/nan) The Addon API Working Group is responsible for maintaining the NAN project and corresponding _nan_ package in npm. The NAN project makes available an @@ -189,9 +190,9 @@ versions of Node.js, io.js, V8 and libuv. Their responsibilities are: -* Maintaining the [NAN](https://github.com/rvagg/nan) GitHub repository, +* Maintaining the [NAN](https://github.com/iojs/nan) GitHub repository, including code, issues and documentation. -* Maintaining the [addon-examples](https://github.com/rvagg/node-addon-examples) +* Maintaining the [addon-examples](https://github.com/iojs/node-addon-examples) GitHub repository, including code, issues and documentation. * Maintaining the C++ Addon API within the io.js project, in subordination to the io.js TC. @@ -202,7 +203,7 @@ Their responsibilities are: community advance notice of changes. The current members can be found in their -[README](https://github.com/rvagg/nan#collaborators). +[README](https://github.com/iojs/nan#collaborators). ## Starting a WG From bf7ac08dd01dcd7a0e3c27a9bf42f9759a8f6ea8 Mon Sep 17 00:00:00 2001 From: Christopher Monsanto Date: Sun, 19 Apr 2015 20:29:59 -0400 Subject: [PATCH 16/33] util: add Map and Set inspection support PR-URL: https://github.com/iojs/io.js/pull/1471 Reviewed-By: Chris Dickinson --- lib/util.js | 120 +++++++++++++++++++++++++---- test/parallel/test-util-inspect.js | 65 ++++++++++++++++ 2 files changed, 172 insertions(+), 13 deletions(-) diff --git a/lib/util.js b/lib/util.js index a04c19c7353fdf..9293587d58787a 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1,6 +1,7 @@ 'use strict'; const uv = process.binding('uv'); +const Debug = require('vm').runInDebugContext('Debug'); const formatRegExp = /%[sdj%]/g; exports.format = function(f) { @@ -192,6 +193,14 @@ function arrayToHash(array) { } +function inspectPromise(p) { + var mirror = Debug.MakeMirror(p, true); + if (!mirror.isPromise()) + return null; + return {status: mirror.status(), value: mirror.promiseValue().value_}; +} + + function formatValue(ctx, value, recurseTimes) { // Provide a hook for user-specified inspect functions. // Check that value is an object with an inspect function on it @@ -276,14 +285,43 @@ function formatValue(ctx, value, recurseTimes) { } } - var base = '', array = false, braces = ['{', '}']; + var base = '', empty = false, braces, formatter; - // Make Array say that they are Array if (Array.isArray(value)) { - array = true; braces = ['[', ']']; + empty = value.length === 0; + formatter = formatArray; + } else if (value instanceof Set) { + braces = ['Set {', '}']; + // With `showHidden`, `length` will display as a hidden property for + // arrays. For consistency's sake, do the same for `size`, even though this + // property isn't selected by Object.getOwnPropertyNames(). + if (ctx.showHidden) + keys.unshift('size'); + empty = value.size === 0; + formatter = formatSet; + } else if (value instanceof Map) { + braces = ['Map {', '}']; + // Ditto. + if (ctx.showHidden) + keys.unshift('size'); + empty = value.size === 0; + formatter = formatMap; + } else { + // Only create a mirror if the object superficially looks like a Promise. + var promiseInternals = value instanceof Promise && inspectPromise(value); + if (promiseInternals) { + braces = ['Promise {', '}']; + formatter = formatPromise; + } else { + braces = ['{', '}']; + empty = true; // No other data than keys. + formatter = formatObject; + } } + empty = empty === true && keys.length === 0; + // Make functions say that they are functions if (typeof value === 'function') { var n = value.name ? ': ' + value.name : ''; @@ -323,7 +361,7 @@ function formatValue(ctx, value, recurseTimes) { base = ' ' + '[Boolean: ' + formatted + ']'; } - if (keys.length === 0 && (!array || value.length === 0)) { + if (empty === true) { return braces[0] + base + braces[1]; } @@ -337,14 +375,7 @@ function formatValue(ctx, value, recurseTimes) { ctx.seen.push(value); - var output; - if (array) { - output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); - } else { - output = keys.map(function(key) { - return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); - }); - } + var output = formatter(ctx, value, recurseTimes, visibleKeys, keys); ctx.seen.pop(); @@ -397,6 +428,13 @@ function formatError(value) { } +function formatObject(ctx, value, recurseTimes, visibleKeys, keys) { + return keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, false); + }); +} + + function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { var output = []; for (var i = 0, l = value.length; i < l; ++i) { @@ -417,6 +455,59 @@ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { } +function formatSet(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + value.forEach(function(v) { + var nextRecurseTimes = recurseTimes === null ? null : recurseTimes - 1; + var str = formatValue(ctx, v, nextRecurseTimes); + output.push(str); + }); + keys.forEach(function(key) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, false)); + }); + return output; +} + + +function formatMap(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + value.forEach(function(v, k) { + var nextRecurseTimes = recurseTimes === null ? null : recurseTimes - 1; + var str = formatValue(ctx, k, nextRecurseTimes); + str += ' => '; + str += formatValue(ctx, v, nextRecurseTimes); + output.push(str); + }); + keys.forEach(function(key) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, false)); + }); + return output; +} + +function formatPromise(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + var internals = inspectPromise(value); + if (internals.status === 'pending') { + output.push(''); + } else { + var nextRecurseTimes = recurseTimes === null ? null : recurseTimes - 1; + var str = formatValue(ctx, internals.value, nextRecurseTimes); + if (internals.status === 'rejected') { + output.push(' ' + str); + } else { + output.push(str); + } + } + keys.forEach(function(key) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, false)); + }); + return output; +} + + function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { var name, str, desc; desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; @@ -488,7 +579,10 @@ function reduceToSingleString(output, base, braces) { if (length > 60) { return braces[0] + - (base === '' ? '' : base + '\n ') + + // If the opening "brace" is too large, like in the case of "Set {", + // we need to force the first item to be on the next line or the + // items will not line up correctly. + (base === '' && braces[0].length === 1 ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index f4aeced4d98abc..ac4bb0e84706b9 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -235,3 +235,68 @@ if (typeof Symbol !== 'undefined') { assert.equal(util.inspect(subject, options), '[ 1, 2, 3, [length]: 3, [Symbol(symbol)]: 42 ]'); } + +// test Set +assert.equal(util.inspect(new Set), 'Set {}'); +assert.equal(util.inspect(new Set([1, 2, 3])), 'Set { 1, 2, 3 }'); +var set = new Set(['foo']); +set.bar = 42; +assert.equal(util.inspect(set, true), 'Set { \'foo\', [size]: 1, bar: 42 }'); + +// test Map +assert.equal(util.inspect(new Map), 'Map {}'); +assert.equal(util.inspect(new Map([[1, 'a'], [2, 'b'], [3, 'c']])), + 'Map { 1 => \'a\', 2 => \'b\', 3 => \'c\' }'); +var map = new Map([['foo', null]]); +map.bar = 42; +assert.equal(util.inspect(map, true), + 'Map { \'foo\' => null, [size]: 1, bar: 42 }'); + +// test Promise +assert.equal(util.inspect(Promise.resolve(3)), 'Promise { 3 }'); +assert.equal(util.inspect(Promise.reject(3)), 'Promise { 3 }'); +assert.equal(util.inspect(new Promise(function() {})), 'Promise { }'); +var promise = Promise.resolve('foo'); +promise.bar = 42; +assert.equal(util.inspect(promise), 'Promise { \'foo\', bar: 42 }'); + +// Make sure it doesn't choke on polyfills. Unlike Set/Map, there is no standard +// interface to synchronously inspect a Promise, so our techniques only work on +// a bonafide native Promise. +var oldPromise = Promise; +global.Promise = function() { this.bar = 42; }; +assert.equal(util.inspect(new Promise), '{ bar: 42 }'); +global.Promise = oldPromise; + + +// Test alignment of items in container +// Assumes that the first numeric character is the start of an item. + +function checkAlignment(container) { + var lines = util.inspect(container).split('\n'); + var pos; + lines.forEach(function(line) { + var npos = line.search(/\d/); + if (npos !== -1) { + if (pos !== undefined) + assert.equal(pos, npos, 'container items not aligned'); + pos = npos; + } + }); +} + +var big_array = []; +for (var i = 0; i < 100; i++) { + big_array.push(i); +} + +checkAlignment(big_array); +checkAlignment(function() { + var obj = {}; + big_array.forEach(function(v) { + obj[v] = null; + }); + return obj; +}()); +checkAlignment(new Set(big_array)); +checkAlignment(new Map(big_array.map(function (y) { return [y, null] }))); From 3bda6cbfa4a9bb073790d53bc14e85b6e575bbe5 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Wed, 15 Apr 2015 13:58:50 -0700 Subject: [PATCH 17/33] win,node-gyp: enable delay-load hook by default The delay-load hook allows node.exe/iojs.exe to be renamed. See efadffe for more background. PR-URL: https://github.com/iojs/io.js/pull/1433 Reviewed-By: Ben Noordhuis --- deps/npm/node_modules/node-gyp/addon.gypi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/npm/node_modules/node-gyp/addon.gypi b/deps/npm/node_modules/node-gyp/addon.gypi index 1604f248caad46..1fe142f70da367 100644 --- a/deps/npm/node_modules/node-gyp/addon.gypi +++ b/deps/npm/node_modules/node-gyp/addon.gypi @@ -1,7 +1,7 @@ { 'target_defaults': { 'type': 'loadable_module', - 'win_delay_load_hook': 'false', + 'win_delay_load_hook': 'true', 'product_prefix': '', 'include_dirs': [ From 547213913b2e1525c15968916452995ab14e2195 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Sun, 26 Apr 2015 20:59:45 +1000 Subject: [PATCH 18/33] test: adjust Makefile/test-ci, add to vcbuild.bat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/iojs/io.js/pull/1530 Reviewed-By: Johan Bergström --- Makefile | 4 +++- vcbuild.bat | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 28fd263c94eb9c..c714e95a857c28 100644 --- a/Makefile +++ b/Makefile @@ -112,7 +112,9 @@ test-all-valgrind: test-build $(PYTHON) tools/test.py --mode=debug,release --valgrind test-ci: - $(PYTHON) tools/test.py -p tap --logfile test.tap -J parallel sequential message + $(PYTHON) tools/test.py -p tap --logfile test.tap --mode=release -J message parallel sequential + $(MAKE) jslint + $(MAKE) cpplint test-release: test-build $(PYTHON) tools/test.py --mode=release diff --git a/vcbuild.bat b/vcbuild.bat index 44d149d32241b4..2cf94ad5fdf370 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -52,6 +52,7 @@ if /i "%1"=="noetw" set noetw=1&goto arg-ok if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok if /i "%1"=="licensertf" set licensertf=1&goto arg-ok if /i "%1"=="test" set test_args=%test_args% sequential parallel message -J&set jslint=1&goto arg-ok +if /i "%1"=="test-ci" set test_args=%test_args% -p tap --logfile test.tap -J message sequential parallel&set jslint=1&goto arg-ok if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok if /i "%1"=="test-message" set test_args=%test_args% message&goto arg-ok if /i "%1"=="test-gc" set test_args=%test_args% gc&set buildnodeweak=1&goto arg-ok From bfae8236b13be7b63668e96f5674cfa5cf5c4988 Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Sun, 26 Apr 2015 08:52:10 -0500 Subject: [PATCH 19/33] test: fix test-net-dns-custom-lookup test assertion The assertion made an assumption that the IPv6 address would always be `::1`. Since the address can be different on different platforms, it has been changed to allow multiple addresses. Fixes: https://github.com/iojs/io.js/issues/1527 PR-URL: https://github.com/iojs/io.js/pull/1531 Reviewed-By: Rod Vagg --- test/parallel/test-net-dns-custom-lookup.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-net-dns-custom-lookup.js b/test/parallel/test-net-dns-custom-lookup.js index 3979bbf0b6d2c5..05ca09cc66ff42 100644 --- a/test/parallel/test-net-dns-custom-lookup.js +++ b/test/parallel/test-net-dns-custom-lookup.js @@ -11,15 +11,16 @@ function check(addressType, cb) { cb && cb(); }); - var address = addressType === 4 ? '127.0.0.1' : '::1'; + var address = addressType === 4 ? common.localhostIPv4 : '::1'; server.listen(common.PORT, address, function() { net.connect({ port: common.PORT, host: 'localhost', + family: addressType, lookup: lookup }).on('lookup', function(err, ip, type) { assert.equal(err, null); - assert.equal(ip, address); + assert.equal(address, ip); assert.equal(type, addressType); ok = true; }); @@ -27,7 +28,15 @@ function check(addressType, cb) { function lookup(host, dnsopts, cb) { dnsopts.family = addressType; - dns.lookup(host, dnsopts, cb); + if (addressType === 4) { + process.nextTick(function() { + cb(null, common.localhostIPv4, 4); + }); + } else { + process.nextTick(function() { + cb(null, '::1', 6); + }); + } } } From 2a3c8c187e4462f93169b6c98bea552edcace972 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Tue, 28 Apr 2015 15:01:20 +1000 Subject: [PATCH 20/33] build: remove -J from test-ci MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit parallel tests still not working on most build slaves PR-URL: https://github.com/iojs/io.js/pull/1544 Reviewed-By: Johan Bergström --- Makefile | 2 +- vcbuild.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c714e95a857c28..8fc67d604e91b0 100644 --- a/Makefile +++ b/Makefile @@ -112,7 +112,7 @@ test-all-valgrind: test-build $(PYTHON) tools/test.py --mode=debug,release --valgrind test-ci: - $(PYTHON) tools/test.py -p tap --logfile test.tap --mode=release -J message parallel sequential + $(PYTHON) tools/test.py -p tap --logfile test.tap --mode=release message parallel sequential $(MAKE) jslint $(MAKE) cpplint diff --git a/vcbuild.bat b/vcbuild.bat index 2cf94ad5fdf370..97d6ba3bbc5511 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -52,7 +52,7 @@ if /i "%1"=="noetw" set noetw=1&goto arg-ok if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok if /i "%1"=="licensertf" set licensertf=1&goto arg-ok if /i "%1"=="test" set test_args=%test_args% sequential parallel message -J&set jslint=1&goto arg-ok -if /i "%1"=="test-ci" set test_args=%test_args% -p tap --logfile test.tap -J message sequential parallel&set jslint=1&goto arg-ok +if /i "%1"=="test-ci" set test_args=%test_args% -p tap --logfile test.tap message sequential parallel&set jslint=1&goto arg-ok if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok if /i "%1"=="test-message" set test_args=%test_args% message&goto arg-ok if /i "%1"=="test-gc" set test_args=%test_args% gc&set buildnodeweak=1&goto arg-ok From e55fdc47a7420e81ca0ddec5449839b43382bea3 Mon Sep 17 00:00:00 2001 From: Nick Raienko Date: Mon, 27 Apr 2015 18:04:11 +0300 Subject: [PATCH 21/33] doc: fix util.deprecate example PR-URL: https://github.com/iojs/io.js/pull/1535 Reviewed-By: Jeremiah Senkpiel Reviewed-By: Evan Lucas Reviewed-By: Julian Duque --- doc/api/util.markdown | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/util.markdown b/doc/api/util.markdown index 77d9a8f66b58d4..8ac15826933743 100644 --- a/doc/api/util.markdown +++ b/doc/api/util.markdown @@ -438,11 +438,13 @@ through the `constructor.super_` property. Marks that a method should not be used any more. - exports.puts = exports.deprecate(function() { + var util = require('util'); + + exports.puts = util.deprecate(function() { for (var i = 0, len = arguments.length; i < len; ++i) { process.stdout.write(arguments[i] + '\n'); } - }, 'util.puts: Use console.log instead') + }, 'util.puts: Use console.log instead'); It returns a modified function which warns once by default. From 0fa6c4a6fc7ed4a2dfe821f1d3a46d5f6ff43e69 Mon Sep 17 00:00:00 2001 From: Brian White Date: Tue, 28 Apr 2015 10:53:06 -0400 Subject: [PATCH 22/33] string_decoder: don't cache Buffer.isEncoding Some modules are monkey-patching Buffer.isEncoding, so without this they cannot do that. Fixes: https://github.com/iojs/io.js/issues/1547 PR-URL: https://github.com/iojs/io.js/pull/1548 Reviewed-By: Evan Lucas Reviewed-By: Ben Noordhuis --- lib/string_decoder.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/string_decoder.js b/lib/string_decoder.js index 61a3bb20d588d3..62ea38e08f051c 100644 --- a/lib/string_decoder.js +++ b/lib/string_decoder.js @@ -1,9 +1,9 @@ 'use strict'; -const isEncoding = Buffer.isEncoding; - function assertEncoding(encoding) { - if (encoding && !isEncoding(encoding)) { + // Do not cache `Buffer.isEncoding`, some modules monkey-patch it to support + // additional encodings + if (encoding && !Buffer.isEncoding(encoding)) { throw new Error('Unknown encoding: ' + encoding); } } From 391cae3595e5b426be50cf26a2ae02c346c2a63f Mon Sep 17 00:00:00 2001 From: Yosuke Furukawa Date: Mon, 20 Apr 2015 15:04:55 +0900 Subject: [PATCH 23/33] doc: Add Known issues to v1.7.0/1.7.1 CHANGELOG PR-URL: https://github.com/iojs/io.js/pull/1473 Reviewed-By: Brendan Ashworth --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eee2e8ba128b0..0f90be7a5a4e0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -96,6 +96,14 @@ will be removed at a later point. (Roman Reiss) [#1363](https://github.com/iojs/ * **build**: A syntax error in the Makefile for release builds caused 1.7.0 to be DOA and unreleased. (Rod Vagg) [#1421](https://github.com/iojs/io.js/pull/1421). +### Known issues + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/iojs/io.js/issues/1264). +* Surrogate pair in REPL can freeze terminal [#690](https://github.com/iojs/io.js/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/iojs/io.js/issues/760) and fix in [#774](https://github.com/iojs/io.js/issues/774) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/iojs/io.js/issues/894) +* readline: split escapes are processed incorrectly, see [#1403](https://github.com/iojs/io.js/issues/1403) + ### Commits * [[`aee86a21f2`](https://github.com/iojs/io.js/commit/aee86a21f2)] - **build**: fix RELEASE check (Rod Vagg) [#1421](https://github.com/iojs/io.js/pull/1421) @@ -114,6 +122,14 @@ will be removed at a later point. (Roman Reiss) [#1363](https://github.com/iojs/ * [`78005eb`](https://github.com/npm/npm/commit/78005ebb6f4103c20f077669c3929b7ea46a4c0d)[#7743](https://github.com/npm/npm/issues/7743) Always quote arguments passed to `npm run-script`. This allows build systems and the like to safely escape glob patterns passed as arguments to `run-scripts` with `npm run-script