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

Unified Diff: src/api.cc

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 | « include/v8.h ('k') | src/asmjs/asm-js.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 37c289abf4809a52b8ccf45753711fedd662e65c..18de496ecf80a5459e95c370ed4caedb9dbddd1e 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2667,6 +2667,10 @@ int Message::GetEndPosition() const {
return self->end_position();
}
+int Message::ErrorLevel() const {
+ auto self = Utils::OpenHandle(this);
+ return self->error_level();
+}
Maybe<int> Message::GetStartColumn(Local<Context> context) const {
auto self = Utils::OpenHandle(this);
@@ -8452,18 +8456,24 @@ bool Isolate::IsDead() {
return isolate->IsDead();
}
-
bool Isolate::AddMessageListener(MessageCallback that, Local<Value> data) {
+ return AddMessageListenerWithErrorLevel(that, kMessageError, data);
+}
+
+bool Isolate::AddMessageListenerWithErrorLevel(MessageCallback that,
+ int message_levels,
+ Local<Value> data) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
ENTER_V8(isolate);
i::HandleScope scope(isolate);
i::Handle<i::TemplateList> list = isolate->factory()->message_listeners();
- i::Handle<i::FixedArray> listener = isolate->factory()->NewFixedArray(2);
+ i::Handle<i::FixedArray> listener = isolate->factory()->NewFixedArray(3);
i::Handle<i::Foreign> foreign =
isolate->factory()->NewForeign(FUNCTION_ADDR(that));
listener->set(0, *foreign);
listener->set(1, data.IsEmpty() ? isolate->heap()->undefined_value()
: *Utils::OpenHandle(*data));
+ listener->set(2, i::Smi::FromInt(message_levels));
list = i::TemplateList::Add(isolate, list, listener);
isolate->heap()->SetMessageListeners(*list);
return true;
« no previous file with comments | « include/v8.h ('k') | src/asmjs/asm-js.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698