OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 23 matching lines...) Expand all Loading... |
34 v8RangeError, | 34 v8RangeError, |
35 v8ReferenceError, | 35 v8ReferenceError, |
36 v8SyntaxError, | 36 v8SyntaxError, |
37 v8TypeError, | 37 v8TypeError, |
38 v8GeneralError | 38 v8GeneralError |
39 }; | 39 }; |
40 | 40 |
41 class V8ThrowException { | 41 class V8ThrowException { |
42 public: | 42 public: |
43 | 43 |
44 static v8::Handle<v8::Value> createDOMException(int ec, v8::Isolate* isolate
) | |
45 { | |
46 return createDOMException(ec, String(), v8::Handle<v8::Object>(), isolat
e); | |
47 } | |
48 static v8::Handle<v8::Value> createDOMException(int ec, const String& messag
e, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate) | 44 static v8::Handle<v8::Value> createDOMException(int ec, const String& messag
e, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate) |
49 { | 45 { |
50 return createDOMException(ec, message, String(), creationContext, isolat
e); | 46 return createDOMException(ec, message, String(), creationContext, isolat
e); |
51 } | 47 } |
52 static v8::Handle<v8::Value> createDOMException(int, const String& sanitized
Message, const String& unsanitizedMessage, const v8::Handle<v8::Object>& creatio
nContext, v8::Isolate*); | 48 static v8::Handle<v8::Value> createDOMException(int, const String& sanitized
Message, const String& unsanitizedMessage, const v8::Handle<v8::Object>& creatio
nContext, v8::Isolate*); |
53 | 49 |
54 static v8::Handle<v8::Value> throwDOMException(int ec, const v8::Handle<v8::
Object>& creationContext, v8::Isolate* isolate) | 50 static v8::Handle<v8::Value> throwDOMException(int ec, const v8::Handle<v8::
Object>& creationContext, v8::Isolate* isolate) |
55 { | 51 { |
56 return throwDOMException(ec, String(), creationContext, isolate); | 52 return throwDOMException(ec, String(), creationContext, isolate); |
57 } | 53 } |
58 static v8::Handle<v8::Value> throwDOMException(int ec, const String& message
, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate) | 54 static v8::Handle<v8::Value> throwDOMException(int ec, const String& message
, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate) |
59 { | 55 { |
60 return throwDOMException(ec, message, String(), creationContext, isolate
); | 56 return throwDOMException(ec, message, String(), creationContext, isolate
); |
61 } | 57 } |
62 static v8::Handle<v8::Value> throwDOMException(int, const String& sanitizedM
essage, const String& unsanitizedMessage, const v8::Handle<v8::Object>& creation
Context, v8::Isolate*); | 58 static v8::Handle<v8::Value> throwDOMException(int, const String& sanitizedM
essage, const String& unsanitizedMessage, const v8::Handle<v8::Object>& creation
Context, v8::Isolate*); |
63 | 59 |
64 static v8::Handle<v8::Value> createError(V8ErrorType, const String&, v8::Iso
late*); | 60 static v8::Handle<v8::Value> createError(V8ErrorType, const String&, v8::Iso
late*); |
65 static v8::Handle<v8::Value> throwError(V8ErrorType, const String&, v8::Isol
ate*); | 61 static v8::Handle<v8::Value> throwError(V8ErrorType, const String&, v8::Isol
ate*); |
66 static v8::Handle<v8::Value> throwError(v8::Handle<v8::Value>, v8::Isolate*)
; | 62 static v8::Handle<v8::Value> throwError(v8::Handle<v8::Value>, v8::Isolate*)
; |
67 | 63 |
68 static v8::Handle<v8::Value> createTypeError(const String&, v8::Isolate*); | 64 static v8::Handle<v8::Value> createTypeError(const String&, v8::Isolate*); |
69 static v8::Handle<v8::Value> throwTypeError(const String&, v8::Isolate*); | 65 static v8::Handle<v8::Value> throwTypeError(const String&, v8::Isolate*); |
70 }; | 66 }; |
71 | 67 |
72 } // namespace WebCore | 68 } // namespace WebCore |
73 | 69 |
74 #endif // V8ThrowException_h | 70 #endif // V8ThrowException_h |
OLD | NEW |