0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

62 Commits

Author SHA1 Message Date
Trevor Norris
0c1e7b53d0 process: separate nextTick domain logic
It's cleaner to only load domain ticker logic when the domains are being
used. This makes execution slightly quicker in both cases, and simpler
from the spinner since there is no need to check if the latest callback
requires use of domains.
2013-02-27 16:37:10 -08:00
isaacs
875e4a0c59 core: Remove the nextTick for running the main file
Not necessary, since we can handle the error properly on the first tick
now, even if there are event listeners, etc.

Additionally, this removes the unnecessary "_needTickCallback" from
startup, since Module.loadMain() will kick off a nextTick callback right
after it runs the main module.

Fix #4856
2013-02-27 16:29:36 -08:00
Ben Noordhuis
51f6e6a9b3 src, test: downgrade to v8 3.14 api 2013-02-25 23:45:02 +01:00
Trevor Norris
86c0745a5e process: streamlining tick callback logic
* Callbacks from spinner now calls its own function, separate from the
  tickCallback logic
* MakeCallback will call a domain specific function if a domain is
  detected
* _tickCallback assumes no domains, until nextTick receives a callback
  with a domain. After that _tickCallback is overridden with the domain
  specific implementation.
* _needTickCallback runs in startup() instead of nextTick (isaacs)
* Fix bug in _fatalException where exit would be called twice (isaacs)
* Process.domain has a default value of null
* Manually track nextTickQueue.length (will be useful later)
* Update tests to reflect internal api changes
2013-02-15 18:13:01 -08:00
isaacs
95ac576bf9 Revert "Move MakeCallback to JS"
This reverts commit 0109a9f90a.

Also included:  Port all the changes to process._makeCallback into the
C++ version.  Immediate nextTick, etc.

This yields a slight boost in several benchmarks.  V8 is optimizing and
deoptimizing process._makeCallback repeatedly.
2013-02-15 18:13:01 -08:00
Fedor Indutny
8a96bb42c6 test: make tests work with newer v8 2013-01-02 12:13:47 +04:00
isaacs
6c80ef01c1 node: emit 'exit' when exiting with error
Fix #3555
2012-12-29 16:53:23 -08:00
isaacs
ba94f9d6f8 timers: Move list.ontimeout to separate function 2012-12-29 15:32:25 -08:00
isaacs
1c2910d94c test-message: Add setTimeout and nextTick message tests 2012-12-29 10:37:31 -08:00
isaacs
cd51fa8f5a test: Update message tests for streams2 2012-12-14 17:46:24 -08:00
isaacs
21c741f257 Print warning when maxTickDepth is reached 2012-10-29 10:53:39 -07:00
isaacs
3053f4d27d test: Fix stdin message tests 2012-09-28 10:42:52 -07:00
isaacs
99ad0561c0 test-message: fix message output
1. The net changes add a stack frame to stdin errors.
2. The error line numbers were overly strict in many places.
2012-08-05 13:53:31 -07:00
isaacs
37537d5720 test: stdin error messages 2012-08-02 08:11:18 -07:00
isaacs
b3cf3f35fc Report errors properly from --eval and stdin 2012-07-30 08:21:39 -07:00
isaacs
dd85a8c183 Update message test for new v8 behavior 2012-06-14 08:37:44 -07:00
Bert Belder
0dba4ad0f9 tests: make all message tests pass on Windows 2012-06-13 03:02:53 +02:00
isaacs
e0f5d8e86d test: v8 stack trace messages changed slightly 2012-06-01 22:31:05 -07:00
Oleg Efimov
968b49ba0a Check for tabs in source line in DisplayExceptionLine
Fix for joyent/node#3280
2012-05-21 18:30:16 +02:00
isaacs
564172510d Revert "test: stack overflow output"
This reverts commit f8519e10b8.

Recent update to V8 fixes the problem where it incorrectly reports the
line number as 0 for thrown RangeErrors.
2012-05-16 14:44:15 -07:00
isaacs
f8519e10b8 test: stack overflow output 2012-05-15 13:03:56 -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
Felix Geisendörfer
814033365b Fix process.nextTick throw call sites
This patch now reports the proper throw call site for exceptions
triggered within process.nextTick. So instead of this:

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

