| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "include/dart_native_api.h" | 5 #include "include/dart_native_api.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
| 9 #include "vm/dart_api_message.h" | 9 #include "vm/dart_api_message.h" |
| 10 #include "vm/dart_api_state.h" | 10 #include "vm/dart_api_state.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 DARTSCOPE(Thread::Current()); | 122 DARTSCOPE(Thread::Current()); |
| 123 Dart_Handle result = Api::CheckAndFinalizePendingClasses(T); | 123 Dart_Handle result = Api::CheckAndFinalizePendingClasses(T); |
| 124 if (::Dart_IsError(result)) { | 124 if (::Dart_IsError(result)) { |
| 125 return result; | 125 return result; |
| 126 } | 126 } |
| 127 CHECK_CALLBACK_STATE(T); | 127 CHECK_CALLBACK_STATE(T); |
| 128 CompileAll(T, &result); | 128 CompileAll(T, &result); |
| 129 return result; | 129 return result; |
| 130 } | 130 } |
| 131 | 131 |
| 132 |
| 133 static void ParseAll(Thread* thread, Dart_Handle* result) { |
| 134 ASSERT(thread != NULL); |
| 135 const Error& error = Error::Handle(thread->zone(), |
| 136 Library::ParseAll(thread)); |
| 137 if (error.IsNull()) { |
| 138 *result = Api::Success(); |
| 139 } else { |
| 140 *result = Api::NewHandle(thread, error.raw()); |
| 141 } |
| 142 } |
| 143 |
| 144 |
| 145 DART_EXPORT Dart_Handle Dart_ParseAll() { |
| 146 DARTSCOPE(Thread::Current()); |
| 147 Dart_Handle result = Api::CheckAndFinalizePendingClasses(T); |
| 148 if (::Dart_IsError(result)) { |
| 149 return result; |
| 150 } |
| 151 CHECK_CALLBACK_STATE(T); |
| 152 ParseAll(T, &result); |
| 153 return result; |
| 154 } |
| 155 |
| 132 } // namespace dart | 156 } // namespace dart |
| OLD | NEW |