Use the *real* versions of the Date and RegExp functions, from the
prototype. This defends against code like:
var d = new Date()
d.toUTCString = null
util.inspect(d)
// TypeError: toUTCString is not a function
Fixes #1944.
While using `instanceof`, these functions could easily be faked with something
like: Object.create(Date.prototype)
So let's just not use it at all. A little slower, but these functions are only
used in the REPL / for debugging so it's OK.
Fixes #1941.
Fixes #1942.
Just a syntactic sugar for doing, for example:
var server = net.createServer(function (c) {
c.end('goodbye, cruel world!\r\n');
server.close().on('close', function () {
console.log('really, goodbye!');
});
}).listen(1337);
Fixes #1922.
http2.js
protocols object to store defaults for http and https, and use as a switch for supported protocols.
options.hostname > options.host > 'localhost'
if I have an options.auth element and I do not have an Authorization header, I do basic auth.
http.request collapses to new ClientRequest since the defaults are handled by the protocol object
test-http-url.parse*
Fixes #1390
Conflicts:
lib/http2.js
added a .path property = .pathname + .search for use with http.request
And tests to verify everything.
With the tests, I changed over to deepEqual, and I would note the comment on the test
['.//g', 'f:/a', 'f://g'], which I think is a fundamental problem
This supersedes pull 1596
Fix #1484
Fix #1834
Fix #1482
Fix #771
It's been a while now, and we've seen how this separate context thing
works. It constantly confuses people, and no one actually uses '.clear'
anyway, so the benefit of that feature does not justify the constant
WTFery.
This makes repl.context actually be a getter that returns the global
object, and prints a deprecation warning. The '.clear' command is gone,
and will report that it's an invalid repl keyword. Tests updated to
allow the require, module, and exports globals, which are still
available in the repl just like they were before, by making them global.
This commit fixes two bugs in the handling of write requests when the connect()
call is still in progress.
1. The deferred write request's size was counted twice towards `.bytesWritten`.
2. The callback was not called. After connecting, `Socket.write()` was called
with three arguments (data, encoding, cb) but it ignored the third argument.
Coincidentally fixes test/simple/test-net-connect-buffer.js.