platform/upstream/nodejs.git
15 years agoBugfix: require() and include() should work in callbacks.
Ryan Dahl [Tue, 29 Sep 2009 17:28:54 +0000 (19:28 +0200)]
Bugfix: require() and include() should work in callbacks.

Removing requireAsync and includeAsync from global scope for now as a
temporary fix.  Reported by Yuffster.

15 years agoClean up some text in documentation.
Ryan Dahl [Tue, 29 Sep 2009 16:06:36 +0000 (18:06 +0200)]
Clean up some text in documentation.

15 years agoCamel-case all http events
Ryan Dahl [Tue, 29 Sep 2009 16:06:14 +0000 (18:06 +0200)]
Camel-case all http events

15 years agoCopy Python's shutil.copytree into wscript.
Ryan Dahl [Mon, 28 Sep 2009 20:39:00 +0000 (22:39 +0200)]
Copy Python's shutil.copytree into wscript.

It's broken in Python 2.4.4. One gets this message when trying to run
configure:

  [...]
  Checking for SYS_clock_gettime           : ok
  Checking for library rt                  : ok
  Checking for function clock_gettime      : ok
  Checking for function nanosleep          : ok
  Checking for function ceil               : ok
  ---- deps/udns ----
  Traceback (most recent call last):
    File "/path/to/node/tools/waf", line 148, in ?
      Scripting.prepare(t, cwd, VERSION, wafdir)
    File "/path/to/node/tools/.waf-1.5.8-3e327cd9534c48e6762f56fdb1332663/wafadmin/Scripting.py", line 102, in prepare
      prepare_impl(t,cwd,ver,wafdir)
    File "/path/to/node/tools/.waf-1.5.8-3e327cd9534c48e6762f56fdb1332663/wafadmin/Scripting.py", line 95, in prepare_impl
      main()
    File "/path/to/node/tools/.waf-1.5.8-3e327cd9534c48e6762f56fdb1332663/wafadmin/Scripting.py", line 130, in main
      fun(ctx)
    File "/path/to/node/tools/.waf-1.5.8-3e327cd9534c48e6762f56fdb1332663/wafadmin/Scripting.py", line 168, in configure
      conf.sub_config([''])
    File "/path/to/node/tools/.waf-1.5.8-3e327cd9534c48e6762f56fdb1332663/wafadmin/Configure.py", line 100, in sub_config
      self.recurse(k,name='configure')
    File "/path/to/node/tools/.waf-1.5.8-3e327cd9534c48e6762f56fdb1332663/wafadmin/Utils.py", line 391, in recurse
      f(self)
    File "<string>", line 82, in configure
    File "<string>", line 48, in conf_subproject
    File "/usr/lib/python2.4/shutil.py", line 111, in copytree
      os.mkdir(dst)
  OSError: [Errno 2] No such file or directory: '/sites/rabidlabs.net/sandboxes/m/public_html/projects/0909.node/node/build/default/deps/udns'

The problem is probably this:
http://mail.python.org/pipermail/python-bugs-list/2005-January/027118.html

As a solution I am copying 2.6's version of the function in.

15 years agoAdd doc for node.compile()
Ryan Dahl [Mon, 28 Sep 2009 20:16:43 +0000 (22:16 +0200)]
Add doc for node.compile()

15 years agoUpdate module loading docs
Ryan Dahl [Mon, 28 Sep 2009 17:44:40 +0000 (19:44 +0200)]
Update module loading docs

15 years agoAdd warning when coroutine stack size grows too large.
Ryan Dahl [Mon, 28 Sep 2009 16:10:25 +0000 (18:10 +0200)]
Add warning when coroutine stack size grows too large.

For the moment too large is 10.

15 years agodocs: Reference node.libraryPaths in helpers section.
Ryan Dahl [Mon, 28 Sep 2009 16:03:43 +0000 (18:03 +0200)]
docs: Reference node.libraryPaths in helpers section.

15 years agoClean up some things in the repl, add docs.
Ryan Dahl [Mon, 28 Sep 2009 15:37:34 +0000 (17:37 +0200)]
Clean up some things in the repl, add docs.

15 years agoError message on bad module load.
Ryan Dahl [Mon, 28 Sep 2009 15:12:28 +0000 (17:12 +0200)]
Error message on bad module load.

