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 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 */ | 1471 */ |
1472 int GetStartPosition() const; | 1472 int GetStartPosition() const; |
1473 | 1473 |
1474 /** | 1474 /** |
1475 * Returns the index within the script of the last character where | 1475 * Returns the index within the script of the last character where |
1476 * the error occurred. | 1476 * the error occurred. |
1477 */ | 1477 */ |
1478 int GetEndPosition() const; | 1478 int GetEndPosition() const; |
1479 | 1479 |
1480 /** | 1480 /** |
| 1481 * Returns the error level of the message. |
| 1482 */ |
| 1483 int ErrorLevel() const; |
| 1484 |
| 1485 /** |
1481 * Returns the index within the line of the first character where | 1486 * Returns the index within the line of the first character where |
1482 * the error occurred. | 1487 * the error occurred. |
1483 */ | 1488 */ |
1484 V8_DEPRECATE_SOON("Use maybe version", int GetStartColumn() const); | 1489 V8_DEPRECATE_SOON("Use maybe version", int GetStartColumn() const); |
1485 V8_WARN_UNUSED_RESULT Maybe<int> GetStartColumn(Local<Context> context) const; | 1490 V8_WARN_UNUSED_RESULT Maybe<int> GetStartColumn(Local<Context> context) const; |
1486 | 1491 |
1487 /** | 1492 /** |
1488 * Returns the index within the line of the last character where | 1493 * Returns the index within the line of the last character where |
1489 * the error occurred. | 1494 * the error occurred. |
1490 */ | 1495 */ |
(...skipping 4953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6444 kDecimalWithLeadingZeroInStrictMode = 32, | 6449 kDecimalWithLeadingZeroInStrictMode = 32, |
6445 kLegacyDateParser = 33, | 6450 kLegacyDateParser = 33, |
6446 kDefineGetterOrSetterWouldThrow = 34, | 6451 kDefineGetterOrSetterWouldThrow = 34, |
6447 kFunctionConstructorReturnedUndefined = 35, | 6452 kFunctionConstructorReturnedUndefined = 35, |
6448 | 6453 |
6449 // If you add new values here, you'll also need to update Chromium's: | 6454 // If you add new values here, you'll also need to update Chromium's: |
6450 // UseCounter.h, V8PerIsolateData.cpp, histograms.xml | 6455 // UseCounter.h, V8PerIsolateData.cpp, histograms.xml |
6451 kUseCounterFeatureCount // This enum value must be last. | 6456 kUseCounterFeatureCount // This enum value must be last. |
6452 }; | 6457 }; |
6453 | 6458 |
| 6459 enum MessageErrorLevel { |
| 6460 kMessageLog = (1 << 0), |
| 6461 kMessageDebug = (1 << 1), |
| 6462 kMessageInfo = (1 << 2), |
| 6463 kMessageError = (1 << 3), |
| 6464 kMessageWarning = (1 << 4), |
| 6465 kMessageAll = kMessageLog | kMessageDebug | kMessageInfo | kMessageError | |
| 6466 kMessageWarning, |
| 6467 }; |
| 6468 |
6454 typedef void (*UseCounterCallback)(Isolate* isolate, | 6469 typedef void (*UseCounterCallback)(Isolate* isolate, |
6455 UseCounterFeature feature); | 6470 UseCounterFeature feature); |
6456 | 6471 |
6457 | 6472 |
6458 /** | 6473 /** |
6459 * Creates a new isolate. Does not change the currently entered | 6474 * Creates a new isolate. Does not change the currently entered |
6460 * isolate. | 6475 * isolate. |
6461 * | 6476 * |
6462 * When an isolate is no longer used its resources should be freed | 6477 * When an isolate is no longer used its resources should be freed |
6463 * by calling Dispose(). Using the delete operator is not allowed. | 6478 * by calling Dispose(). Using the delete operator is not allowed. |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7048 void SetAllowCodeGenerationFromStringsCallback( | 7063 void SetAllowCodeGenerationFromStringsCallback( |
7049 AllowCodeGenerationFromStringsCallback callback); | 7064 AllowCodeGenerationFromStringsCallback callback); |
7050 | 7065 |
7051 /** | 7066 /** |
7052 * Check if V8 is dead and therefore unusable. This is the case after | 7067 * Check if V8 is dead and therefore unusable. This is the case after |
7053 * fatal errors such as out-of-memory situations. | 7068 * fatal errors such as out-of-memory situations. |
7054 */ | 7069 */ |
7055 bool IsDead(); | 7070 bool IsDead(); |
7056 | 7071 |
7057 /** | 7072 /** |
7058 * Adds a message listener. | 7073 * Adds a message listener (errors only). |
7059 * | 7074 * |
7060 * The same message listener can be added more than once and in that | 7075 * The same message listener can be added more than once and in that |
7061 * case it will be called more than once for each message. | 7076 * case it will be called more than once for each message. |
7062 * | 7077 * |
7063 * If data is specified, it will be passed to the callback when it is called. | 7078 * If data is specified, it will be passed to the callback when it is called. |
7064 * Otherwise, the exception object will be passed to the callback instead. | 7079 * Otherwise, the exception object will be passed to the callback instead. |
7065 */ | 7080 */ |
7066 bool AddMessageListener(MessageCallback that, | 7081 bool AddMessageListener(MessageCallback that, |
7067 Local<Value> data = Local<Value>()); | 7082 Local<Value> data = Local<Value>()); |
7068 | 7083 |
7069 /** | 7084 /** |
| 7085 * Adds a message listener. |
| 7086 * |
| 7087 * The same message listener can be added more than once and in that |
| 7088 * case it will be called more than once for each message. |
| 7089 * |
| 7090 * If data is specified, it will be passed to the callback when it is called. |
| 7091 * Otherwise, the exception object will be passed to the callback instead. |
| 7092 * |
| 7093 * A listener can listen for particular error levels by providing a mask. |
| 7094 */ |
| 7095 bool AddMessageListenerWithErrorLevel(MessageCallback that, |
| 7096 int message_levels, |
| 7097 Local<Value> data = Local<Value>()); |
| 7098 |
| 7099 /** |
7070 * Remove all message listeners from the specified callback function. | 7100 * Remove all message listeners from the specified callback function. |
7071 */ | 7101 */ |
7072 void RemoveMessageListeners(MessageCallback that); | 7102 void RemoveMessageListeners(MessageCallback that); |
7073 | 7103 |
7074 /** Callback function for reporting failed access checks.*/ | 7104 /** Callback function for reporting failed access checks.*/ |
7075 void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback); | 7105 void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback); |
7076 | 7106 |
7077 /** | 7107 /** |
7078 * Tells V8 to capture current stack trace when uncaught exception occurs | 7108 * Tells V8 to capture current stack trace when uncaught exception occurs |
7079 * and report it to the message listeners. The option is off by default. | 7109 * and report it to the message listeners. The option is off by default. |
(...skipping 2591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9671 */ | 9701 */ |
9672 | 9702 |
9673 | 9703 |
9674 } // namespace v8 | 9704 } // namespace v8 |
9675 | 9705 |
9676 | 9706 |
9677 #undef TYPE_CHECK | 9707 #undef TYPE_CHECK |
9678 | 9708 |
9679 | 9709 |
9680 #endif // INCLUDE_V8_H_ | 9710 #endif // INCLUDE_V8_H_ |
OLD | NEW |