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

Unified Diff: runtime/bin/test_extension.cc

Issue 11447010: - Add an extension test which throws from native code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
Index: runtime/bin/test_extension.cc
===================================================================
--- runtime/bin/test_extension.cc (revision 15726)
+++ runtime/bin/test_extension.cc (working copy)
@@ -16,6 +16,7 @@
return parent_library;
}
+
void IfNull(Dart_NativeArguments arguments) {
Dart_Handle object = Dart_GetNativeArgument(arguments, 0);
if (Dart_IsNull(object)) {
@@ -25,6 +26,12 @@
}
}
+
+void ThrowMeTheBall(Dart_NativeArguments arguments) {
+ Dart_Handle object = Dart_GetNativeArgument(arguments, 0);
+ Dart_ThrowException(object);
+}
+
Bill Hesse 2012/12/05 12:26:07 two lines between functions
Ivan Posva 2012/12/05 13:01:29 Done.
Dart_NativeFunction ResolveName(Dart_Handle name, int argc) {
assert(Dart_IsString(name));
const char* cname;
@@ -37,5 +44,8 @@
if (!strcmp("TestExtension_IfNull", cname) && argc == 2) {
return IfNull;
}
+ if ((strcmp("TestExtension_ThrowMeTheBall", cname) == 0) && argc == 1) {
Bill Hesse 2012/12/05 12:26:07 We use !strcmp above. Make the two consistent, ei
Ivan Posva 2012/12/05 13:01:29 strcmp does not return a bool. Changed the code ab
+ return ThrowMeTheBall;
+ }
return NULL;
}
« no previous file with comments | « no previous file | tests/standalone/io/test_extension.dart » ('j') | tests/standalone/io/test_extension_fail_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698