15 years agoAPI: Move node.exit() to process.exit().
Ryan Dahl [Mon, 28 Sep 2009 14:50:19 +0000 (16:50 +0200)]
API: Move node.exit() to process.exit().

15 years agoinclude utils in the repl.
Ryan Dahl [Mon, 28 Sep 2009 14:50:03 +0000 (16:50 +0200)]
include utils in the repl.

15 years agoDon't delete timer object on clearTimeout.
Ryan Dahl [Mon, 28 Sep 2009 14:13:33 +0000 (16:13 +0200)]
Don't delete timer object on clearTimeout.

I've heard delete is inefficient in v8. Better to let the garbage collector
take care of it naturally.

15 years agoMove tcp library to /tcp.js
Ryan Dahl [Mon, 28 Sep 2009 14:08:09 +0000 (16:08 +0200)]
Move tcp library to /tcp.js

15 years agoAdd forgotten file lib/utils.js
Ryan Dahl [Mon, 28 Sep 2009 15:44:52 +0000 (17:44 +0200)]
Add forgotten file lib/utils.js

15 years agohttp.js license reference
Ryan Dahl [Mon, 28 Sep 2009 16:47:45 +0000 (18:47 +0200)]
http.js license reference

15 years agoMove http library to /http.js
Ryan Dahl [Mon, 28 Sep 2009 10:36:36 +0000 (12:36 +0200)]
Move http library to /http.js

15 years agoAPI: Move node.puts(), node.exec() and others to /utils.js
Ryan Dahl [Mon, 28 Sep 2009 10:06:30 +0000 (12:06 +0200)]
API: Move node.puts(), node.exec() and others to /utils.js

15 years agoRemove api.xml from gitignore
Ryan Dahl [Mon, 28 Sep 2009 09:46:09 +0000 (11:46 +0200)]
Remove api.xml from gitignore

15 years agoMultipart stream parser
Felix Geisendörfer [Sun, 27 Sep 2009 14:52:33 +0000 (16:52 +0200)]
Multipart stream parser

15 years agoAdd docbook documentation
Ryan Dahl [Sun, 27 Sep 2009 10:52:28 +0000 (12:52 +0200)]
Add docbook documentation

15 years agoAdd node.inspect() and deprecate p().
Ryan Dahl [Sun, 27 Sep 2009 10:33:44 +0000 (12:33 +0200)]
Add node.inspect() and deprecate p().

15 years agoreadFile/writeFile to read/write in file library.
Ryan Dahl [Sun, 27 Sep 2009 09:07:54 +0000 (11:07 +0200)]
readFile/writeFile to read/write in file library.

as suggested by Bluebie.

15 years agoFixes for libeio wscript on Debian.
Jeremy Lal [Sun, 27 Sep 2009 08:45:52 +0000 (10:45 +0200)]
Fixes for libeio wscript on Debian.

- Link libeio to pthread.
- Add -D_GNU_SOURCE to libeio wscript.

15 years agoChanges to compile on Andrew Miller's very old machine
Ryan Dahl [Sat, 26 Sep 2009 13:10:56 +0000 (15:10 +0200)]
Changes to compile on Andrew Miller's very old machine

15 years agoRemove -Werror on v8, for compiling on GCC 4.4
Ryan Dahl [Fri, 25 Sep 2009 06:40:34 +0000 (08:40 +0200)]
Remove -Werror on v8, for compiling on GCC 4.4

15 years agoWhen printing, check to see if value is undefined. If so, print nothing.
RayMorgan [Fri, 25 Sep 2009 05:16:07 +0000 (22:16 -0700)]
When printing, check to see if value is undefined. If so, print nothing.

15 years agoAdded _ that is te result of the previous command.
RayMorgan [Fri, 25 Sep 2009 02:53:11 +0000 (19:53 -0700)]
Added _ that is te result of the previous command.

15 years agoEnhanced the repl library.
RayMorgan [Fri, 25 Sep 2009 01:56:37 +0000 (18:56 -0700)]
Enhanced the repl library.

Now supports:
- command options: .help, .break, .clear, .exit
- local vars and global functions
- ability to print 0, false and ""
- when value is a function, prints [Function]
- when object is circular, prints [Circular Object] instead of throwing an error

