| 182 | } |
| 183 | |
| 184 | Value icinga::GetPrototypeField(const Value& context, const String& field, bool not_found_error, const DebugInfo& debugInfo) |
| 185 | { |
| 186 | Type::Ptr ctype = context.GetReflectionType(); |
| 187 | Type::Ptr type = ctype; |
| 188 | |
| 189 | do { |
| 190 | Object::Ptr object = type->GetPrototype(); |
| 191 | |
| 192 | if (object && object->HasOwnField(field)) |
| 193 | return object->GetFieldByName(field, false, debugInfo); |
| 194 | |
| 195 | type = type->GetBaseType(); |
| 196 | } while (type); |
| 197 | |
| 198 | if (not_found_error) |
| 199 | BOOST_THROW_EXCEPTION(ScriptError("Invalid field access (for value of type '" + ctype->GetName() + "'): '" + field + "'", debugInfo)); |
| 200 | else |
| 201 | return Empty; |
| 202 | } |
| 203 | |
| 204 | #ifdef I2_LEAK_DEBUG |
| 205 | void icinga::TypeAddObject(const Object *object) |
nothing calls this directly
no test coverage detected