0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
Commit Graph

14 Commits

Author SHA1 Message Date
Ryan Dahl
8185e1fd25 Remove include() add node.mixin()
include() should not be used by libraries because it will pollute the global
namespace. To discourage this behavior and bring Node more in-line with
the current CommonJS module system, include() is removed.

Small scripts like unit tests often times do want to pollute the global
namespace for ease. To avoid the boiler plate code of

  var x = require("/x.js");
  var foo = x.foo;
  var bar = x.bar;

The function node.mixin() is stolen from jQuery's jQuery.extend. So that it
can be written:

  node.mixin(require("/x.js"));

Reference:
http://docs.jquery.com/Utilities/jQuery.extend
http://groups.google.com/group/nodejs/browse_thread/thread/f9ac83e5c11e7e87
2009-10-05 15:46:31 +02:00
Ryan Dahl
522909bcbf Parse queryString into req.uri.params 2009-10-05 14:52:26 +02:00
Ryan Dahl
095470854b Move tcp library to /tcp.js 2009-09-28 18:48:18 +02:00
Ryan Dahl
f6657c3c9d Move http library to /http.js 2009-09-28 12:36:36 +02:00
Ryan Dahl
4b8f503fac Move mjsunit.js to system module directory. 2009-09-20 18:19:33 +02:00
Ryan
723c7d9f7c Replace onExit() with process.addListener("exit")
- Update documentation.

- Depreciation message for onExit().
2009-08-26 22:14:44 +02:00
Ryan
31265be4a6 Depreciate onLoad 2009-08-26 22:14:44 +02:00
Ryan
316e2833f0 Use flat object instead of array-of-arrays for HTTP headers.
E.G. { "Content-Length": 10, "Content-Type": "text/html" } instead of
[["Content-Length", 10], ["Content-Type", "text/html"]].
The main reason for this change is object-creation efficiency.

This still needs testing and some further changes (like when receiving
multiple header lines with the same field-name, they are concatenated with a
comma but some headers ("Content-Length") should not be concatenated ; the
new header line should replace the old value).

Various thoughts on this subject:
http://groups.google.com/group/nodejs/browse_thread/thread/9a67bb32706d9efc#
http://four.livejournal.com/979640.html
http://mail.gnome.org/archives/libsoup-list/2009-March/msg00015.html
2009-08-23 12:32:49 +02:00
Ryan
7aaab320b3 API: tcp.Connection "disconnect" event renamed to "close".
More semantic, since the event will be emitted on connection error,
when the connection was ever established.
2009-08-14 12:51:46 +02:00
Ryan
8047b912c0 Change 'new node.tcp.Connection' to 'node.tcp.createConnection' 2009-06-30 13:56:52 +02:00
Ryan
d428eff023 Snakecase events . 2009-06-29 13:18:30 +02:00
Ryan
ed926da691 Remove onEvent compatibility 2009-06-28 19:08:26 +02:00
Ryan
ed3d6a63d5 Further expand EventEmitter to TCP and HTTP
The constructor for TCP servers can no longer take a connection handler for
purely technical reasons. (The constructor for EventEmitter is implemented
in C++ but addListener is in javascript, and I don't want to make too many
C++ -> Javascript references.) Thus I introduce new constructor methods to
ease the creation of the servers:

  node.tcp.createServer()
  node.http.createServer()

These work almost the same as the old constructors.

In general we're working towards a future where no constructors are
publicly exposed or take arguments.

The HTTP events like "on_uri" are not yet using the event interface.
onMessage still is a constructor - but this will change soon.
2009-06-28 19:08:26 +02:00
Ryan
3fed1a0954 Use v8's test runner 2009-06-22 14:08:42 +02:00