OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 4170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4181 * constructor with the message. | 4181 * constructor with the message. |
4182 */ | 4182 */ |
4183 class V8_EXPORT Exception { | 4183 class V8_EXPORT Exception { |
4184 public: | 4184 public: |
4185 static Local<Value> RangeError(Handle<String> message); | 4185 static Local<Value> RangeError(Handle<String> message); |
4186 static Local<Value> ReferenceError(Handle<String> message); | 4186 static Local<Value> ReferenceError(Handle<String> message); |
4187 static Local<Value> SyntaxError(Handle<String> message); | 4187 static Local<Value> SyntaxError(Handle<String> message); |
4188 static Local<Value> TypeError(Handle<String> message); | 4188 static Local<Value> TypeError(Handle<String> message); |
4189 static Local<Value> Error(Handle<String> message); | 4189 static Local<Value> Error(Handle<String> message); |
4190 | 4190 |
4191 static Local<Message> GetMessage(Handle<Value> exception); | 4191 /** |
| 4192 * Creates an error message for the given exception. |
| 4193 * Will try to reconstruct the original stack trace from the exception value, |
| 4194 * or capture the current stack trace if not available. |
| 4195 */ |
| 4196 static Local<Message> CreateMessage(Handle<Value> exception); |
4192 | 4197 |
4193 // DEPRECATED. Use GetMessage()->GetStackTrace() | 4198 /** |
| 4199 * Returns the original stack trace that was captured at the creation time |
| 4200 * of a given exception, or an empty handle if not available. |
| 4201 */ |
4194 static Local<StackTrace> GetStackTrace(Handle<Value> exception); | 4202 static Local<StackTrace> GetStackTrace(Handle<Value> exception); |
4195 }; | 4203 }; |
4196 | 4204 |
4197 | 4205 |
4198 // --- Counters Callbacks --- | 4206 // --- Counters Callbacks --- |
4199 | 4207 |
4200 typedef int* (*CounterLookupCallback)(const char* name); | 4208 typedef int* (*CounterLookupCallback)(const char* name); |
4201 | 4209 |
4202 typedef void* (*CreateHistogramCallback)(const char* name, | 4210 typedef void* (*CreateHistogramCallback)(const char* name, |
4203 int min, | 4211 int min, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4245 Handle<Value> value, Handle<StackTrace> stack_trace) | 4253 Handle<Value> value, Handle<StackTrace> stack_trace) |
4246 : promise_(promise), | 4254 : promise_(promise), |
4247 event_(event), | 4255 event_(event), |
4248 value_(value), | 4256 value_(value), |
4249 stack_trace_(stack_trace) {} | 4257 stack_trace_(stack_trace) {} |
4250 | 4258 |
4251 V8_INLINE Handle<Promise> GetPromise() const { return promise_; } | 4259 V8_INLINE Handle<Promise> GetPromise() const { return promise_; } |
4252 V8_INLINE PromiseRejectEvent GetEvent() const { return event_; } | 4260 V8_INLINE PromiseRejectEvent GetEvent() const { return event_; } |
4253 V8_INLINE Handle<Value> GetValue() const { return value_; } | 4261 V8_INLINE Handle<Value> GetValue() const { return value_; } |
4254 | 4262 |
4255 // DEPRECATED. Use v8::Exception::GetMessage(GetValue())->GetStackTrace() | 4263 // DEPRECATED. Use v8::Exception::CreateMessage(GetValue())->GetStackTrace() |
4256 V8_INLINE Handle<StackTrace> GetStackTrace() const { return stack_trace_; } | 4264 V8_INLINE Handle<StackTrace> GetStackTrace() const { return stack_trace_; } |
4257 | 4265 |
4258 private: | 4266 private: |
4259 Handle<Promise> promise_; | 4267 Handle<Promise> promise_; |
4260 PromiseRejectEvent event_; | 4268 PromiseRejectEvent event_; |
4261 Handle<Value> value_; | 4269 Handle<Value> value_; |
4262 Handle<StackTrace> stack_trace_; | 4270 Handle<StackTrace> stack_trace_; |
4263 }; | 4271 }; |
4264 | 4272 |
4265 typedef void (*PromiseRejectCallback)(PromiseRejectMessage message); | 4273 typedef void (*PromiseRejectCallback)(PromiseRejectMessage message); |
(...skipping 3133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7399 */ | 7407 */ |
7400 | 7408 |
7401 | 7409 |
7402 } // namespace v8 | 7410 } // namespace v8 |
7403 | 7411 |
7404 | 7412 |
7405 #undef TYPE_CHECK | 7413 #undef TYPE_CHECK |
7406 | 7414 |
7407 | 7415 |
7408 #endif // V8_H_ | 7416 #endif // V8_H_ |
OLD | NEW |