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

76 Commits

Author SHA1 Message Date
isaacs
8509073458 lint 2012-10-12 11:46:36 -07:00
Bert Belder
5288ed75be windows: use USERPROFILE to get the user's home dir
Fixes #3461
Close #3462
Close #4093
2012-10-09 00:47:38 +02:00
tasogarepg
21c4b9a9eb debugger: fix --debug-brk 2012-09-18 10:56:37 +04:00
isaacs
22804a9eb8 module: use 'repl' as the filename arg if missing
Fix #3859
2012-08-13 22:07:03 +02:00
TJ Holowaychuk
ed7fb149a2 module: add filename to require() json errors
Otherwise it can be quite difficult to figure out which file is busted.

Closes #3580.
2012-07-06 15:26:41 -07:00
isaacs
07be9fc3a6 Merge remote-tracking branch 'ry/v0.6' into v0.6-merge
Conflicts:
	Makefile
	lib/zlib.js
	src/node.cc
	src/node.js
2012-05-09 15:12:13 -07:00
Felix Geisendörfer
bf9d8e9214 Fix exception output for module load exceptions
So instead of:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^

You will now see:

path/to/foo.js:1
throw new Error('bar');
      ^

This is a sub-set of isaacs patch here:

https://github.com/joyent/node/issues/3235

The difference is that this patch purely adresses the exception output,
but does not try to make any behavior changes / improvements.
2012-05-09 11:54:43 -07:00
Shigeki Ohtsu
891f9defeb No need to have NativeModule.require('fs') in Module._findPath() 2012-03-19 18:58:58 -07:00
isaacs
a10cfba766 module: remove 'exited', replace 'children' array 2012-03-12 10:27:11 -07:00
Ben Noordhuis
8a6576f764 Merge remote-tracking branch 'origin/v0.6'
Conflicts:
	common.gypi
2012-02-12 16:12:26 +01:00
Ben Noordhuis
09c296b44d debugger: fix --debug-brk
Commit 840229a forgot to update the debugger special case in lib/module.js

Fixes #2710.
2012-02-07 23:16:40 +01:00
Ben Noordhuis
3deceaf6e7 Revert "Process symlinked shared library as .node"
This reverts commit 7e0bf7d57d.

It's possible to make GYP generate an XCode project that produces a .node file,
hence this commit is no longer needed.
2012-02-01 22:49:56 +01:00
Ben Noordhuis
a9723df1b7 Revert "Process symlinked shared library as .node"
This reverts commit 7e0bf7d57d.

It's possible to make GYP generate an XCode project that produces a .node file,
hence this commit is no longer needed.
2012-02-01 22:28:23 +01:00
isaacs
18d179c2d8 Merge remote-tracking branch 'ry/v0.6' into master
Conflicts:
	ChangeLog
	deps/uv/src/unix/udp.c
	deps/uv/src/win/fs.c
	deps/uv/src/win/udp.c
	deps/uv/test/test-fs.c
	doc/index.html
	doc/logos/index.html
	doc/template.html
	src/node_version.h
2012-01-31 18:18:00 -08:00
Paddy Byers
7e0bf7d57d Process symlinked shared library as .node 2012-01-31 17:50:16 -08:00
Paddy Byers
840229a825 Tidy _resolveFilename 2012-01-31 17:50:11 -08:00
Fedor Indutny
ccf7b41a69 module: fix --debug-brk on symlinked scripts
* fixes #1519
2012-01-24 19:07:38 +01:00
Fedor Indutny
27c85727ed module: fix --debug-brk on symlinked scripts
* fixes #1519
2012-01-24 23:13:37 +06:00
Nathan Rajlich
3f987cd925 module: Set the error.code to 'MODULE_NOT_FOUND' when a bad path is given to require.
Fixes #2358.
2011-12-19 23:46:41 +09:00
Ben Leslie
a4e10cdb07 Raise an error when a malformed package.json file is found.
The current behaviour will silently ignore any parsing errors
that may occur when loading a package.json file. This makes
debugging errors in the package.json file very difficult.

This changes the behaviour that that errors opening and reading
the file package.json file continue to be ignored, but errors
in parsing will throw an exception.
2011-09-23 12:00:26 -07:00
Ryan Dahl
a1bafc5566 Merge remote branch 'origin/v0.4'
Conflicts:
	deps/http_parser/http_parser.c
	deps/http_parser/test.c
	lib/repl.js
2011-09-15 11:48:37 -07:00
isaacs
e06ce7562c Fix #1707 hasOwnProperty usage
If hasOwnProperty is overridden, then calling `obj.hasOwnProperty(prop)`
can fail.  Any time a dictionary of user-generated items is built, we
cannot rely on hasOwnProperty being safe, so must call it from the
Object.prototype explicitly.
2011-09-15 10:54:08 -07:00
isaacs
98990b9779 Fix #1707 hasOwnProperty usage 2011-09-15 09:46:30 -07:00
Ben Noordhuis
ac722bbed6 module: strip byte order marker when loading *.js and *.json files
BOMs make V8 raise a 'SyntaxError: Unexpected token ILLEGAL' exception.

