Commit Graph

1926 Commits (7067a7155f26f595a6344c16f64ac1985e9e5403)

Author SHA1 Message Date
Ryan Dahl 7067a7155f Specify env differently in execFile
Callbacks should always be the last argument.
2010-07-19 20:08:35 -07:00
Brian 352b8c3ad5 Consistency changes in api docs 2010-07-19 14:18:55 -07:00
isaacs 49e0f14a2f Cache modules based on filename rather than ID
This is ever so slightly less efficient than caching based on ID, since the
filename has to be looked up before we can check the cache.  However, it's
the most minimal approach possible to get this change in place.  Since
require() is a blocking startup-time operation anyway, a bit of slowness is
not a huge problem.

A test involving require.paths modification and absolute loading. Here's the
gist of it.

Files: /p1/foo.js /p2/foo.js

  1. Add "/p1" to require.paths.
  2. foo1 = require("foo")
  3. assert foo1 === require("/p1/foo") (fail)
  4. Remove /p1 from require.paths.
  5. Add /p2 to require.paths.
  6. foo2 = require("foo")
  7. assert foo1 !== foo2 (fail)
  8. assert foo2 === require("/p2/foo") (fail)

It's an edge case, but it affects how dependencies are mapped by npm.
If your module requires foo-1.2.3, and my module requires foo-2.3.4,
then you should expect to have require("foo") give you foo-1.2.3, and
I should expect require("foo") to give me foo-2.3.4.  However, with
module ID based caching, if your code loads *first*, then your "foo"
is THE "foo", so I'll get your version instead of mine.

It hasn't yet been a problem, but only because there are so few
modules, and everyone pretty much uses the latest version all the
time.  But as things start to get to the 1.x and 2.x versions, it'll
be an issue, I'm sure.  Dependency hell isn't fun, so this is a way to
avoid it before it strikes.
2010-07-19 14:17:22 -07:00
Peter Griess a9d8cac4b0 Document setuid/setgid sync resolution capability. 2010-07-19 11:47:25 -07:00
Micheil Smith 299671b731 querystring: Removing typecasting of numeric strings to numbers
The tests did not accurately test for a strict equality, meaning that the
number == to the string.
2010-07-19 11:07:08 -07:00
Jan Kassens f18d9d8466 querystring.js: JSLint warnings fixed 2010-07-19 10:54:50 -07:00
Jan Kassens c7e0c64506 querystring doc fix 2010-07-19 10:53:54 -07:00
Jan Kassens bb2acd5e75 querystring.stringify is now more solid
* handles NaN and Infinity
* works with arrays from other contexts
2010-07-19 10:53:32 -07:00
Ryan Dahl eda1edd07f Add todo item 2010-07-19 10:35:59 -07:00
Ryan Dahl 9a26946aaa Fix for issue #214 2010-07-19 10:32:56 -07:00
Benjamin Fritsch 0ed3532699 added test for Issue #214 2010-07-19 10:16:31 -07:00
Ryan Dahl 65f2e72d77 Fix style in readline 2010-07-19 10:16:20 -07:00
Jérémy Lal 0fd1656d63 Support DEL in the REPL. 2010-07-18 22:20:23 -07:00
Ryan Dahl 02746eddd6 Apple's SUN_LEN is broken, override 2010-07-17 23:26:58 -07:00
Ryan Dahl 341e41726f Set SO_REUSEADDR on all sockets 2010-07-17 23:10:38 -07:00
Ryan Dahl 11a784d6da Upgrade http-parser 2010-07-17 01:22:16 -07:00
Ryan Dahl fa344d8514 Fix solaris build 2010-07-16 23:24:08 -07:00
Ryan Dahl 0174ceb6b2 bump version 2010-07-16 21:50:26 -07:00
Ryan Dahl 458bbb4687 fs.writeSync should return bytes written 2010-07-16 19:05:28 -07:00
Marco Rogers 1662c37c40 Fix console formatter to recognize json properly 2010-07-15 23:36:35 -07:00
Ryan Dahl dcd41ca864 Upgrade V8 to 2.3.0 2010-07-15 18:52:48 -07:00
Сергей Крыжановский 078a48a97b added env to child_process.exec 2010-07-15 17:17:03 -07:00
Matt Ranney 98341daee2 Fix unix dgram socket address resolution on Linux. 2010-07-15 16:46:46 -07:00
Ryan Dahl 02729d4af7 instanceof Buffer to Buffer.isBuffer() 2010-07-15 15:58:35 -07:00
Ryan Dahl 6961bc568f More instanceof Array fixes 2010-07-15 14:37:56 -07:00
Ryan Dahl bd05d83ae7 Update TODO 2010-07-15 14:21:35 -07:00
Ryan Dahl c926ab7746 Fix test-executable-path.js
Now that process.version doesn't say if the build is debug or not.
2010-07-15 14:21:32 -07:00
Ryan Dahl 8921bf454d Remove race conditions and simplify test-http-exceptions.js 2010-07-15 14:21:32 -07:00
Ryan Dahl 4c6f4dabf5 Adjust tests for error reporting on JSON.parse(undefined)
The V8 upgrade changed the stacktrace reports (?)
2010-07-15 14:21:32 -07:00
Ryan Dahl 9fd5e3c89c Update tests to work with module contexts 2010-07-15 14:21:31 -07:00
Ryan Dahl 9472812569 Fix reference to root global context 2010-07-15 10:52:31 -07:00
Ryan Dahl ddad872020 Add TODO list 2010-07-15 10:36:35 -07:00
Ryan Dahl 6a57a42109 Use Array.isArray instead of instanceof 2010-07-15 10:35:29 -07:00
Ryan Dahl 3a00470dbb Add 'root' global variable as reference to sandbox 2010-07-15 10:35:29 -07:00
Ryan Dahl 5f30377bbc Load modules in individual contexts
Add NODE_MODULE_CONTEXTS env var

