Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: runtime/include/dart_api.h

Issue 9316071: Dart_PropagateError, take 2. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef INCLUDE_DART_API_H_ 5 #ifndef INCLUDE_DART_API_H_
6 #define INCLUDE_DART_API_H_ 6 #define INCLUDE_DART_API_H_
7 7
8 /** \mainpage Dart Embedding API Reference 8 /** \mainpage Dart Embedding API Reference
9 * 9 *
10 * Dart is a class-based programming language for creating structured 10 * Dart is a class-based programming language for creating structured
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 /** 134 /**
135 * Produces an error handle with the provided error message. 135 * Produces an error handle with the provided error message.
136 * 136 *
137 * Requires there to be a current isolate. 137 * Requires there to be a current isolate.
138 * 138 *
139 * \param error A C string containing an error message. 139 * \param error A C string containing an error message.
140 */ 140 */
141 DART_EXPORT Dart_Handle Dart_Error(const char* format, ...); 141 DART_EXPORT Dart_Handle Dart_Error(const char* format, ...);
142 142
143 /**
144 * Propagates an error.
145 *
146 * It only makes sense to call this function when there are dart
147 * frames on the stack. That is, this function should only be called
148 * in the C implementation of a native function which has been called
149 * from Dart code. If this function is called in the top-level
150 * embedder code, it will return an error, as there is no way to
151 * further propagate the error.
152 *
153 * The provided handle must be an error handle. (See Dart_IsError.)
154 *
155 * If the provided handle is an unhandled exception, this function
156 * will cause the unhandled exception to be rethrown. Otherwise, the
157 * error will be propagated to the caller, discarding any active dart
158 * frames up to the next C frame.
159 *
160 * \param An error handle.
161 *
162 * \return On success, this function does not return. On failure, an
163 * error handle is returned.
164 */
165 DART_EXPORT Dart_Handle Dart_PropagateError(Dart_Handle handle);
166
143 // Internal routine used for reporting error handles. 167 // Internal routine used for reporting error handles.
144 DART_EXPORT void _Dart_ReportErrorHandle(const char* file, 168 DART_EXPORT void _Dart_ReportErrorHandle(const char* file,
145 int line, 169 int line,
146 const char* handle_string, 170 const char* handle_string,
147 const char* error); 171 const char* error);
148 172
149 // TODO(turnidge): Move DART_CHECK_VALID to some sort of dart_utils 173 // TODO(turnidge): Move DART_CHECK_VALID to some sort of dart_utils
150 // header instead of this header. 174 // header instead of this header.
151 /** 175 /**
152 * Aborts the process if 'handle' is an error handle. 176 * Aborts the process if 'handle' is an error handle.
(...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 * 1469 *
1446 * For information on the lifetime of this data, when provided in 1470 * For information on the lifetime of this data, when provided in
1447 * callbacks, see the documentation for the individual callbacks. 1471 * callbacks, see the documentation for the individual callbacks.
1448 */ 1472 */
1449 struct Dart_CMessage { 1473 struct Dart_CMessage {
1450 Dart_CObject* root; 1474 Dart_CObject* root;
1451 }; 1475 };
1452 1476
1453 1477
1454 #endif // INCLUDE_DART_API_H_ 1478 #endif // INCLUDE_DART_API_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698