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_api.h" | 5 #include "include/dart_api.h" |
6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
8 | 8 |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
(...skipping 5168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5179 lib.SetLoadInProgress(); | 5179 lib.SetLoadInProgress(); |
5180 } | 5180 } |
5181 ASSERT(isolate != NULL); | 5181 ASSERT(isolate != NULL); |
5182 const Error& error = Error::Handle(isolate, Compiler::Compile(lib, script)); | 5182 const Error& error = Error::Handle(isolate, Compiler::Compile(lib, script)); |
5183 if (error.IsNull()) { | 5183 if (error.IsNull()) { |
5184 *result = Api::NewHandle(isolate, lib.raw()); | 5184 *result = Api::NewHandle(isolate, lib.raw()); |
5185 } else { | 5185 } else { |
5186 *result = Api::NewHandle(isolate, error.raw()); | 5186 *result = Api::NewHandle(isolate, error.raw()); |
5187 // Compilation errors are not Dart instances, so just mark the library | 5187 // Compilation errors are not Dart instances, so just mark the library |
5188 // as having failed to load without providing an error instance. | 5188 // as having failed to load without providing an error instance. |
5189 lib.SetLoadError(Instance::Handle()); | 5189 lib.SetLoadError(Object::null_instance()); |
5190 } | 5190 } |
5191 } | 5191 } |
5192 | 5192 |
5193 | 5193 |
5194 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url, | 5194 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url, |
5195 Dart_Handle source, | 5195 Dart_Handle source, |
5196 intptr_t line_offset, | 5196 intptr_t line_offset, |
5197 intptr_t column_offset) { | 5197 intptr_t column_offset) { |
5198 Isolate* isolate = Isolate::Current(); | 5198 Isolate* isolate = Isolate::Current(); |
5199 DARTSCOPE(isolate); | 5199 DARTSCOPE(isolate); |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6017 ASSERT(stream != NULL); | 6017 ASSERT(stream != NULL); |
6018 TimelineEvent* event = stream->StartEvent(); | 6018 TimelineEvent* event = stream->StartEvent(); |
6019 if (event != NULL) { | 6019 if (event != NULL) { |
6020 event->AsyncEnd(label, async_id); | 6020 event->AsyncEnd(label, async_id); |
6021 event->Complete(); | 6021 event->Complete(); |
6022 } | 6022 } |
6023 return Api::Success(); | 6023 return Api::Success(); |
6024 } | 6024 } |
6025 | 6025 |
6026 } // namespace dart | 6026 } // namespace dart |
OLD | NEW |