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

Unified Diff: include/v8.h

Issue 176843003: Add StackOverflowError and expose error type to api. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix test Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index dd8f2685bc37115638f5332ddbefd42a79c16cea..34abe6b69c93ede2fff1a1f7c540bd78cc978a53 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -3812,10 +3812,33 @@ typedef void (*MessageCallback)(Handle<Message> message, Handle<Value> error);
*/
class V8_EXPORT Exception {
public:
- static Local<Value> RangeError(Handle<String> message);
+ enum ErrorType {
+ kNoError,
+ // These errors are spec compliant.
+ kError,
+ kTypeError,
+ kRangeError,
+ kSyntaxError,
+ kReferenceError,
+ kURIError,
+ kEvalError,
+ // This is v8 specific, but is a native error type.
+ kStackOverflowError
+ };
+
+ /**
+ * Returns the type of error this object is.
+ * If it is not a native error, kNoError is returned.
+ */
+ static ErrorType NativeErrorType(Local<Value> value);
+
+ static Local<Value> StackOverflowError(Handle<String> message);
static Local<Value> ReferenceError(Handle<String> message);
static Local<Value> SyntaxError(Handle<String> message);
+ static Local<Value> RangeError(Handle<String> message);
static Local<Value> TypeError(Handle<String> message);
+ static Local<Value> EvalError(Handle<String> message);
+ static Local<Value> URIError(Handle<String> message);
static Local<Value> Error(Handle<String> message);
};
@@ -5414,7 +5437,7 @@ class Internals {
static const int kNullValueRootIndex = 7;
static const int kTrueValueRootIndex = 8;
static const int kFalseValueRootIndex = 9;
- static const int kEmptyStringRootIndex = 141;
+ static const int kEmptyStringRootIndex = 142;
static const int kNodeClassIdOffset = 1 * kApiPointerSize;
static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3;
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698