Commit Graph

161 Commits

Author SHA1 Message Date
Ryan Dahl
dd857f9fdf .addon -> .node
How'd that get in there?
2010-03-11 22:04:00 -08:00
Tim-Smart
0c17067d87 Add require.registerExtension 2010-03-11 22:00:55 -08:00
Aaron Heckmann
f8eb163728 Add removeAllListeners 2010-03-09 09:30:14 -08:00
isaacs
b90d63b998 Change the include() message so that it doesn't recommend process.mixin. 2010-03-09 09:05:20 -08:00
Ryan Dahl
e72b072d53 Decouple timer from EventEmitter 2010-03-05 15:31:26 -08:00
Jacek Becela
548d59d07e Fix fs.readFile handling encoding. Should close issue #72 2010-03-03 10:28:33 -08:00
Felix Geisendörfer
55ab9b4541 Bug fix for deep process.mixin array handling
process.mixin was throwing an exception when trying to do a deep copy
of an object that included an array.

This bug was introduced in: 3bb7ad6fea
2010-03-01 14:13:57 -08:00
Ryan Dahl
b021a845f7 Move process.inherits to sys 2010-03-01 11:39:35 -08:00
Ryan Dahl
30b700ee22 Move watchFile into fs module 2010-03-01 10:42:37 -08:00
Ryan Dahl
810882c1ad Move 'fs' module out of src/node.js into its own file 2010-03-01 10:14:49 -08:00
Karl Guertin
9ad7539cf9 Add (unused) callback parameter to fs.readFile, fs.writeFile 2010-02-24 14:46:30 -08:00
Rasmus Andersson
b57d946184 added fs.link, fs.symlink, fs.readlink
including sync versions and complete tests
2010-02-22 19:23:06 -08:00
Benjamin Thomas
49cd1bbf84 Fix bug in process.mixin where deep copies would not work at all.
Before, doing this:

    var sys = require("sys");

    var obj = {
      one: 1,
      two: 2,
      three: {
        value: 3
      }
    };

    sys.p(process.mixin(true, {}, obj));

Would output this:

    {
     "two": 2,
     "three": {
      "one": 1,
      "two": 2,
      "three": {
       "value": 3
      },
      "value": 3
     },
     "one": 1
    }

When it should have outputed this:

    {
     "one": 1,
     "two": 2,
     "three": {
      "value": 3
     }
    }
2010-02-21 22:51:23 -08:00
isaacs
9acc8a686a Expose fs.lstat 2010-02-21 21:43:45 -08:00
Zoran Tomicic
d98ea70168 Configurable debug ports, and --debug-brk 2010-02-21 21:17:25 -08:00
Ryan Dahl
7a8ede6f80 Add note about Promise removal 2010-02-21 15:48:43 -08:00
Scott González
6eff8937d7 Fixed encoding in fs.writeFile(). 2010-02-21 10:35:48 -08:00
Tim Caswell
68af59ef6b Fix typo in fs.writeFile 2010-02-20 21:03:03 -08:00
Ryan Dahl
0485cc41d5 Remove promises 2010-02-20 19:49:00 -08:00
Ryan Dahl
d0f2d465aa http.cat no longer uses Promise 2010-02-19 16:26:48 -08:00
Ryan Dahl
ef55324f1a Do not use Promise in 'fs' module 2010-02-19 16:02:30 -08:00
Ryan Dahl
375131376f Module loading no longer depends on Promise
The module loading code is looking extremely messy. It needs a refactor.
2010-02-19 11:59:05 -08:00
Ryan Dahl
764783560e Remove Promise.prototype.wait()
I don't want users to have to think about coroutine safety.

http://thread.gmane.org/gmane.comp.lang.javascript.nodejs/2468/focus=2603
2010-02-19 10:19:46 -08:00
Ryan Dahl
860d008d54 Truly synchronous require()
This is to reduce our dependency on wait(). For some reason this patch
affects the timer test:

  % ./node test/mjsunit/test-timers.js
  diff: 989
  diff: 989
  diff: 1989
  diff: 2989

Previously it showed:

  % ./node test/mjsunit/test-timers.js
  diff: 1000
  diff: 1000
  diff: 2000
  diff: 3000

I'm not sure what caused this change, and it's rather disturbing. However I
want to remove wait() as soon as possible and so am pushing this patch
through.

The module loading code is becoming increasingly ugly - this patch has not
helped. A refactor needs to be done soon.
2010-02-19 10:06:49 -08:00
Rasmus Andersson
3bb7ad6fea fixed process.mixin to properly copy getters/setters 2010-02-18 10:17:13 -08:00
Micheil Smith
bcc032e43a Adding interface between node and libeio for Chmod. 2010-02-18 10:13:57 -08:00
Tim Caswell
6115df6338 File API tweaks
- Rename fs.cat to fs.readFile
- Move file.write to fs.writeFile
- Allow strings for the flag argument to fs.open
  ("r", "r+", "w", "w+", "a", "a+")
