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

Unified Diff: sky/engine/tonic/dart_wrappable.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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/tonic/dart_wrappable.cc
diff --git a/sky/engine/tonic/dart_wrappable.cc b/sky/engine/tonic/dart_wrappable.cc
index a7ab0d2f9bc52331593a8266fc47882a19569087..c52a27ac80bf49282a8f5fb447d7e9e41869d901 100644
--- a/sky/engine/tonic/dart_wrappable.cc
+++ b/sky/engine/tonic/dart_wrappable.cc
@@ -10,7 +10,6 @@
#include "sky/engine/tonic/dart_exception_factory.h"
#include "sky/engine/tonic/dart_state.h"
#include "sky/engine/tonic/dart_wrapper_info.h"
-#include "sky/engine/wtf/text/StringBuilder.h"
namespace blink {
@@ -79,12 +78,7 @@ DartWrappable* DartConverterWrappable::FromArgumentsWithNullCheck(
Dart_Handle handle = Dart_GetNativeArgument(args, index);
if (Dart_IsNull(handle)) {
DartState* state = DartState::Current();
- StringBuilder message;
- message.appendLiteral("Argument ");
- message.appendNumber(index);
- message.appendLiteral(" cannot be null.");
- exception = state->exception_factory().CreateException("ArgumentError",
- message.toString());
+ exception = state->exception_factory().CreateNullArgumentException(index);
return nullptr;
}
intptr_t native_fields[DartWrappable::kNumberOfNativeFields];
« no previous file with comments | « sky/engine/tonic/dart_exception_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698