You will now see:

mydir/myscript.js:15
  throw new Error('My Error');
          ^

From my testing this patch causes no performance regressions, but does
greatly simplify processing the nextTickQueue.
2012-05-09 11:54:43 -07:00
isaacs
079b81358b test: Minor change to message/undefined_reference_in_new_context 2012-04-17 15:30:22 -07:00
isaacs
0cdf85e28d Lint all the JavaScripts. 2012-02-18 15:34:57 -08:00
Andreas Madsen
4865063924 Tests: fix jslint issues 2012-01-17 19:45:09 +01:00
Ryan Dahl
850609ea2d Remove separation of libuv tests 2011-11-02 16:38:59 -07:00
koichik
f5a01d1764 test: fix test/message/undefined_reference_in_new_context.js
after 4d4900f, stack trace was changed.
2011-11-01 19:30:19 +09:00
Colton Baker
87286cc737 Fixed a lot of jslint errors.
Fixes #1831
2011-10-05 18:51:06 -07:00
Ryan Dahl
4e1d6fca8e Mark tests which are broken in libuv 2011-08-23 23:45:21 -07:00
koichik
4662ace916 Fix message tests
V8 3.4.12.1 changed exception log format.

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

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

The caret was moved.
2011-07-16 14:12:00 +09:00
isaacs
205b9beb6b Merge branch 'v0.4'
Conflicts:
	lib/tls.js
	lib/url.js
	src/node_version.h
	test/simple/test-buffer.js
	test/simple/test-url.js
2011-05-07 20:38:32 -07:00
isaacs
8df6f9e544 Close #974 Properly report traceless errors.
Also, tests for the same.
2011-04-25 12:22:18 -07:00
Ryan Dahl
f2dd8dd2b9 Fix test/message/undefined_reference_in_new_context
Broke after 75db199.
2011-04-01 12:36:58 -07:00
Ryan Dahl
55048cdf79 Update copyright headers 2011-03-14 17:37:05 -07:00
Ryan Dahl
72dd8778b9 Fix undefined_reference_in_new_context 2011-01-24 22:40:06 -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
Felix Geisendörfer
91cc2d8c4b Restructure src/node.js startup code
This patch introduces a logical structure and sequence for the
bootstrap code found src/node.js.
2011-01-24 14:52:25 -08:00
Ryan Dahl
555184663a windows compat: undefined_reference_in_new_context test 2011-01-23 15:32:07 -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
Oleg Efimov
093dfaf801 GJSLint all tests, only 3 long lines left in test-url.js
test/simple/test-url.js:31:(0110) Line too long (82 characters).
test/simple/test-url.js:39:(0110) Line too long (85 characters).
test/simple/test-url.js:40:(0110) Line too long (92 characters).
2010-12-05 15:42:41 -08:00
Ryan Dahl
92789b16e5 Fix global leaks 2010-12-04 16:36:21 -08:00
Oleg Efimov
c0d69a4883 GJSLint part of tests 2010-12-02 17:49:23 -08:00
Ryan Dahl
d3532a4bf2 Fix indention in 'make test-message' 2010-12-02 17:01:18 -08:00
Ryan Dahl
c7b24efd21 Move ev_loop out of javascript 2010-11-11 16:34:26 -08:00
Jorge Chamorro Bieling
99e19aa398 Remove unneeded function wrappers 2010-10-21 17:11:59 -07:00
Ryan Dahl
97255c2651 Fix test harness for Linux
Mostly just upgraded tools/test.py to the latest one that's in V8.  But also
fixing the before and after hooks to preserve the test/tmp directory so that
running tests manually usually works.
2010-10-18 14:54:39 -07:00
Micheil Smith
e38eb0c5a4 Soft migration of sys -> util, Removal of deprecated utils module. 2010-10-11 15:21:36 -07:00
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.
2010-10-02 06:44:28 -07:00