- Remove the unused 'File' module / class
2010-02-16 23:55:53 -08:00
Ryan Dahl
5468173ce9 [debug] Give debug_watcher maximum priority 2010-02-16 19:45:12 -08:00
Ryan Dahl
1bf46d1536 Revert "Add process.startTime"
Unnecessary

This reverts commit 896cef23c4.
2010-02-16 09:32:25 -08:00
Felix Geisendörfer
490cac0d7e Fix Promise.wait() for fired promises
Failure introduced in 80ace36e4c
2010-02-15 17:24:07 -08:00
Yuichiro MASUI
1793ee1c80 Fixed: promise late chain 2010-02-15 17:12:40 -08:00
Ryan Dahl
b82ef28d9d Rename 'posix' module to 'fs' 2010-02-12 01:04:14 -08:00
Ryan Dahl
896cef23c4 Add process.startTime 2010-02-12 00:47:35 -08:00
Felix Geisendörfer
6c94b8e4e4 Implemented posix.catSync() 2010-02-11 21:11:16 -08:00
Felix Geisendörfer
b02b54e003 Fix: Module cache did not propagate
This patch makes sure nested modules are available in their parents
cache. The module simplification broke this behavior.

See:

http://groups.google.com/group/nodejs/browse_thread/thread/e875132469547d2
b73f61a137
2010-02-11 11:23:19 -08:00
Ryan Dahl
76c1805c67 Add posix.truncate() 2010-02-07 17:18:28 -08:00
Felix Geisendörfer
b73f61a137 Simplified module system
createModule got removed as it was unnecessary and caused issues by
doing its own cache checks independent of loadModule. Internal modules
are now the only globally cached modules, all other modules are only
cached by inheriting their parent modules cache.

Credits: Module specific cache and a few other diffs by Blaine Cook

431662d25c
http://romeda.org/blog/2010/01/hot-code-loading-in-nodejs.html
http://thread.gmane.org/gmane.comp.lang.javascript.nodejs/1994
2010-02-04 14:08:39 -08:00
Ryan Dahl
f3ad635576 Downcase process.ARGV/ENV to process.argv/env 2010-02-03 12:19:21 -08:00
Ryan Dahl
987441283b Callbacks from process.fs always start with error object 2010-02-02 11:04:59 -08:00
Ryan Dahl
fc025f878a Remove __wrap__s 2010-01-31 11:13:30 -08:00
Ryan Dahl
9f5643f427 Reorganize the start-up process
- assign 'GLOBAL' (and now 'global') inside src/node.js

- position for eventually allowing replacements to src/node.js for people
  like Kris Kowal who want the nice libev and libeio bindings but not
  necessarily node's choices of modules or promises.
2010-01-30 23:22:34 -08:00
Felix Geisendörfer
c86c614cac Bug Fix: Late promise promise callbacks firing
Late promise bindings would fire regardless of the outcome of the
promise.

Test case by: Jonas "zimbatm" Pfenniger <jonas@pfenniger.name>
2010-01-24 14:20:17 -08:00
Felix Geisendörfer
a76c7a89ce Implemented __dirname
It seems that the current __filename module global is mainly used to
determine the directory the current module is in. To make that
easier, this patch adds support for a __dirname module global
directly.
2010-01-22 10:10:15 -08:00
Jonas Pfenniger
971f43d63b FIX: Promise timeout should not addErrback
Because now, we expect the exception to be thrown if no errback
is given, we can't let timeout() add an errback silently.
2010-01-20 15:01:03 -08:00
Jonas Pfenniger
87d92f619a FIX: EventEmitter call in Promise 2010-01-20 14:59:38 -08:00
Jonas Pfenniger
7f652b63a9 Factorized deprecation messages 2010-01-20 14:58:05 -08:00
Felix Geisendörfer
b57d7d9b4e Treat 'typeof Error' promise errors properly
Instead of JSON encoding them, just rethrow promise errors since that
produces much cleaner error messages.
2010-01-20 09:30:56 -08:00
Felix Geisendörfer
bfd3144861 Make unhandled Promise errors throw an exception
A promise will throw an exception unless an error handler is attached in the
same "tick" that the error is emitted. This is to avoid silent promise
failures.
2010-01-19 14:29:57 -08:00
Felix Geisendörfer
f64371fccb Support late callback binding for Promises
Listeners attached with addCallback / addErrback will now be executed
right away if the promise has already fired.
2010-01-19 14:29:49 -08:00
Felix Geisendörfer
d9dc2e0709 Fixed misnamed Promise property 2010-01-19 14:29:44 -08:00