Commit Graph

54 Commits

Author SHA1 Message Date
turnidge@google.com 8c64adf13e Deal with unhandled exceptions the same way in all Dart api functions.
--

Terminology change: invalid handles are now called error handles.

Unhandled exceptions used to be a kind of valid handle.  Now they are
a kind of error handle.

For the Dart_Invoke* functions, this means that the standard
error-checking blob drops from two tests to one test and is
harder to mess up.

Many other Dart api functions (Dart_ToString, for example) previously
dealt with unhandled exceptions by turning them into terse error
messages.  Now these functions preserve information about the
exceptions and generate better error messages.

Changed Dart_HandleMessage to return success/failure.  It seemed to fit.

--

Details:

Dart_IsValid becomes Dart_IsError (negated sense).

Dart_GetError now knows how to print a stack trace semi-nicely.

Dart_ExceptionOccurred -> Dart_IsUnhandledException.

Renamed ApiFailure class to ApiError to fit better.

ApiError now has a "data" pointer that points to either an error
message string or to an unhandled exception object.

Documentation changes aplenty.
Review URL: http://codereview.chromium.org//8501034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1470 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 19:31:04 +00:00
turnidge@google.com 45ab0f6d65 DART_CHECK_VALID -- abort on an invalid handle.
EXPECT_VALID -- check handle validity in unit tests.
Review URL: http://codereview.chromium.org//8401010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@970 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-31 20:18:07 +00:00
turnidge@google.com e756497a78 Refactor the dart api a bit:
- Dart_Result is gone.  Dart_Handle mostly replaces it.
- Name/signature changes
  - IsValidResult -> IsValid
  - GetErrorCString -> GetError
  - many more...
- Make details of persistent handle freelist private.
- Add persistent "True" handle to api state.

Things I am not doing in this changelist:

- Documentation updates
Review URL: http://codereview.chromium.org//8380020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@778 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 20:38:41 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00