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

Unified Diff: include/v8.h

Issue 2526703002: [wasm] [asmjs] Route asm.js warnings to the dev console. (Closed)
Patch Set: merge Created 4 years 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 e5ff0c0332b5035e9d065103054c0d7df9eb9b6e..86aa8b7d2d0d3bce9b0163ae0cfd7432776508b1 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -1478,6 +1478,11 @@ class V8_EXPORT Message {
int GetEndPosition() const;
/**
+ * Returns the error level of the message.
+ */
+ int ErrorLevel() const;
+
+ /**
* Returns the index within the line of the first character where
* the error occurred.
*/
@@ -6451,6 +6456,16 @@ class V8_EXPORT Isolate {
kUseCounterFeatureCount // This enum value must be last.
};
+ enum MessageErrorLevel {
+ kMessageLog = (1 << 0),
+ kMessageDebug = (1 << 1),
+ kMessageInfo = (1 << 2),
+ kMessageError = (1 << 3),
+ kMessageWarning = (1 << 4),
+ kMessageAll = kMessageLog | kMessageDebug | kMessageInfo | kMessageError |
+ kMessageWarning,
+ };
+
typedef void (*UseCounterCallback)(Isolate* isolate,
UseCounterFeature feature);
@@ -7055,7 +7070,7 @@ class V8_EXPORT Isolate {
bool IsDead();
/**
- * Adds a message listener.
+ * Adds a message listener (errors only).
*
* The same message listener can be added more than once and in that
* case it will be called more than once for each message.
@@ -7067,6 +7082,21 @@ class V8_EXPORT Isolate {
Local<Value> data = Local<Value>());
/**
+ * Adds a message listener.
+ *
+ * The same message listener can be added more than once and in that
+ * case it will be called more than once for each message.
+ *
+ * If data is specified, it will be passed to the callback when it is called.
+ * Otherwise, the exception object will be passed to the callback instead.
+ *
+ * A listener can listen for particular error levels by providing a mask.
+ */
+ bool AddMessageListenerWithErrorLevel(MessageCallback that,
+ int message_levels,
+ Local<Value> data = Local<Value>());
+
+ /**
* Remove all message listeners from the specified callback function.
*/
void RemoveMessageListeners(MessageCallback that);
« 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