| 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 "lib/invocation_mirror.h" | 5 #include "lib/invocation_mirror.h" |
| 6 #include "vm/bootstrap_natives.h" | 6 #include "vm/bootstrap_natives.h" |
| 7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
| 8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/exceptions.h" | 10 #include "vm/exceptions.h" |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 for (int i = 0; i < num_libraries; i++) { | 1219 for (int i = 0; i < num_libraries; i++) { |
| 1220 each_library ^= libraries.At(i); | 1220 each_library ^= libraries.At(i); |
| 1221 library_key = each_library.private_key(); | 1221 library_key = each_library.private_key(); |
| 1222 if (library_key.Equals(private_key)) { | 1222 if (library_key.Equals(private_key)) { |
| 1223 ctxt_library = each_library.raw(); | 1223 ctxt_library = each_library.raw(); |
| 1224 break; | 1224 break; |
| 1225 } | 1225 } |
| 1226 } | 1226 } |
| 1227 } | 1227 } |
| 1228 ASSERT(!ctxt_library.IsNull()); | 1228 ASSERT(!ctxt_library.IsNull()); |
| 1229 return ctxt_library.Evaluate(expression, | 1229 const Object& result = |
| 1230 Array::empty_array(), | 1230 Object::Handle(ctxt_library.Evaluate(expression, |
| 1231 Array::empty_array()); | 1231 Array::empty_array(), |
| 1232 Array::empty_array())); |
| 1233 if (result.IsError()) { |
| 1234 Exceptions::PropagateError(Error::Cast(result)); |
| 1235 UNREACHABLE(); |
| 1236 } |
| 1237 return result.raw(); |
| 1232 } | 1238 } |
| 1233 | 1239 |
| 1234 DEFINE_NATIVE_ENTRY(TypedefMirror_declaration, 1) { | 1240 DEFINE_NATIVE_ENTRY(TypedefMirror_declaration, 1) { |
| 1235 GET_NON_NULL_NATIVE_ARGUMENT(Type, type, arguments->NativeArgAt(0)); | 1241 GET_NON_NULL_NATIVE_ARGUMENT(Type, type, arguments->NativeArgAt(0)); |
| 1236 const Class& cls = Class::Handle(type.type_class()); | 1242 const Class& cls = Class::Handle(type.type_class()); |
| 1237 // We represent typedefs as non-canonical signature classes. | 1243 // We represent typedefs as non-canonical signature classes. |
| 1238 ASSERT(cls.IsSignatureClass() && !cls.IsCanonicalSignatureClass()); | 1244 ASSERT(cls.IsSignatureClass() && !cls.IsCanonicalSignatureClass()); |
| 1239 return CreateTypedefMirror(cls, | 1245 return CreateTypedefMirror(cls, |
| 1240 AbstractType::Handle(cls.DeclarationType()), | 1246 AbstractType::Handle(cls.DeclarationType()), |
| 1241 Bool::True(), // is_declaration | 1247 Bool::True(), // is_declaration |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1956 } | 1962 } |
| 1957 | 1963 |
| 1958 DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) { | 1964 DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) { |
| 1959 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 1965 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
| 1960 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 1966 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
| 1961 return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw(); | 1967 return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw(); |
| 1962 } | 1968 } |
| 1963 | 1969 |
| 1964 | 1970 |
| 1965 } // namespace dart | 1971 } // namespace dart |
| OLD | NEW |