OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3784 | 3784 |
3785 // --- Exceptions --- | 3785 // --- Exceptions --- |
3786 | 3786 |
3787 | 3787 |
3788 typedef void (*FatalErrorCallback)(const char* location, const char* message); | 3788 typedef void (*FatalErrorCallback)(const char* location, const char* message); |
3789 | 3789 |
3790 | 3790 |
3791 typedef void (*MessageCallback)(Handle<Message> message, Handle<Value> error); | 3791 typedef void (*MessageCallback)(Handle<Message> message, Handle<Value> error); |
3792 | 3792 |
3793 | 3793 |
3794 /** | 3794 // TODO(dcarney): remove. Use Isolate::ThrowException instead. |
3795 * Schedules an exception to be thrown when returning to JavaScript. When an | |
3796 * exception has been scheduled it is illegal to invoke any JavaScript | |
3797 * operation; the caller must return immediately and only after the exception | |
3798 * has been handled does it become legal to invoke JavaScript operations. | |
3799 */ | |
3800 Handle<Value> V8_EXPORT ThrowException(Handle<Value> exception); | 3795 Handle<Value> V8_EXPORT ThrowException(Handle<Value> exception); |
3801 | 3796 |
3802 /** | 3797 /** |
3803 * Create new error objects by calling the corresponding error object | 3798 * Create new error objects by calling the corresponding error object |
3804 * constructor with the message. | 3799 * constructor with the message. |
3805 */ | 3800 */ |
3806 class V8_EXPORT Exception { | 3801 class V8_EXPORT Exception { |
3807 public: | 3802 public: |
3808 static Local<Value> RangeError(Handle<String> message); | 3803 static Local<Value> RangeError(Handle<String> message); |
3809 static Local<Value> ReferenceError(Handle<String> message); | 3804 static Local<Value> ReferenceError(Handle<String> message); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4045 * Returns the context of the calling JavaScript code. That is the | 4040 * Returns the context of the calling JavaScript code. That is the |
4046 * context of the top-most JavaScript frame. If there are no | 4041 * context of the top-most JavaScript frame. If there are no |
4047 * JavaScript frames an empty handle is returned. | 4042 * JavaScript frames an empty handle is returned. |
4048 */ | 4043 */ |
4049 Local<Context> GetCallingContext(); | 4044 Local<Context> GetCallingContext(); |
4050 | 4045 |
4051 /** Returns the last entered context. */ | 4046 /** Returns the last entered context. */ |
4052 Local<Context> GetEnteredContext(); | 4047 Local<Context> GetEnteredContext(); |
4053 | 4048 |
4054 /** | 4049 /** |
| 4050 * Schedules an exception to be thrown when returning to JavaScript. When an |
| 4051 * exception has been scheduled it is illegal to invoke any JavaScript |
| 4052 * operation; the caller must return immediately and only after the exception |
| 4053 * has been handled does it become legal to invoke JavaScript operations. |
| 4054 */ |
| 4055 Local<Value> V8_EXPORT ThrowException(Local<Value> exception); |
| 4056 |
| 4057 /** |
4055 * Allows the host application to group objects together. If one | 4058 * Allows the host application to group objects together. If one |
4056 * object in the group is alive, all objects in the group are alive. | 4059 * object in the group is alive, all objects in the group are alive. |
4057 * After each garbage collection, object groups are removed. It is | 4060 * After each garbage collection, object groups are removed. It is |
4058 * intended to be used in the before-garbage-collection callback | 4061 * intended to be used in the before-garbage-collection callback |
4059 * function, for instance to simulate DOM tree connections among JS | 4062 * function, for instance to simulate DOM tree connections among JS |
4060 * wrapper objects. Object groups for all dependent handles need to | 4063 * wrapper objects. Object groups for all dependent handles need to |
4061 * be provided for kGCTypeMarkSweepCompact collections, for all other | 4064 * be provided for kGCTypeMarkSweepCompact collections, for all other |
4062 * garbage collection types it is sufficient to provide object groups | 4065 * garbage collection types it is sufficient to provide object groups |
4063 * for partially dependent handles only. | 4066 * for partially dependent handles only. |
4064 */ | 4067 */ |
(...skipping 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6478 */ | 6481 */ |
6479 | 6482 |
6480 | 6483 |
6481 } // namespace v8 | 6484 } // namespace v8 |
6482 | 6485 |
6483 | 6486 |
6484 #undef TYPE_CHECK | 6487 #undef TYPE_CHECK |
6485 | 6488 |
6486 | 6489 |
6487 #endif // V8_H_ | 6490 #endif // V8_H_ |
OLD | NEW |