| 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 "vm/class_finalizer.h" | 5 #include "vm/class_finalizer.h" |
| 6 | 6 |
| 7 #include "vm/flags.h" | 7 #include "vm/flags.h" |
| 8 #include "vm/heap.h" | 8 #include "vm/heap.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 ReportError(script, function.token_pos(), | 1012 ReportError(script, function.token_pos(), |
| 1013 "class '%s' overrides function '%s' of %s '%s' " | 1013 "class '%s' overrides function '%s' of %s '%s' " |
| 1014 "with incompatible parameters", | 1014 "with incompatible parameters", |
| 1015 class_name.ToCString(), | 1015 class_name.ToCString(), |
| 1016 function_name.ToCString(), | 1016 function_name.ToCString(), |
| 1017 super_class.is_interface() ? "interface" : "super class", | 1017 super_class.is_interface() ? "interface" : "super class", |
| 1018 super_class_name.ToCString()); | 1018 super_class_name.ToCString()); |
| 1019 } | 1019 } |
| 1020 } | 1020 } |
| 1021 } | 1021 } |
| 1022 if (function.kind() == RawFunction::kGetterFunction) { | 1022 if (function.IsGetterFunction()) { |
| 1023 name = Field::NameFromGetter(function_name); | 1023 name = Field::NameFromGetter(function_name); |
| 1024 super_class = FindSuperOwnerOfFunction(cls, name); | 1024 super_class = FindSuperOwnerOfFunction(cls, name); |
| 1025 if (!super_class.IsNull()) { | 1025 if (!super_class.IsNull()) { |
| 1026 const String& class_name = String::Handle(cls.Name()); | 1026 const String& class_name = String::Handle(cls.Name()); |
| 1027 const String& super_class_name = String::Handle(super_class.Name()); | 1027 const String& super_class_name = String::Handle(super_class.Name()); |
| 1028 const Script& script = Script::Handle(cls.script()); | 1028 const Script& script = Script::Handle(cls.script()); |
| 1029 ReportError(script, function.token_pos(), | 1029 ReportError(script, function.token_pos(), |
| 1030 "getter '%s' of class '%s' conflicts with " | 1030 "getter '%s' of class '%s' conflicts with " |
| 1031 "function '%s' of super class '%s'", | 1031 "function '%s' of super class '%s'", |
| 1032 name.ToCString(), | 1032 name.ToCString(), |
| 1033 class_name.ToCString(), | 1033 class_name.ToCString(), |
| 1034 name.ToCString(), | 1034 name.ToCString(), |
| 1035 super_class_name.ToCString()); | 1035 super_class_name.ToCString()); |
| 1036 } | 1036 } |
| 1037 } else if (function.kind() == RawFunction::kSetterFunction) { | 1037 } else if (function.IsSetterFunction()) { |
| 1038 name = Field::NameFromSetter(function_name); | 1038 name = Field::NameFromSetter(function_name); |
| 1039 super_class = FindSuperOwnerOfFunction(cls, name); | 1039 super_class = FindSuperOwnerOfFunction(cls, name); |
| 1040 if (!super_class.IsNull()) { | 1040 if (!super_class.IsNull()) { |
| 1041 const String& class_name = String::Handle(cls.Name()); | 1041 const String& class_name = String::Handle(cls.Name()); |
| 1042 const String& super_class_name = String::Handle(super_class.Name()); | 1042 const String& super_class_name = String::Handle(super_class.Name()); |
| 1043 const Script& script = Script::Handle(cls.script()); | 1043 const Script& script = Script::Handle(cls.script()); |
| 1044 ReportError(script, function.token_pos(), | 1044 ReportError(script, function.token_pos(), |
| 1045 "setter '%s' of class '%s' conflicts with " | 1045 "setter '%s' of class '%s' conflicts with " |
| 1046 "function '%s' of super class '%s'", | 1046 "function '%s' of super class '%s'", |
| 1047 name.ToCString(), | 1047 name.ToCString(), |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1504 void ClassFinalizer::ReportError(const char* format, ...) { | 1504 void ClassFinalizer::ReportError(const char* format, ...) { |
| 1505 va_list args; | 1505 va_list args; |
| 1506 va_start(args, format); | 1506 va_start(args, format); |
| 1507 const Error& error = Error::Handle( | 1507 const Error& error = Error::Handle( |
| 1508 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); | 1508 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); |
| 1509 va_end(args); | 1509 va_end(args); |
| 1510 ReportError(error); | 1510 ReportError(error); |
| 1511 } | 1511 } |
| 1512 | 1512 |
| 1513 } // namespace dart | 1513 } // namespace dart |
| OLD | NEW |