15 years agobump version v0.1.12
Ryan Dahl [Thu, 24 Sep 2009 11:51:10 +0000 (13:51 +0200)]
bump version

15 years agoClean up website a bit.
Ryan Dahl [Thu, 24 Sep 2009 11:44:25 +0000 (13:44 +0200)]
Clean up website a bit.

15 years agoExtract the good parts of node-repl into standalone library.
Ryan Dahl [Wed, 23 Sep 2009 22:56:24 +0000 (00:56 +0200)]
Extract the good parts of node-repl into standalone library.

Now you can require("/repl.js") in your server to be able to examine it
while it's running.

15 years agoDecrease default TCP backlog to 128
Ryan Dahl [Wed, 23 Sep 2009 15:54:38 +0000 (17:54 +0200)]
Decrease default TCP backlog to 128

...after seeing http://lionet.livejournal.com/42016.html

15 years agoChange example at beginning of api.txt
Ryan Dahl [Wed, 23 Sep 2009 15:00:20 +0000 (17:00 +0200)]
Change example at beginning of api.txt

15 years agoSyntax highlighting for <tt> elements.
Ryan Dahl [Wed, 23 Sep 2009 14:58:28 +0000 (16:58 +0200)]
Syntax highlighting for <tt> elements.

15 years agoAdd documentation about requiring system modules.
Ryan Dahl [Wed, 23 Sep 2009 14:53:31 +0000 (16:53 +0200)]
Add documentation about requiring system modules.

15 years agoTighten window on timer test.
Ryan Dahl [Wed, 23 Sep 2009 14:39:43 +0000 (16:39 +0200)]
Tighten window on timer test.

15 years agocpplint.js file.{cc,h}
Ryan Dahl [Wed, 23 Sep 2009 14:33:24 +0000 (16:33 +0200)]
cpplint.js file.{cc,h}

15 years agoCall "connection" event after connection object is fully formed.
Ryan Dahl [Wed, 23 Sep 2009 14:09:40 +0000 (16:09 +0200)]
Call "connection" event after connection object is fully formed.

This became an apparent problem when adding setNoDelay because the command
was ignored if issued during the "connection" event.

15 years agoAdd connection.setNoDelay() to disable Nagle algorithm.
Ryan Dahl [Wed, 23 Sep 2009 13:35:03 +0000 (15:35 +0200)]
Add connection.setNoDelay() to disable Nagle algorithm.

15 years agoUpgrade v8 to 1.3.13
Ryan Dahl [Wed, 23 Sep 2009 12:49:51 +0000 (14:49 +0200)]
Upgrade v8 to 1.3.13

15 years agoSyntax highlighting for api.html.
Felix Geisendörfer [Tue, 22 Sep 2009 22:46:56 +0000 (00:46 +0200)]
Syntax highlighting for api.html.

Asciidoc does not seem to support including custom JS, so this patch is a hack
for toc.js to dynamically include the needed CSS / JS. It should be ok unless
somebody has a better approach ...

15 years agoBugfix: EIOPromise::Create was allocating two EIOPromise objects
Ryan Dahl [Tue, 22 Sep 2009 22:14:28 +0000 (00:14 +0200)]
Bugfix: EIOPromise::Create was allocating two EIOPromise objects

This is because it would call the javascript initializer which executed
Promise::New, and then it would rewrap the handle. Instead I make an
explicit inheritance from EIOPromise to Promise.

This seems to fix a memory leak which was reported by Ray Morgan:
http://groups.google.com/group/nodejs/browse_thread/thread/e38949b1989da1d7

15 years agodelete[] instead of delete for arrays.
Ryan Dahl [Tue, 22 Sep 2009 16:35:15 +0000 (18:35 +0200)]
delete[] instead of delete for arrays.

15 years agoAdd readFile to '/file.js'
Ryan Dahl [Tue, 22 Sep 2009 15:27:50 +0000 (17:27 +0200)]
Add readFile to '/file.js'

Thanks Hagen.

15 years agoAdd writeFile() to /file.js
Ryan Dahl [Tue, 22 Sep 2009 10:15:45 +0000 (12:15 +0200)]
Add writeFile() to /file.js

Initial patch by Tim Caswell.

