node/deps/v8/test
Julien Gilli 8b50e95f06 deps: backport 1ee712a from V8 upstream
Backport 1ee712ab8687e5f4dec93d45da068d37d28feb8b from V8 upstream.

Original commit message:

  Add SetAbortOnUncaughtExceptionCallback API

  The --abort-on-uncaught-exception command line switch makes
  Isolate::Throw abort if the error being thrown cannot be caught by a
  try/catch block.

  Embedders may want to use other mechanisms than try/catch blocks to
  handle uncaught exceptions. For instance, Node.js has "domain" objects
  that have error handlers that can handle uncaught exception like
  following:

  var d = domain.create();

  d.on('error', function onError(err) {
    console.log('Handling error');
  });

  d.run(function() {
    throw new Error("boom");
  });

  These error handlers are called by isolates' message listeners.

  If --abort-on-uncaught-exception is *not* used, the isolate's
  message listener will be called, which will in turn call the domain's
  error handler. The process will output 'Handling error' and will exit
  successfully (not due to an uncaught exception). This is the behavior
  that Node.js users expect.

  However, if --abort-on-uncaught-exception is used and when throwing an
  error within a domain that has an error handler, the process will abort
  and the domain's error handler will not be called. This is not the
  behavior that Node.js users expect.

  Having a SetAbortOnUncaughtExceptionCallback API allows embedders to
  determine when it's not appropriate to abort and instead handle the
  exception via the isolate's message listener.

  In the example above, Node.js would set a custom callback with
  SetAbortOnUncaughtExceptionCallback that would be implemented as
  following (the sample code has been simplified to remove what's not
  relevant to this change):

  bool ShouldAbortOnUncaughtException(Isolate* isolate) {
    return !IsDomainActive();
  }

  Now when --abort-on-uncaught-exception is used, Isolate::Throw would
  call that callback and determine that it should not abort if a domain
  with an error handler is active. Instead, the isolate's message listener
  would be called and the error would be handled by the domain's error
  handler.

  I believe this can also be useful for other embedders.

  BUG=

  R=bmeurer@chromium.org

  Review URL: https://codereview.chromium.org/1375933003

  Cr-Commit-Position: refs/heads/master@{#31111}

PR: #3036
PR-URL: https://github.com/nodejs/node/pull/3036
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
2015-10-07 20:39:15 -07:00
..
benchmarks deps: update v8 to 4.4.63.9 2015-08-04 11:56:14 -07:00
cctest deps: backport 1ee712a from V8 upstream 2015-10-07 20:39:15 -07:00
intl deps: upgrade v8 to 3.30.37 2014-11-14 16:34:58 +01:00
js-perf-test deps: upgrade V8 to 4.5.103.24 2015-09-06 21:39:01 +10:00
memory deps: update v8 to 4.4.63.9 2015-08-04 11:56:14 -07:00
message deps: upgrade V8 to 4.5.103.24 2015-09-06 21:39:01 +10:00
mjsunit deps: backport 6d32be2 from v8's upstream 2015-09-16 21:04:07 -04:00
mozilla deps: upgrade V8 to 4.5.103.24 2015-09-06 21:39:01 +10:00
preparser deps: update v8 to 4.3.61.21 2015-08-04 11:56:09 -07:00
promises-aplus deps: update v8 to 3.29.93.1 2014-10-10 14:49:02 +04:00
simdjs deps: upgrade V8 to 4.5.103.24 2015-09-06 21:39:01 +10:00
test262 deps: upgrade V8 to 4.5.103.24 2015-09-06 21:39:01 +10:00
test262-es6 deps: upgrade V8 to 4.5.103.24 2015-09-06 21:39:01 +10:00
unittests deps: upgrade V8 to 4.5.103.30 2015-09-06 21:39:05 +10:00
webkit deps: upgrade V8 to 4.5.103.24 2015-09-06 21:39:01 +10:00