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_mirrors_api.h" | 5 #include "include/dart_mirrors_api.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/dart.h" | 9 #include "vm/dart.h" |
10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 // Case 2. Lookup the function without the external setter suffix | 152 // Case 2. Lookup the function without the external setter suffix |
153 // '='. Make sure to do this check after the regular lookup, so | 153 // '='. Make sure to do this check after the regular lookup, so |
154 // that we don't interfere with operator lookups (like ==). | 154 // that we don't interfere with operator lookups (like ==). |
155 if (func.IsNull() && HasExternalSetterSuffix(func_name)) { | 155 if (func.IsNull() && HasExternalSetterSuffix(func_name)) { |
156 tmp_name = RemoveExternalSetterSuffix(func_name); | 156 tmp_name = RemoveExternalSetterSuffix(func_name); |
157 tmp_name = Field::SetterName(tmp_name); | 157 tmp_name = Field::SetterName(tmp_name); |
158 func = cls.LookupFunctionAllowPrivate(tmp_name); | 158 func = cls.LookupFunctionAllowPrivate(tmp_name); |
159 } | 159 } |
160 | 160 |
161 // Case 3. Lookup the funciton with the getter prefix prepended. | 161 // Case 3. Lookup the function with the getter prefix prepended. |
162 if (func.IsNull()) { | 162 if (func.IsNull()) { |
163 tmp_name = Field::GetterName(func_name); | 163 tmp_name = Field::GetterName(func_name); |
164 func = cls.LookupFunctionAllowPrivate(tmp_name); | 164 func = cls.LookupFunctionAllowPrivate(tmp_name); |
165 } | 165 } |
166 | 166 |
167 // Case 4. Lookup the function with a . appended to find the | 167 // Case 4. Lookup the function with a . appended to find the |
168 // unnamed constructor. | 168 // unnamed constructor. |
169 if (func.IsNull()) { | 169 if (func.IsNull()) { |
170 tmp_name = String::Concat(func_name, Symbols::Dot()); | 170 tmp_name = String::Concat(func_name, Symbols::Dot()); |
171 func = cls.LookupFunctionAllowPrivate(tmp_name); | 171 func = cls.LookupFunctionAllowPrivate(tmp_name); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 RETURN_TYPE_ERROR(isolate, closure, Instance); | 370 RETURN_TYPE_ERROR(isolate, closure, Instance); |
371 } | 371 } |
372 | 372 |
373 ASSERT(ClassFinalizer::AllClassesFinalized()); | 373 ASSERT(ClassFinalizer::AllClassesFinalized()); |
374 | 374 |
375 RawFunction* rf = Closure::function(closure_obj); | 375 RawFunction* rf = Closure::function(closure_obj); |
376 return Api::NewHandle(isolate, rf); | 376 return Api::NewHandle(isolate, rf); |
377 } | 377 } |
378 | 378 |
379 } // namespace dart | 379 } // namespace dart |
OLD | NEW |