15 years agoRemove "raw" encoding. Rename "raws" to "binary".
Ryan Dahl [Mon, 21 Sep 2009 10:27:22 +0000 (12:27 +0200)]
Remove "raw" encoding. Rename "raws" to "binary".

Deprecation warnings have been added to help the conversion to this new API.

15 years agoMove node-repl to bin/node-repl
Ryan Dahl [Sun, 20 Sep 2009 18:54:19 +0000 (20:54 +0200)]
Move node-repl to bin/node-repl

15 years agoAdd "/file.js" buffered disk I/O object.
Ryan Dahl [Sun, 20 Sep 2009 18:40:20 +0000 (20:40 +0200)]
Add "/file.js" buffered disk I/O object.

This is similar to the class node.File which was removed in
82cb1b5acb53000690448bf3d9b5d1f40ee66f76.

Needs documentation.

15 years agoMove mjsunit.js to system module directory.
Ryan Dahl [Sun, 20 Sep 2009 16:19:33 +0000 (18:19 +0200)]
Move mjsunit.js to system module directory.

15 years agoImprove error message for requiring system modules.
Ryan Dahl [Sun, 20 Sep 2009 16:03:55 +0000 (18:03 +0200)]
Improve error message for requiring system modules.

15 years agoAdd node.error(); p() outputs to stderr.
Ryan Dahl [Sun, 20 Sep 2009 15:40:14 +0000 (17:40 +0200)]
Add node.error(); p() outputs to stderr.

15 years agoThrow ret value from wait() only if it's there.
Ryan Dahl [Sun, 20 Sep 2009 15:35:07 +0000 (17:35 +0200)]
Throw ret value from wait() only if it's there.

15 years agoreturn error from cat_promise in node.fs.cat
Ryan Dahl [Sun, 20 Sep 2009 15:34:27 +0000 (17:34 +0200)]
return error from cat_promise in node.fs.cat

15 years agoAbsolute path names for require() refer to node.libraryPaths
Ryan Dahl [Fri, 18 Sep 2009 13:45:47 +0000 (15:45 +0200)]
Absolute path names for require() refer to node.libraryPaths

15 years agobump version v0.1.11
Ryan Dahl [Fri, 18 Sep 2009 16:32:25 +0000 (18:32 +0200)]
bump version

15 years agoUpgrade v8 to 1.3.11
Ryan Dahl [Thu, 17 Sep 2009 14:16:41 +0000 (16:16 +0200)]
Upgrade v8 to 1.3.11

15 years agoAdd node.installPrefix
Ryan Dahl [Thu, 17 Sep 2009 13:36:31 +0000 (15:36 +0200)]
Add node.installPrefix

15 years agoAdd more explanation to docs for request.finish().
Ryan Dahl [Thu, 17 Sep 2009 13:15:05 +0000 (15:15 +0200)]
Add more explanation to docs for request.finish().

15 years agoBugfix: node.fs.write() was stack allocating buffer.
Ryan Dahl [Thu, 17 Sep 2009 12:58:18 +0000 (14:58 +0200)]
Bugfix: node.fs.write() was stack allocating buffer.

Since the buffer is passed to the thread pool it needs to be heap allocated.
Thanks to Jon Crosby and Tim Caswell for debugging this.

15 years agoAdd failing spec for node.fs.write
Jon Crosby [Thu, 17 Sep 2009 06:28:31 +0000 (23:28 -0700)]
Add failing spec for node.fs.write

15 years agoDefault to utf8 encoding for node.fs.cat()
Ryan Dahl [Tue, 15 Sep 2009 20:41:25 +0000 (22:41 +0200)]
Default to utf8 encoding for node.fs.cat()

15 years agoupdate doc for node.fs.write()
Ryan Dahl [Tue, 15 Sep 2009 20:32:37 +0000 (22:32 +0200)]
update doc for node.fs.write()

15 years agoAdd node.exec()
Ryan Dahl [Tue, 15 Sep 2009 13:42:16 +0000 (15:42 +0200)]
Add node.exec()

15 years agoAdd documentation for promise.emitSuccess and emitError
Ryan Dahl [Tue, 15 Sep 2009 13:25:06 +0000 (15:25 +0200)]
Add documentation for promise.emitSuccess and emitError