Fixes #1440.
2011-08-04 16:52:55 +02:00
isaacs
703a1ffe52 Revert "AMD compatibility for node"
This reverts commit 9967c369c9.

Conflicts:

	test/simple/test-module-loading.js
2011-07-29 11:56:38 -07:00
isaacs
588d885e81 Close #1357 Load json files with require()
Signed off by everybody.
2011-07-20 17:39:23 -07:00
isaacs
448eab2587 Close #1349 Delimit NODE_PATH with ; on Windows 2011-07-17 14:35:49 -07:00
isaacs
7f0047c2d5 Close #1348 Remove require.paths
Module.globalPaths is still set to a read-only copy of the global
include paths pulled off of the NODE_PATH environment variable.

It's important to be able to inspect this, but modifying it no longer
has any effect.
2011-07-15 15:11:33 -07:00
isaacs
9b5098f509 Close #1281 Make require a public member of module
Reviewed by @felixge
2011-07-14 14:25:49 -07:00
Ryan Dahl
23b8931b62 Merge branch 'v0.4'
Conflicts:
	src/node.js
	src/node_version.h
2011-06-29 14:50:03 +02:00
Ryan Dahl
52b517c6ab Revert "Add --cov code coverage option"
This can be done in user space. EG https://github.com/cloudkick/whiskey

This reverts commit da9b3340eb.
This reverts commit b4ff36a41b.

Conflicts:

	src/node.cc
2011-06-17 14:03:05 +02:00
Mathias Buus
39246f65df Closes #1177 remove one node_modules optimization
to better support certain project structures.
2011-06-14 15:32:41 -07:00
isaacs
9967c369c9 AMD compatibility for node, with docs and tests
Closes #1173
Closes #1170
2011-06-13 16:11:13 -07:00
Ryan Dahl
b4ff36a41b Add --cov code coverage option 2011-04-14 23:42:08 -07:00
Ryan Dahl
75db1995b6 Don't conflict with V8's Script class
Closes GH-203.
2011-03-30 10:06:25 -07:00
Ryan Dahl
55048cdf79 Update copyright headers 2011-03-14 17:37:05 -07:00
isaacs
3599c71dae Closes GH-690 node_modules folders should be highest priority 2011-02-27 17:14:16 -08:00
Felix Geisendörfer
66601f13d9 Do not cache modules that throw exceptions
If a module throws an exception on load, it should not be cached.
This patch shows the problem in a test case and also fixes it.

See: https://groups.google.com/forum/#!topic/nodejs-dev/1cIrvJcADbY

Closes GH-707
Closes GH-710
2011-02-24 16:14:04 -08:00
isaacs
f8defa3e09 package.json main as indexed subdir
Closes GH-686.
2011-02-18 10:43:06 -08:00
isaacs
46513483cd node_modules module lookup, +docs and test. 2011-02-09 14:24:22 -08:00
isaacs
9bed5dcb2c Support caching for realpath, use in module load
This adds support for a cache object to be passed to the
fs.realpath and fs.realpathSync functions.  The Module loader keeps an
object around which caches the resulting realpaths that it looks up in
the process of loading modules.

This means that (at least as a result of loading modules) the same files
and folders are never lstat()ed more than once.  To reset the cache, set
require("module")._realpathCache to an empty object.  To disable the
caching behavior, set it to null.
2011-02-08 18:02:59 -08:00
isaacs
da2f4b2dc4 support for package.json
This adds basic support for situations where there is a package.json
with a "main" field.  That "main" module is used as the code that is
loaded when the package folder is required.
2011-02-07 11:00:22 -08:00
isaacs
2f1f22ab26 module: define functions only once. 2011-02-03 14:23:28 -08:00
isaacs
f86ec1366f Closes GH-619 Make require.main be the main module 2011-02-02 11:18:34 -08:00
Ryan Dahl
bfb6a67d60 Another fix for process.assert 2011-01-27 16:59:28 -08:00
Ryan Dahl
f71e4d8b43 Fix process.assert problem
Introduced in f9f0e5c75c
2011-01-27 16:55:54 -08:00
isaacs
6cdeb3b3fd A module ID with a trailing slash must be a dir.
require('./foo/') should not try to load './foo.js'.  It should only
look for ./foo/index.js

Closes GH-588
2011-01-27 14:02:43 -08:00
Daniel Ennis
52f93185c7 Adding support for require-like initialization of node,
so `node foo`
will load one of:
./foo.js
./foo.node
./foo/index.js
./foo/index.node

Test cases added.
Ensured no conflict with native names.
2011-01-24 21:33:30 -08:00
Ryan Dahl
9e976abad9 lint 2011-01-24 10:55:30 -08:00
Felix Geisendörfer
5a49f96505 Move commonjs module system into lib/module.js
This de-couples NativeModule from the module system and completes the
main objective of this refactoring.
2011-01-23 14:53:17 -08:00