Only one test was modified to check that this works. NEED to go through all
tests and modify them so that

  NODE_MODULE_CONTEXTS=1 make test

passes.
2010-07-15 10:34:39 -07:00
Matt Ranney 4e50197e53 Datagram socket refactor. Add tests and documentation.
Support setTTL() and setBroadcast() socket options.
2010-07-15 10:27:44 -07:00
Peter Griess e7c4f8cdaa Buffer.copy() should liberally allow empty copies. 2010-07-15 10:20:42 -07:00
Peter Griess b64a521d66 Buffer('') should create a 0-length buffer 2010-07-15 09:54:53 -07:00
Ryan Dahl 8e2530c320 Upgrade V8 to 2.2.24 2010-07-14 11:16:20 -07:00
Paul Querna 870aa3d97f Move evals to extension module. 2010-07-14 10:55:07 -07:00
Paul Querna ace2be8aa6 Move the Stat structure functions to node_file.cc
from node.cc, so we can convert fs to a module.
2010-07-14 10:42:32 -07:00
Paul Querna 82daa46e26 Move Buffer to extension model. 2010-07-14 10:37:24 -07:00
Paul Querna 4f7f43762d Move child process to extension model. 2010-07-14 10:36:52 -07:00
Paul Querna e65c27062f Move http parser to extension model. 2010-07-14 10:36:24 -07:00
Paul Querna e51aef7f3c Move signal_watcher to extension model. 2010-07-14 10:31:45 -07:00
Paul Querna 208290b524 Move cares to extension model 2010-07-14 10:31:20 -07:00
Paul Querna e5bb8abc9d Move stdio to extension model. 2010-07-14 10:29:56 -07:00
Paul Querna 8dbfe5ea8f Use the top level check for the bindings cache
(rather than each potential module having its own if check)
2010-07-14 10:23:24 -07:00
Paul Querna 30dadfc033 Register builtin extensions via a macro, rather than a manual strcmp
Set the stage for making the builtin modules more dynamic.

Note: this only converts crypto and net, I will add more extensions in a
later commit.

* node.h: Add utility macro for converting macro values to strings.

* node.h: Include the actual module name inside the module structure, not
  just the file it was built from.

* node.h: New Macro, NODE_MODULE_DECL, for declaring an external reference
  to a module structure.

* node_extensions.cc: New File, implements get_builtin_module, which
  iterates over the module structures that are compiled into node.

* node.cc(node::Binding): Use the new module lookup function to find
  modules.

* node_{net,crypto}.c: Add NODE_MODULEs to generate the module structure.
2010-07-14 10:17:25 -07:00
isaacs 781d51285d Use execPath for default NODE_PATH, not installPrefix 2010-07-14 09:58:18 -07:00