| OLD | NEW |
| 1 /* Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 /* Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 * for details. All rights reserved. Use of this source code is governed by a | 2 * for details. All rights reserved. Use of this source code is governed by a |
| 3 * BSD-style license that can be found in the LICENSE file. | 3 * BSD-style license that can be found in the LICENSE file. |
| 4 */ | 4 */ |
| 5 #include <assert.h> | 5 #include <assert.h> |
| 6 #include <stdio.h> | 6 #include <stdio.h> |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include "include/dart_api.h" | 10 #include "include/dart_api.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 } | 46 } |
| 47 if ((strcmp("TestExtension_ThrowMeTheBall", c_name) == 0) && (argc == 1)) { | 47 if ((strcmp("TestExtension_ThrowMeTheBall", c_name) == 0) && (argc == 1)) { |
| 48 return ThrowMeTheBall; | 48 return ThrowMeTheBall; |
| 49 } | 49 } |
| 50 return NULL; | 50 return NULL; |
| 51 } | 51 } |
| 52 | 52 |
| 53 | 53 |
| 54 /* Native entry point for the extension library. */ | 54 /* Native entry point for the extension library. */ |
| 55 DART_EXPORT Dart_Handle test_extension_Init(Dart_Handle parent_library) { | 55 DART_EXPORT Dart_Handle test_extension_Init(Dart_Handle parent_library) { |
| 56 Dart_Handle result_code; |
| 56 if (Dart_IsError(parent_library)) { | 57 if (Dart_IsError(parent_library)) { |
| 57 return parent_library; | 58 return parent_library; |
| 58 } | 59 } |
| 59 | 60 |
| 60 Dart_Handle result_code = | 61 result_code = Dart_SetNativeResolver(parent_library, ResolveName); |
| 61 Dart_SetNativeResolver(parent_library, ResolveName); | |
| 62 if (Dart_IsError(result_code)) { | 62 if (Dart_IsError(result_code)) { |
| 63 return result_code; | 63 return result_code; |
| 64 } | 64 } |
| 65 | 65 |
| 66 return parent_library; | 66 return parent_library; |
| 67 } | 67 } |
| 68 | |
| OLD | NEW |