Chromium Code Reviews| Index: runtime/bin/dartutils.cc |
| diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc |
| index 6939332786ac04bb663718db0f9d879c8dccd611..acee4be978bb329a6aaadd35ddce8b60f11d8f9f 100644 |
| --- a/runtime/bin/dartutils.cc |
| +++ b/runtime/bin/dartutils.cc |
| @@ -313,7 +313,7 @@ Dart_Handle DartUtils::NewDartOSError() { |
| Dart_Handle DartUtils::NewDartOSError(OSError* os_error) { |
| // Create a Dart OSError object with the information retrieved from the OS. |
| - Dart_Handle url = Dart_NewString("dart:io"); |
| + Dart_Handle url = Dart_NewString(kIOLibURL); |
| if (Dart_IsError(url)) return url; |
| Dart_Handle lib = Dart_LookupLibrary(url); |
| if (Dart_IsError(lib)) return lib; |
| @@ -331,6 +331,24 @@ Dart_Handle DartUtils::NewDartOSError(OSError* os_error) { |
| } |
| +Dart_Handle DartUtils::NewDartIllegalArgumentError(const char* message) { |
| + // Create a Dart OSError object with the information retrieved from the OS. |
|
Søren Gjesse
2012/07/31 09:07:15
This comment seems wrong.
Bill Hesse
2012/08/08 17:00:05
Done.
|
| + Dart_Handle url = Dart_NewString(kCoreLibURL); |
| + if (Dart_IsError(url)) return url; |
| + Dart_Handle lib = Dart_LookupLibrary(url); |
| + if (Dart_IsError(lib)) return lib; |
| + Dart_Handle class_name = Dart_NewString("IllegalArgumentException"); |
| + 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[1]; |
| + args[0] = Dart_NewString(message); |
| + if (Dart_IsError(args[0])) return args[0]; |
| + Dart_Handle err = Dart_New(clazz, Dart_Null(), 1, args); |
| + return err; |
| +} |
| + |
| + |
| // Statically allocated Dart_CObject instances for immutable |
| // objects. As these will be used by different threads the use of |
| // these depends on the fact that the marking internally in the |