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

Unified Diff: runtime/bin/process.cc

Issue 8380020: Refactor the dart api a bit: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 2 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
Index: runtime/bin/process.cc
===================================================================
--- runtime/bin/process.cc (revision 651)
+++ runtime/bin/process.cc (working copy)
@@ -18,14 +18,13 @@
DartUtils::GetStringValue(Dart_GetNativeArgument(args, 1));
Dart_Handle arguments = Dart_GetNativeArgument(args, 2);
ASSERT(Dart_IsArray(arguments));
- Dart_Result result = Dart_GetLength(arguments);
- ASSERT(Dart_IsValidResult(result));
- intptr_t length = Dart_GetResultAsCIntptr(result);
+ intptr_t length = 0;
+ Dart_Handle result = Dart_GetLength(arguments, &length);
+ ASSERT(Dart_IsValid(result));
char** string_args = new char*[length];
for (int i = 0; i < length; i++) {
- result = Dart_ArrayGetAt(arguments, i);
- ASSERT(Dart_IsValidResult(result));
- Dart_Handle arg = Dart_GetResult(result);
+ Dart_Handle arg = Dart_ArrayGetAt(arguments, i);
+ ASSERT(Dart_IsValid(arg));
string_args[i] = const_cast<char *>(DartUtils::GetStringValue(arg));
}
Dart_Handle in_handle = Dart_GetNativeArgument(args, 3);
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/bin/process_script.h » ('j') | runtime/include/dart_api.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698