Skip to content

Commit 78d245f

Browse files
committed
Merge remote-tracking branch 'origin/v0.10'
Conflicts: configure lib/_stream_readable.js lib/http.js src/node_dtrace.cc
2 parents 34bf6e4 + 47abdd9 commit 78d245f

12 files changed

Lines changed: 139 additions & 22 deletions

configure

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,13 +464,15 @@ def configure_node(o):
464464
if not is_clang and cc_version < (4,0,0):
465465
o['variables']['visibility'] = ''
466466

467-
if flavor in ('solaris', 'mac', 'linux'):
467+
if flavor in ('solaris', 'mac', 'linux', 'freebsd'):
468468
use_dtrace = not options.without_dtrace
469-
# Don't enable by default on linux, it needs the sdt-devel package.
469+
# Don't enable by default on linux and freebsd
470+
if flavor in ('linux', 'freebsd'):
471+
use_dtrace = options.with_dtrace
472+
470473
if flavor == 'linux':
471474
if options.systemtap_includes:
472475
o['include_dirs'] += [options.systemtap_includes]
473-
use_dtrace = options.with_dtrace
474476
o['variables']['node_use_dtrace'] = b(use_dtrace)
475477
o['variables']['uv_use_dtrace'] = b(use_dtrace)
476478
o['variables']['uv_parent_path'] = '/deps/uv/'

