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

Unified Diff: sky/engine/tonic/dart_exception_factory.cc

Issue 937443002: Throw exception for null listener in addEventListener (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months 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 | « sky/engine/tonic/dart_exception_factory.h ('k') | sky/engine/tonic/dart_wrappable.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/tonic/dart_exception_factory.cc
diff --git a/sky/engine/tonic/dart_exception_factory.cc b/sky/engine/tonic/dart_exception_factory.cc
index 52b57092792c306ad638e3a4b12268390a722e4f..98f9675390bdb70121d8003ef85bec435a22d324 100644
--- a/sky/engine/tonic/dart_exception_factory.cc
+++ b/sky/engine/tonic/dart_exception_factory.cc
@@ -7,6 +7,7 @@
#include "sky/engine/tonic/dart_converter.h"
#include "sky/engine/tonic/dart_builtin.h"
+#include "sky/engine/wtf/text/StringBuilder.h"
namespace blink {
@@ -17,6 +18,14 @@ DartExceptionFactory::DartExceptionFactory(DartState* dart_state)
DartExceptionFactory::~DartExceptionFactory() {
}
+Dart_Handle DartExceptionFactory::CreateNullArgumentException(int index) {
+ StringBuilder message;
+ message.appendLiteral("Argument ");
+ message.appendNumber(index);
+ message.appendLiteral(" cannot be null.");
+ return CreateException("ArgumentError", message.toString());
+}
+
Dart_Handle DartExceptionFactory::CreateException(const String& class_name,
const String& message) {
if (core_library_.is_empty()) {
« no previous file with comments | « sky/engine/tonic/dart_exception_factory.h ('k') | sky/engine/tonic/dart_wrappable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698