15 years agofix typo on website
Ryan Dahl [Mon, 14 Sep 2009 20:44:25 +0000 (22:44 +0200)]
fix typo on website

15 years agoRemove unused variable in http.cc
Ryan Dahl [Mon, 14 Sep 2009 14:34:31 +0000 (16:34 +0200)]
Remove unused variable in http.cc

15 years agoFix buffering logic for HTTP outgoing messages.
Ryan Dahl [Mon, 14 Sep 2009 14:25:41 +0000 (16:25 +0200)]
Fix buffering logic for HTTP outgoing messages.

Was sending two packets instead of one for some short messages, and even 3,
for short chunked-encoded messages. Also use the more general Encode()
function for receiving HTTP bodies.

Gives ~6% improvement on "hello world" web server benchmarks.

15 years agoRemove erroneously placed EV_DEFAULT_UC_
Ryan Dahl [Sun, 13 Sep 2009 21:44:56 +0000 (23:44 +0200)]
Remove erroneously placed EV_DEFAULT_UC_

15 years agoAPI: node.fs.read() takes a normal encoding parameter.
Ryan Dahl [Sun, 13 Sep 2009 16:31:17 +0000 (18:31 +0200)]
API: node.fs.read() takes a normal encoding parameter.

Removes node.UTF8, node.RAW, node.ASCII enum versions of the encodings.
node.fs.read() now supports "raws" encoding.

15 years agoFix default encoding for outgoing HTTP messages
Ryan Dahl [Sun, 13 Sep 2009 16:19:03 +0000 (18:19 +0200)]
Fix default encoding for outgoing HTTP messages

Was causing send() to throw argument errors because arrays of ints would get
paired with the "raws" encoding. The bug was introduced in 8eb1294.

15 years agoBugfix: ReportException shouldn't forget the top frame.
Ryan Dahl [Sun, 13 Sep 2009 15:43:19 +0000 (17:43 +0200)]
Bugfix: ReportException shouldn't forget the top frame.

15 years agoBugfix: sendBody wasn't setting encoding
Ryan Dahl [Sun, 13 Sep 2009 10:38:59 +0000 (12:38 +0200)]
Bugfix: sendBody wasn't setting encoding

15 years agoFix broken asciidoc section
Ryan Dahl [Sat, 12 Sep 2009 17:14:16 +0000 (19:14 +0200)]
Fix broken asciidoc section

15 years agoUse "platform.architecture()" to find the proper architecture.
Jeff Smick [Sat, 12 Sep 2009 10:40:27 +0000 (12:40 +0200)]
Use "platform.architecture()" to find the proper architecture.

In Snow Leopard "platform.machine()" returns "i386" while
"platform.architecture()" returns ('64bit',''). Using information from both
we can determine the proper architecture

This reverts commit ea29e137b5a9acda27bd9601448639aacfc1cd9e re-enabling the
64bit build on Macintosh.

15 years agoLint
Ryan [Sat, 12 Sep 2009 12:18:42 +0000 (14:18 +0200)]
Lint

15 years agoAPI: Change arguments of emit(), emitSuccess(), emitError()
Ryan [Sat, 12 Sep 2009 11:01:03 +0000 (13:01 +0200)]
API: Change arguments of emit(), emitSuccess(), emitError()

Instead of

  myemitter.emit("event", [arg1, arg2, arg3]);

the API is now

  myemitter.emit("event", arg1, arg2, arg3);

This change saves the creation of an extra array object for each event.
The implementation is also slightly more simple.

15 years agospell check api.txt
Ryan [Fri, 11 Sep 2009 19:27:20 +0000 (21:27 +0200)]
spell check api.txt

15 years agobump version v0.1.10
Ryan [Fri, 11 Sep 2009 19:06:50 +0000 (21:06 +0200)]
bump version

15 years agoAdd doc note about 'raws' encoding
Ryan [Fri, 11 Sep 2009 19:04:02 +0000 (21:04 +0200)]
Add doc note about 'raws' encoding

15 years agoJust add the gernerated doc files. Make life easier.
Ryan [Fri, 11 Sep 2009 18:51:39 +0000 (20:51 +0200)]
Just add the gernerated doc files. Make life easier.

15 years agoRevert "Add xsl files to doc directory so people can build docs easily"
Ryan [Fri, 11 Sep 2009 18:47:45 +0000 (20:47 +0200)]
Revert "Add xsl files to doc directory so people can build docs easily"

