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

Unified Diff: runtime/bin/dartutils.cc

Issue 10443029: Use Dart_New to construct OSError objects instead of the static (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 | « runtime/bin/common.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index e148bfccc4b4feb265926294144a225ac31615b4..81e8f72e0d472e5514a94d4e0cab9845715b63ad 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -311,14 +311,16 @@ Dart_Handle DartUtils::NewDartOSError(OSError* os_error) {
if (Dart_IsError(url)) return url;
Dart_Handle lib = Dart_LookupLibrary(url);
if (Dart_IsError(lib)) return lib;
- Dart_Handle function_name = Dart_NewString("_makeOSError");
- if (Dart_IsError(function_name)) return function_name;
+ Dart_Handle class_name = Dart_NewString("OSError");
+ if (Dart_IsError(class_name)) return class_name;
+ Dart_Handle clazz = Dart_GetClass(lib, class_name);
+ if (Dart_IsError(clazz)) return clazz;
Dart_Handle args[2];
args[0] = Dart_NewString(os_error->message());
if (Dart_IsError(args[0])) return args[0];
args[1] = Dart_NewInteger(os_error->code());
if (Dart_IsError(args[1])) return args[1];
- Dart_Handle err = Dart_Invoke(lib, function_name, 2, args);
+ Dart_Handle err = Dart_New(clazz, Dart_Null(), 2, args);
return err;
}
« no previous file with comments | « runtime/bin/common.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698