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/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } else { | 53 } else { |
54 return func; | 54 return func; |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 | 58 |
59 static RawInstance* GetListInstance(Isolate* isolate, const Object& obj) { | 59 static RawInstance* GetListInstance(Isolate* isolate, const Object& obj) { |
60 if (obj.IsInstance()) { | 60 if (obj.IsInstance()) { |
61 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | 61 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
62 const Class& list_class = | 62 const Class& list_class = |
63 Class::Handle(core_lib.LookupClass(Symbols::List(), NULL)); | 63 Class::Handle(core_lib.LookupClass(Symbols::List())); |
64 ASSERT(!list_class.IsNull()); | 64 ASSERT(!list_class.IsNull()); |
65 const Instance& instance = Instance::Cast(obj); | 65 const Instance& instance = Instance::Cast(obj); |
66 const Class& obj_class = Class::Handle(isolate, obj.clazz()); | 66 const Class& obj_class = Class::Handle(isolate, obj.clazz()); |
67 Error& malformed_type_error = Error::Handle(isolate); | 67 Error& malformed_type_error = Error::Handle(isolate); |
68 if (obj_class.IsSubtypeOf(TypeArguments::Handle(isolate), | 68 if (obj_class.IsSubtypeOf(TypeArguments::Handle(isolate), |
69 list_class, | 69 list_class, |
70 TypeArguments::Handle(isolate), | 70 TypeArguments::Handle(isolate), |
71 &malformed_type_error)) { | 71 &malformed_type_error)) { |
72 ASSERT(malformed_type_error.IsNull()); // Type is a raw List. | 72 ASSERT(malformed_type_error.IsNull()); // Type is a raw List. |
73 return instance.raw(); | 73 return instance.raw(); |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 const String& function_name = | 1066 const String& function_name = |
1067 String::Handle(isolate_lib.PrivateName(Symbols::_get_or_create())); | 1067 String::Handle(isolate_lib.PrivateName(Symbols::_get_or_create())); |
1068 const int kNumArguments = 1; | 1068 const int kNumArguments = 1; |
1069 const Function& function = Function::Handle( | 1069 const Function& function = Function::Handle( |
1070 isolate, | 1070 isolate, |
1071 Resolver::ResolveStatic(isolate_lib, | 1071 Resolver::ResolveStatic(isolate_lib, |
1072 class_name, | 1072 class_name, |
1073 function_name, | 1073 function_name, |
1074 kNumArguments, | 1074 kNumArguments, |
1075 Object::empty_array(), | 1075 Object::empty_array(), |
1076 Resolver::kIsQualified, | 1076 Resolver::kIsQualified)); |
1077 NULL)); // No ambiguity error expected. | |
1078 ASSERT(!function.IsNull()); | 1077 ASSERT(!function.IsNull()); |
1079 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); | 1078 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); |
1080 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); | 1079 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); |
1081 return Api::NewHandle(isolate, DartEntry::InvokeFunction(function, args)); | 1080 return Api::NewHandle(isolate, DartEntry::InvokeFunction(function, args)); |
1082 } | 1081 } |
1083 | 1082 |
1084 | 1083 |
1085 DART_EXPORT Dart_Port Dart_GetMainPortId() { | 1084 DART_EXPORT Dart_Port Dart_GetMainPortId() { |
1086 Isolate* isolate = Isolate::Current(); | 1085 Isolate* isolate = Isolate::Current(); |
1087 CHECK_ISOLATE(isolate); | 1086 CHECK_ISOLATE(isolate); |
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 const String& class_name = String::Handle(String::New("ArgumentError")); | 2094 const String& class_name = String::Handle(String::New("ArgumentError")); |
2096 const Library& lib = | 2095 const Library& lib = |
2097 Library::Handle(isolate, Library::LookupLibrary(lib_url)); | 2096 Library::Handle(isolate, Library::LookupLibrary(lib_url)); |
2098 if (lib.IsNull()) { | 2097 if (lib.IsNull()) { |
2099 const String& message = String::Handle( | 2098 const String& message = String::Handle( |
2100 String::NewFormatted("%s: library '%s' not found.", | 2099 String::NewFormatted("%s: library '%s' not found.", |
2101 CURRENT_FUNC, lib_url.ToCString())); | 2100 CURRENT_FUNC, lib_url.ToCString())); |
2102 return ApiError::New(message); | 2101 return ApiError::New(message); |
2103 } | 2102 } |
2104 const Class& cls = Class::Handle( | 2103 const Class& cls = Class::Handle( |
2105 isolate, lib.LookupClassAllowPrivate(class_name, NULL)); | 2104 isolate, lib.LookupClassAllowPrivate(class_name)); |
2106 ASSERT(!cls.IsNull()); | 2105 ASSERT(!cls.IsNull()); |
2107 Object& result = Object::Handle(isolate); | 2106 Object& result = Object::Handle(isolate); |
2108 String& dot_name = String::Handle(String::New(".")); | 2107 String& dot_name = String::Handle(String::New(".")); |
2109 String& constr_name = String::Handle(String::Concat(class_name, dot_name)); | 2108 String& constr_name = String::Handle(String::Concat(class_name, dot_name)); |
2110 result = ResolveConstructor(CURRENT_FUNC, cls, class_name, constr_name, 1); | 2109 result = ResolveConstructor(CURRENT_FUNC, cls, class_name, constr_name, 1); |
2111 if (result.IsError()) return result.raw(); | 2110 if (result.IsError()) return result.raw(); |
2112 ASSERT(result.IsFunction()); | 2111 ASSERT(result.IsFunction()); |
2113 Function& constructor = Function::Handle(isolate); | 2112 Function& constructor = Function::Handle(isolate); |
2114 constructor ^= result.raw(); | 2113 constructor ^= result.raw(); |
2115 if (!constructor.IsConstructor()) { | 2114 if (!constructor.IsConstructor()) { |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2481 } | 2480 } |
2482 | 2481 |
2483 | 2482 |
2484 static RawObject* GetByteDataConstructor(Isolate* isolate, | 2483 static RawObject* GetByteDataConstructor(Isolate* isolate, |
2485 const String& constructor_name, | 2484 const String& constructor_name, |
2486 intptr_t num_args) { | 2485 intptr_t num_args) { |
2487 const Library& lib = | 2486 const Library& lib = |
2488 Library::Handle(isolate->object_store()->typed_data_library()); | 2487 Library::Handle(isolate->object_store()->typed_data_library()); |
2489 ASSERT(!lib.IsNull()); | 2488 ASSERT(!lib.IsNull()); |
2490 const Class& cls = Class::Handle( | 2489 const Class& cls = Class::Handle( |
2491 isolate, lib.LookupClassAllowPrivate(Symbols::ByteData(), NULL)); | 2490 isolate, lib.LookupClassAllowPrivate(Symbols::ByteData())); |
2492 ASSERT(!cls.IsNull()); | 2491 ASSERT(!cls.IsNull()); |
2493 return ResolveConstructor(CURRENT_FUNC, | 2492 return ResolveConstructor(CURRENT_FUNC, |
2494 cls, | 2493 cls, |
2495 Symbols::ByteData(), | 2494 Symbols::ByteData(), |
2496 constructor_name, | 2495 constructor_name, |
2497 num_args); | 2496 num_args); |
2498 } | 2497 } |
2499 | 2498 |
2500 | 2499 |
2501 static Dart_Handle NewByteData(Isolate* isolate, intptr_t length) { | 2500 static Dart_Handle NewByteData(Isolate* isolate, intptr_t length) { |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3075 } else if (obj.IsLibrary()) { | 3074 } else if (obj.IsLibrary()) { |
3076 // Check whether class finalization is needed. | 3075 // Check whether class finalization is needed. |
3077 const Library& lib = Library::Cast(obj); | 3076 const Library& lib = Library::Cast(obj); |
3078 | 3077 |
3079 // Finalize all classes if needed. | 3078 // Finalize all classes if needed. |
3080 Dart_Handle state = Api::CheckIsolateState(isolate); | 3079 Dart_Handle state = Api::CheckIsolateState(isolate); |
3081 if (::Dart_IsError(state)) { | 3080 if (::Dart_IsError(state)) { |
3082 return state; | 3081 return state; |
3083 } | 3082 } |
3084 | 3083 |
3085 String& ambiguity_error_msg = String::Handle(isolate); | |
3086 Function& function = Function::Handle(isolate); | 3084 Function& function = Function::Handle(isolate); |
3087 function = lib.LookupFunctionAllowPrivate(function_name, | 3085 function = lib.LookupFunctionAllowPrivate(function_name); |
3088 &ambiguity_error_msg); | |
3089 if (function.IsNull()) { | 3086 if (function.IsNull()) { |
3090 if (!ambiguity_error_msg.IsNull()) { | |
3091 return Api::NewError("%s.", ambiguity_error_msg.ToCString()); | |
3092 } | |
3093 return Api::NewError("%s: did not find top-level function '%s'.", | 3087 return Api::NewError("%s: did not find top-level function '%s'.", |
3094 CURRENT_FUNC, | 3088 CURRENT_FUNC, |
3095 function_name.ToCString()); | 3089 function_name.ToCString()); |
3096 } | 3090 } |
3097 // LookupFunctionAllowPrivate does not check argument arity, so we | 3091 // LookupFunctionAllowPrivate does not check argument arity, so we |
3098 // do it here. | 3092 // do it here. |
3099 String& error_message = String::Handle(); | 3093 String& error_message = String::Handle(); |
3100 if (!function.AreValidArgumentCounts(number_of_arguments, | 3094 if (!function.AreValidArgumentCounts(number_of_arguments, |
3101 0, | 3095 0, |
3102 &error_message)) { | 3096 &error_message)) { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3241 getter_name, | 3235 getter_name, |
3242 args, | 3236 args, |
3243 args_descriptor)); | 3237 args_descriptor)); |
3244 } | 3238 } |
3245 return Api::NewHandle(isolate, DartEntry::InvokeFunction(getter, args)); | 3239 return Api::NewHandle(isolate, DartEntry::InvokeFunction(getter, args)); |
3246 | 3240 |
3247 } else if (obj.IsLibrary()) { | 3241 } else if (obj.IsLibrary()) { |
3248 // To access a top-level we may need to use the Field or the | 3242 // To access a top-level we may need to use the Field or the |
3249 // getter Function. The getter function may either be in the | 3243 // getter Function. The getter function may either be in the |
3250 // library or in the field's owner class, depending. | 3244 // library or in the field's owner class, depending. |
3251 String& ambiguity_error_msg = String::Handle(isolate); | |
3252 const Library& lib = Library::Cast(obj); | 3245 const Library& lib = Library::Cast(obj); |
3253 field = lib.LookupFieldAllowPrivate(field_name, &ambiguity_error_msg); | 3246 field = lib.LookupFieldAllowPrivate(field_name); |
3254 if (field.IsNull() && ambiguity_error_msg.IsNull()) { | 3247 if (field.IsNull()) { |
3255 // No field found and no ambiguity error. Check for a getter in the lib. | 3248 // No field found and no ambiguity error. Check for a getter in the lib. |
3256 const String& getter_name = | 3249 const String& getter_name = |
3257 String::Handle(isolate, Field::GetterName(field_name)); | 3250 String::Handle(isolate, Field::GetterName(field_name)); |
3258 getter = lib.LookupFunctionAllowPrivate(getter_name, | 3251 getter = lib.LookupFunctionAllowPrivate(getter_name); |
3259 &ambiguity_error_msg); | |
3260 } else if (!field.IsNull() && FieldIsUninitialized(isolate, field)) { | 3252 } else if (!field.IsNull() && FieldIsUninitialized(isolate, field)) { |
3261 // A field was found. Check for a getter in the field's owner classs. | 3253 // A field was found. Check for a getter in the field's owner classs. |
3262 const Class& cls = Class::Handle(isolate, field.owner()); | 3254 const Class& cls = Class::Handle(isolate, field.owner()); |
3263 const String& getter_name = | 3255 const String& getter_name = |
3264 String::Handle(isolate, Field::GetterName(field_name)); | 3256 String::Handle(isolate, Field::GetterName(field_name)); |
3265 getter = cls.LookupStaticFunctionAllowPrivate(getter_name); | 3257 getter = cls.LookupStaticFunctionAllowPrivate(getter_name); |
3266 } | 3258 } |
3267 | 3259 |
3268 if (!getter.IsNull()) { | 3260 if (!getter.IsNull()) { |
3269 // Invoke the getter and return the result. | 3261 // Invoke the getter and return the result. |
3270 return Api::NewHandle( | 3262 return Api::NewHandle( |
3271 isolate, DartEntry::InvokeFunction(getter, Object::empty_array())); | 3263 isolate, DartEntry::InvokeFunction(getter, Object::empty_array())); |
3272 } | 3264 } |
3273 if (!field.IsNull()) { | 3265 if (!field.IsNull()) { |
3274 return Api::NewHandle(isolate, field.value()); | 3266 return Api::NewHandle(isolate, field.value()); |
3275 } | 3267 } |
3276 if (!ambiguity_error_msg.IsNull()) { | |
3277 return Api::NewError("%s.", ambiguity_error_msg.ToCString()); | |
3278 } | |
3279 return Api::NewError("%s: did not find top-level variable '%s'.", | 3268 return Api::NewError("%s: did not find top-level variable '%s'.", |
3280 CURRENT_FUNC, field_name.ToCString()); | 3269 CURRENT_FUNC, field_name.ToCString()); |
3281 | 3270 |
3282 } else if (obj.IsError()) { | 3271 } else if (obj.IsError()) { |
3283 return container; | 3272 return container; |
3284 } else { | 3273 } else { |
3285 return Api::NewError( | 3274 return Api::NewError( |
3286 "%s expects argument 'container' to be an object, type, or library.", | 3275 "%s expects argument 'container' to be an object, type, or library.", |
3287 CURRENT_FUNC); | 3276 CURRENT_FUNC); |
3288 } | 3277 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3398 setter_name, | 3387 setter_name, |
3399 args, | 3388 args, |
3400 args_descriptor)); | 3389 args_descriptor)); |
3401 } | 3390 } |
3402 return Api::NewHandle(isolate, DartEntry::InvokeFunction(setter, args)); | 3391 return Api::NewHandle(isolate, DartEntry::InvokeFunction(setter, args)); |
3403 | 3392 |
3404 } else if (obj.IsLibrary()) { | 3393 } else if (obj.IsLibrary()) { |
3405 // To access a top-level we may need to use the Field or the | 3394 // To access a top-level we may need to use the Field or the |
3406 // setter Function. The setter function may either be in the | 3395 // setter Function. The setter function may either be in the |
3407 // library or in the field's owner class, depending. | 3396 // library or in the field's owner class, depending. |
3408 String& ambiguity_error_msg = String::Handle(isolate); | |
3409 const Library& lib = Library::Cast(obj); | 3397 const Library& lib = Library::Cast(obj); |
3410 field = lib.LookupFieldAllowPrivate(field_name, &ambiguity_error_msg); | 3398 field = lib.LookupFieldAllowPrivate(field_name); |
3411 if (field.IsNull() && ambiguity_error_msg.IsNull()) { | 3399 if (field.IsNull()) { |
3412 const String& setter_name = | 3400 const String& setter_name = |
3413 String::Handle(isolate, Field::SetterName(field_name)); | 3401 String::Handle(isolate, Field::SetterName(field_name)); |
3414 setter ^= lib.LookupFunctionAllowPrivate(setter_name, | 3402 setter ^= lib.LookupFunctionAllowPrivate(setter_name); |
3415 &ambiguity_error_msg); | |
3416 } | 3403 } |
3417 | 3404 |
3418 if (!setter.IsNull()) { | 3405 if (!setter.IsNull()) { |
3419 // Invoke the setter and return the result. | 3406 // Invoke the setter and return the result. |
3420 const int kNumArgs = 1; | 3407 const int kNumArgs = 1; |
3421 const Array& args = Array::Handle(isolate, Array::New(kNumArgs)); | 3408 const Array& args = Array::Handle(isolate, Array::New(kNumArgs)); |
3422 args.SetAt(0, value_instance); | 3409 args.SetAt(0, value_instance); |
3423 const Object& result = | 3410 const Object& result = |
3424 Object::Handle(isolate, DartEntry::InvokeFunction(setter, args)); | 3411 Object::Handle(isolate, DartEntry::InvokeFunction(setter, args)); |
3425 if (result.IsError()) { | 3412 if (result.IsError()) { |
3426 return Api::NewHandle(isolate, result.raw()); | 3413 return Api::NewHandle(isolate, result.raw()); |
3427 } | 3414 } |
3428 return Api::Success(); | 3415 return Api::Success(); |
3429 } | 3416 } |
3430 if (!field.IsNull()) { | 3417 if (!field.IsNull()) { |
3431 if (field.is_final()) { | 3418 if (field.is_final()) { |
3432 return Api::NewError("%s: cannot set final top-level variable '%s'.", | 3419 return Api::NewError("%s: cannot set final top-level variable '%s'.", |
3433 CURRENT_FUNC, field_name.ToCString()); | 3420 CURRENT_FUNC, field_name.ToCString()); |
3434 } | 3421 } |
3435 field.set_value(value_instance); | 3422 field.set_value(value_instance); |
3436 return Api::Success(); | 3423 return Api::Success(); |
3437 } | 3424 } |
3438 if (!ambiguity_error_msg.IsNull()) { | |
3439 return Api::NewError("%s.", ambiguity_error_msg.ToCString()); | |
3440 } | |
3441 return Api::NewError("%s: did not find top-level variable '%s'.", | 3425 return Api::NewError("%s: did not find top-level variable '%s'.", |
3442 CURRENT_FUNC, field_name.ToCString()); | 3426 CURRENT_FUNC, field_name.ToCString()); |
3443 | 3427 |
3444 } else if (obj.IsError()) { | 3428 } else if (obj.IsError()) { |
3445 return container; | 3429 return container; |
3446 } | 3430 } |
3447 return Api::NewError( | 3431 return Api::NewError( |
3448 "%s expects argument 'container' to be an object, type, or library.", | 3432 "%s expects argument 'container' to be an object, type, or library.", |
3449 CURRENT_FUNC); | 3433 CURRENT_FUNC); |
3450 } | 3434 } |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4024 Isolate* isolate = Isolate::Current(); | 4008 Isolate* isolate = Isolate::Current(); |
4025 DARTSCOPE(isolate); | 4009 DARTSCOPE(isolate); |
4026 const Library& lib = Api::UnwrapLibraryHandle(isolate, library); | 4010 const Library& lib = Api::UnwrapLibraryHandle(isolate, library); |
4027 if (lib.IsNull()) { | 4011 if (lib.IsNull()) { |
4028 RETURN_TYPE_ERROR(isolate, library, Library); | 4012 RETURN_TYPE_ERROR(isolate, library, Library); |
4029 } | 4013 } |
4030 const String& cls_name = Api::UnwrapStringHandle(isolate, class_name); | 4014 const String& cls_name = Api::UnwrapStringHandle(isolate, class_name); |
4031 if (cls_name.IsNull()) { | 4015 if (cls_name.IsNull()) { |
4032 RETURN_TYPE_ERROR(isolate, class_name, String); | 4016 RETURN_TYPE_ERROR(isolate, class_name, String); |
4033 } | 4017 } |
4034 String& ambiguity_error_msg = String::Handle(isolate); | |
4035 const Class& cls = Class::Handle( | 4018 const Class& cls = Class::Handle( |
4036 isolate, lib.LookupClassAllowPrivate(cls_name, &ambiguity_error_msg)); | 4019 isolate, lib.LookupClassAllowPrivate(cls_name)); |
4037 if (cls.IsNull()) { | 4020 if (cls.IsNull()) { |
4038 if (!ambiguity_error_msg.IsNull()) { | |
4039 return Api::NewError("%s.", ambiguity_error_msg.ToCString()); | |
4040 } | |
4041 // TODO(turnidge): Return null or error in this case? | 4021 // TODO(turnidge): Return null or error in this case? |
4042 const String& lib_name = String::Handle(isolate, lib.name()); | 4022 const String& lib_name = String::Handle(isolate, lib.name()); |
4043 return Api::NewError("Class '%s' not found in library '%s'.", | 4023 return Api::NewError("Class '%s' not found in library '%s'.", |
4044 cls_name.ToCString(), lib_name.ToCString()); | 4024 cls_name.ToCString(), lib_name.ToCString()); |
4045 } | 4025 } |
4046 return Api::NewHandle(isolate, cls.raw()); | 4026 return Api::NewHandle(isolate, cls.raw()); |
4047 } | 4027 } |
4048 | 4028 |
4049 | 4029 |
4050 DART_EXPORT Dart_Handle Dart_GetType(Dart_Handle library, | 4030 DART_EXPORT Dart_Handle Dart_GetType(Dart_Handle library, |
(...skipping 10 matching lines...) Expand all Loading... |
4061 } | 4041 } |
4062 const String& name_str = Api::UnwrapStringHandle(isolate, class_name); | 4042 const String& name_str = Api::UnwrapStringHandle(isolate, class_name); |
4063 if (name_str.IsNull()) { | 4043 if (name_str.IsNull()) { |
4064 RETURN_TYPE_ERROR(isolate, class_name, String); | 4044 RETURN_TYPE_ERROR(isolate, class_name, String); |
4065 } | 4045 } |
4066 // Ensure all classes are finalized. | 4046 // Ensure all classes are finalized. |
4067 Dart_Handle state = Api::CheckIsolateState(isolate); | 4047 Dart_Handle state = Api::CheckIsolateState(isolate); |
4068 if (::Dart_IsError(state)) { | 4048 if (::Dart_IsError(state)) { |
4069 return state; | 4049 return state; |
4070 } | 4050 } |
4071 String& ambiguity_error_msg = String::Handle(isolate); | |
4072 const Class& cls = | 4051 const Class& cls = |
4073 Class::Handle(isolate, lib.LookupClassAllowPrivate(name_str, | 4052 Class::Handle(isolate, lib.LookupClassAllowPrivate(name_str)); |
4074 &ambiguity_error_msg)); | |
4075 if (cls.IsNull()) { | 4053 if (cls.IsNull()) { |
4076 if (!ambiguity_error_msg.IsNull()) { | |
4077 return Api::NewError("%s.", ambiguity_error_msg.ToCString()); | |
4078 } | |
4079 const String& lib_name = String::Handle(isolate, lib.name()); | 4054 const String& lib_name = String::Handle(isolate, lib.name()); |
4080 return Api::NewError("Type '%s' not found in library '%s'.", | 4055 return Api::NewError("Type '%s' not found in library '%s'.", |
4081 name_str.ToCString(), lib_name.ToCString()); | 4056 name_str.ToCString(), lib_name.ToCString()); |
4082 } | 4057 } |
4083 if (cls.NumTypeArguments() == 0) { | 4058 if (cls.NumTypeArguments() == 0) { |
4084 if (number_of_type_arguments != 0) { | 4059 if (number_of_type_arguments != 0) { |
4085 return Api::NewError("Invalid number of type arguments specified, " | 4060 return Api::NewError("Invalid number of type arguments specified, " |
4086 "got %" Pd " expected 0", number_of_type_arguments); | 4061 "got %" Pd " expected 0", number_of_type_arguments); |
4087 } | 4062 } |
4088 return Api::NewHandle(isolate, Type::NewNonParameterizedType(cls)); | 4063 return Api::NewHandle(isolate, Type::NewNonParameterizedType(cls)); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4351 } | 4326 } |
4352 { | 4327 { |
4353 NoGCScope no_gc; | 4328 NoGCScope no_gc; |
4354 RawObject* raw_obj = obj.raw(); | 4329 RawObject* raw_obj = obj.raw(); |
4355 isolate->heap()->SetPeer(raw_obj, peer); | 4330 isolate->heap()->SetPeer(raw_obj, peer); |
4356 } | 4331 } |
4357 return Api::Success(); | 4332 return Api::Success(); |
4358 } | 4333 } |
4359 | 4334 |
4360 } // namespace dart | 4335 } // namespace dart |
OLD | NEW |