This reverts commit 412b4636c8b7edfa05b7cb97691a1ddb656cea55.

15 years agoAdd xsl files to doc directory so people can build docs easily
Ryan [Fri, 11 Sep 2009 18:34:55 +0000 (20:34 +0200)]
Add xsl files to doc directory so people can build docs easily

15 years agoAdd node-repl
Ryan [Fri, 11 Sep 2009 18:32:24 +0000 (20:32 +0200)]
Add node-repl

15 years agoAdd '--' to seperate v8 args from program args
Ryan [Fri, 11 Sep 2009 18:05:22 +0000 (20:05 +0200)]
Add '--' to seperate v8 args from program args

15 years agocpplint.py node.cc and node.h
Ryan [Fri, 11 Sep 2009 14:02:29 +0000 (16:02 +0200)]
cpplint.py node.cc and node.h

15 years agoAdd isDirectory(), isFile(), isSocket(), ... methods to stats object.
Ryan [Fri, 11 Sep 2009 11:41:47 +0000 (13:41 +0200)]
Add isDirectory(), isFile(), isSocket(), ... methods to stats object.

Thanks to Felix Geisendörfer for the initial patch.

15 years agoAdd 'extern char **environ' so that the new ENV code compiles.
Ryan [Thu, 10 Sep 2009 14:48:38 +0000 (16:48 +0200)]
Add 'extern char **environ' so that the new ENV code compiles.

Problem appeared in dc39e8202456686513c43a4e2c4e5e505eb3a901.

15 years agoAdd access to user environment via ENV
Ryan [Thu, 10 Sep 2009 12:07:35 +0000 (14:07 +0200)]
Add access to user environment via ENV

15 years agoMan page generation.
Ryan [Thu, 10 Sep 2009 11:40:38 +0000 (13:40 +0200)]
Man page generation.

15 years agoRemove debug agent. It shouldn't have been commited!
Ryan [Thu, 10 Sep 2009 10:41:18 +0000 (12:41 +0200)]
Remove debug agent. It shouldn't have been commited!

Appeared accidentally in 6dd850aa.

15 years agoMove arg parsing to beginning of main()
Ryan [Thu, 10 Sep 2009 10:34:29 +0000 (12:34 +0200)]
Move arg parsing to beginning of main()

For faster "./node -v"

15 years agoAdd a few fflush(stderr) calls to track down missing stacktraces.
Ryan [Wed, 9 Sep 2009 20:35:40 +0000 (22:35 +0200)]
Add a few fflush(stderr) calls to track down missing stacktraces.

15 years agoUpgrade v8 to 1.3.10
Ryan [Wed, 9 Sep 2009 20:01:54 +0000 (22:01 +0200)]
Upgrade v8 to 1.3.10

15 years agoRemove compiler warning with extra assert.
Ryan [Wed, 9 Sep 2009 16:06:58 +0000 (18:06 +0200)]
Remove compiler warning with extra assert.

15 years agoAdd Exception::Error where missing.
Ryan [Wed, 9 Sep 2009 15:35:59 +0000 (17:35 +0200)]
Add Exception::Error where missing.

15 years agoIntroduce "raws" encoding. Raw String.
Ryan [Wed, 9 Sep 2009 15:22:20 +0000 (17:22 +0200)]
Introduce "raws" encoding. Raw String.

This allows you to have binary data imported into your application via
strings instead of arrays of numbers! This needs testing before release.

15 years agoByte stream to V8 decoding and encoding.
Ryan [Wed, 9 Sep 2009 13:51:49 +0000 (15:51 +0200)]
Byte stream to V8 decoding and encoding.

This does not (should not) change behavior.  Pulls those two functions
(encode/decode) out into node.cc.

15 years agonode.assert() was broken.
Ryan [Tue, 8 Sep 2009 12:59:43 +0000 (14:59 +0200)]
node.assert() was broken.

15 years agoInternally use full paths when loading modules.
Ryan [Mon, 7 Sep 2009 12:09:18 +0000 (14:09 +0200)]
Internally use full paths when loading modules.

This completes shebang support begun in
6acac912dd4da0479a0630a8d1b2878ca83b22de.