Ryan Dahl
5a05992155
Lint
14 years ago
Bert Belder
1ac133ea6f
Replace string magic + path.join by path.resolve
Because path.resolve is more elegant and windows-safe.
14 years ago
isaacs
48334dc0b1
Fix regression introduced in fe804d9b
It breaks argv[0] on posix systems, and makes it so that npm can't
determine whether node was run from an explicit location, or via "node",
so the configs default improperly.
If on windows, don't do this behavior. On posix, go back to the old
behavior.
14 years ago
Bert Belder
fe6f363837
Revert "realpath files during module load"
This reverts commit 131546e733
.
Doesn't work on windows, coming back soon.
14 years ago
Mihai Călin Bazon
131546e733
realpath files during module load
14 years ago
Ryan Dahl
e4dd5cd6fd
NODE_DEBUG uses strings instead of bitflags
14 years ago
Ryan Dahl
2e3e95ee89
add process.stdin
14 years ago
Ryan Dahl
29626d8731
Syntax error hack for modules.
14 years ago
Ryan Dahl
1c7cd4aac3
Make syntax error display optional
Fixes GH-543
14 years ago
Ryan Dahl
90e55c3357
Rather have the debugger be parent process
14 years ago
Ryan Dahl
8d82ec2130
Add beginning of build-in debugger
+ test-debugger-client (which is currently broken)
14 years ago
Bert Belder
fe804d9bc7
_Partial_ backslash support in node.js argv directory munging
Doesn't do it when node is started from another drive using a drive-relative path.
E.g:
d:
cd nodejs
c:
d:node.exe d:test.js
14 years ago
Felix Geisendörfer
e27418ca3f
Prefer require.cache over native module cache
This patch changes node's module loading behavior so that the
require.cache is always the first place to consider when loading a
module.
The motivation for this change is to help people who are writing
focused tests for their node.js applications, and need a mechanism
to inject test doubles to replace native node.js modules.
14 years ago
Ryan Dahl
180dfca03f
Pretty error message messes up if readFileSync in main module fails.
TODO test/message test for this.
14 years ago
Ryan Dahl
5a21138e37
fix global leak
14 years ago
Anders Conbere
e9c7195471
Reworks the two functions traverser and findModulePath into a more readable form.
This is not the supposed end of these changes, but a first change that
should make future changes easier to reason about.
14 years ago
Ryan Dahl
da96e07bbe
fix global leak
14 years ago
Ryan Dahl
558e5ba2b0
lint util.js and src/node.js
14 years ago
Ryan Dahl
70188499b0
Lazy load console object
14 years ago
Ryan Dahl
b6face1dce
Remove unnecessary variable def
14 years ago
isaacs
b52b4196ab
Fix problem with requireNative not exporting 'module' object
Broke require('constants'). Add unrelated test which breaks it.
14 years ago
Ben Noordhuis
f0b8cc6a94
require() should work with `node --eval`.
with tests
Fix module path resolve bug. Normally the module path is taken from
realpath(__filename) but with eval there is (of course) no filename
14 years ago
Herbert Vojčík
3422263414
requireNative made independent on module system
14 years ago
Ryan Dahl
a16b3c3148
Use runInNewContext instead of process.compile
14 years ago
Ryan Dahl
b1088d6bd2
Load 'path' module with requireNative
(now that requireNative does not depend on path module)
14 years ago
Ryan Dahl
bb6d468dd8
requireNative doesn't depend on rest of module system
14 years ago
Ryan Dahl
c11f3f8b0f
simplify lazy constant loading
14 years ago
Ryan Dahl
5890272538
Print friendly error message when main module is ENOENT
14 years ago
Ryan Dahl
2320497992
Revert "Merge branch 'writev'"
This reverts commit cd9515efd9
, reversing
changes made to df46c8e698
.
Too slow. Needs more work.
14 years ago
Ryan Dahl
42357645cb
Dump after ev_loop
14 years ago
Ryan Dahl
183f6c2077
Add .node_moudles to lookup path again
14 years ago
Ryan Dahl
a375c6ae9a
Revert node_module lookup commits
Revert "Add ~/.node_modules as well as ~/.node_libraries"
This reverts commits
5e14c8bec0
.
b0adaff67e
.
492fc0d752
.
14 years ago
Ryan Dahl
c7b24efd21
Move ev_loop out of javascript
14 years ago
isaacs
4c514a723c
Let exit listeners know the exit code
15 years ago
Jorge Chamorro Bieling
fd70d30a9c
make "node --eval" eval in the global scope.
15 years ago
Ryan Dahl
79944006e2
Move setTimeout and friends into timers module
15 years ago
Jorge Chamorro Bieling
99e19aa398
Remove unneeded function wrappers
15 years ago
isaacs
5e14c8bec0
Add ~/.node_modules as well as ~/.node_libraries
15 years ago
isaacs
b0adaff67e
require looks in node_modules folders
for modules starting with the __dirname and moving up.
This makes it much easier to localize dependencies to a particular program.
15 years ago
isaacs
492fc0d752
Split out modulePaths and defaultPaths
This way, the "default" paths of ~/.node_libraries and {prefix}/lib/node are only checked *after* anything that the user has placed into the NODE_PATHS environ, or pushed onto require.paths.
This makes require.paths a much more effective write-target, albeit slightly less useful as a read-target. However, given the existence of require.resolve(), this is less of an issue -- if you want to know what a module ID will map to, just ask that question and get an authoritative answer from the loading machinery.
15 years ago
isaacs
226eff5104
Add require.resolve.
Also, hack the repl so that it works as expected there, too.
15 years ago
Ryan Dahl
0fcb3bd3a9
Add .js to native script's filename
15 years ago
Micheil Smith
e38eb0c5a4
Soft migration of sys -> util, Removal of deprecated utils module.
15 years ago
Ryan Dahl
54e844cf08
add require.cache
15 years ago
Joshaven Potter
3d4e4d8909
syntax fixes to pass jslint
15 years ago
TJ Holowaychuk
9481bc1009
Added -e, --eval
15 years ago
isaacs
e9b6b0b327
Report "weird" errors a little better.
There are a few kinds of errors that are very confusing.
1. Errors raised in nextTick
2. Errors emitted on the "error" event
3. RangeErrors that crash the program (or anything without a stack trace)
Long traces will make make these better, of course. In the meantime, this
adds a few handy signposts (in the form of better error reporting and
comments on the otherwise inscrutable code printed to the terminal) that can
help new users find the cause, or at least, ask for help more effectively.
15 years ago
Ryan Dahl
5a4c40beea
Drop reference to timer callback on clearTimeout
Reported here:
http://groups.google.com/group/nodejs-dev/browse_thread/thread/9e063d0938f99879
Would be good to test this somehow...
15 years ago
Ryan Dahl
5cc1428d5f
Remove unused function
15 years ago
Ryan Dahl
1a2c1c8a96
Simplify: per-module cache thing
15 years ago