doc/api/assert.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Tests strict non-equality, as determined by the strict not equal operator ( `!==
3939

4040
## assert.throws(block, [error], [message])
4141

42-
Expects `block` to throw an error. `error` can be constructor, regexp or
42+
Expects `block` to throw an error. `error` can be constructor, `RegExp` or
4343
validation function.
4444

4545
Validate instanceof using constructor:
@@ -76,7 +76,7 @@ Custom error validation:
7676

7777
## assert.doesNotThrow(block, [message])
7878

79-
Expects `block` not to throw an error, see assert.throws for details.
79+
Expects `block` not to throw an error, see `assert.throws` for details.
8080

8181
## assert.ifError(value)
8282

lib/_http_client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function ClientRequest(options, cb) {
5353
var defaultAgent = options._defaultAgent || Agent.globalAgent;
5454
if (agent === false) {
5555
agent = new defaultAgent.constructor();
56-
} else if (util.isNullOrUndefined(agent)) {
56+
} else if (util.isNullOrUndefined(agent) && !options.createConnection) {
5757
agent = defaultAgent;
5858
}
5959
self.agent = agent;
@@ -70,9 +70,9 @@ function ClientRequest(options, cb) {
7070
throw new Error('Protocol:' + options.protocol + ' not supported.');
7171
}
7272

73-
var defaultPort = options.defaultPort || self.agent.defaultPort;
73+
var defaultPort = options.defaultPort || self.agent && self.agent.defaultPort;
7474

75-
var port = options.port = options.port || defaultPort;
75+
var port = options.port = options.port || defaultPort || 80;
7676
var host = options.host = options.hostname || options.host || 'localhost';
7777

7878
if (util.isUndefined(options.setHost)) {

lib/_stream_readable.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,7 @@ function chunkInvalid(state, chunk) {
373373
if (!util.isBuffer(chunk) &&
374374
!util.isString(chunk) &&
375375
!util.isNullOrUndefined(chunk) &&
376-
!state.objectMode &&
377-
!er) {
376+
!state.objectMode) {
378377
er = new TypeError('Invalid non-string/buffer chunk');
379378
}
380379
return er;

lib/_tls_wrap.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// Copyright Joyent, Inc. and other Node contributors.
22
//
3+
// // Emit `beforeExit` if the loop became alive either after emitting
4+
// event, or after running some callbacks.
5+
//
36
// Permission is hereby granted, free of charge, to any person obtaining a
47
// copy of this software and associated documentation files (the
58
// "Software"), to deal in the Software without restriction, including

lib/assert.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,11 @@ function objEquiv(a, b) {
201201
if (a.prototype !== b.prototype) return false;
202202
//~~~I've managed to break Object.keys through screwy arguments passing.
203203
// Converting to array solves the problem.
204-
if (isArguments(a)) {
205-
if (!isArguments(b)) {
206-
return false;
207-
}
204+
var aIsArgs = isArguments(a),
205+
bIsArgs = isArguments(b);
206+
if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
207+
return false;
208+
if (aIsArgs) {
208209
a = pSlice.call(a);
209210
b = pSlice.call(b);
210211
return _deepEqual(a, b);

node.gyp

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,12 @@
187187
}],
188188
[ 'node_use_dtrace=="true"', {
189189
'defines': [ 'HAVE_DTRACE=1' ],
190-
'dependencies': [ 'node_dtrace_header' ],
190+
'dependencies': [
191+
'node_dtrace_header',
192+
'specialize_node_d',
193+
],
191194
'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
195+
192196
#
193197
# DTrace is supported on linux, solaris, mac, and bsd. There are
194198
# three object files associated with DTrace support, but they're
@@ -544,10 +548,36 @@
544548
]
545549
} ],
546550
]
547-
}
551+
},
548552
]
549553
} ],
550554
]
555+
},
556+
{
557+
'target_name': 'specialize_node_d',
558+
'type': 'none',
559+
'conditions': [
560+
[ 'node_use_dtrace=="true"', {
561+
'actions': [
562+
{
563+
'action_name': 'specialize_node_d',
564+
'inputs': [
565+
'src/node.d'
566+
],
567+
'outputs': [
568+
'<(PRODUCT_DIR)/node.d',
569+
],
570+
'action': [
571+
'tools/specialize_node_d.py',
572+
'<@(_outputs)',
573+
'<@(_inputs)',
574+
'<@(OS)',
575+
'<@(target_arch)',
576+
],
577+
},
578+
],
579+
} ],
580+
]
551581
}
552582
] # end targets
553583
}

src/node_dtrace.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ void DTRACE_HTTP_CLIENT_RESPONSE(const FunctionCallbackInfo<Value>& args) {
287287
}
288288

289289

290-
static int dtrace_gc_start(GCType type, GCCallbackFlags flags) {
290+
int dtrace_gc_start(GCType type, GCCallbackFlags flags) {
291291
NODE_GC_START(type, flags);
292292
/*
293293
* We avoid the tail-call elimination of the USDT probe (which screws up
@@ -297,7 +297,7 @@ static int dtrace_gc_start(GCType type, GCCallbackFlags flags) {
297297
}
298298

299299

300-
static int dtrace_gc_done(GCType type, GCCallbackFlags flags) {
300+
int dtrace_gc_done(GCType type, GCCallbackFlags flags) {
301301
NODE_GC_DONE(type, flags);
302302
return 0;
303303
}

test/simple/test-assert.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ try {
249249
gotError = true;
250250
}
251251

252+
// GH-7178. Ensure reflexivity of deepEqual with `arguments` objects.
253+
var args = (function() { return arguments; })();
254+
a.throws(makeBlock(a.deepEqual, [], args));
255+
a.throws(makeBlock(a.deepEqual, args, []));
256+
252257
console.log('All OK');
253258
assert.ok(gotError);
254259

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright Joyent, Inc. and other Node contributors.
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a
4+
// copy of this software and associated documentation files (the
5+
// "Software"), to deal in the Software without restriction, including
6+
// without limitation the rights to use, copy, modify, merge, publish,
7+
// distribute, sublicense, and/or sell copies of the Software, and to permit
8+
// persons to whom the Software is furnished to do so, subject to the
9+
// following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included
12+
// in all copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
22+
var common = require('../common');
23+
var assert = require('assert');
24+
var http = require('http');
25+
var net = require('net');
26+
27+
var create = 0;
28+
var response = 0;
29+
process.on('exit', function() {
30+
assert.equal(1, create, 'createConnection() http option was not called');
31+
assert.equal(1, response, 'http server "request" callback was not called');
32+
});
33+
34+
var server = http.createServer(function(req, res) {
35+
res.end();
36+
response++;
37+
}).listen(common.PORT, '127.0.0.1', function() {
38+
http.get({ createConnection: createConnection }, function (res) {
39+
res.resume();
40+
server.close();
41+
});
42+
});
43+
44+
function createConnection() {
45+
create++;
46+
return net.createConnection(common.PORT, '127.0.0.1');
47+
}

0 commit comments

Comments
 (0)