| 238 | } |
| 239 | |
| 240 | Field TypeType::GetFieldInfo(int id) const |
| 241 | { |
| 242 | int real_id = id - GetBaseType()->GetFieldCount(); |
| 243 | if (real_id < 0) |
| 244 | return GetBaseType()->GetFieldInfo(id); |
| 245 | |
| 246 | if (real_id == 0) |
| 247 | return {0, "String", "name", "", nullptr, 0, 0}; |
| 248 | else if (real_id == 1) |
| 249 | return Field(1, "Object", "prototype", "", nullptr, 0, 0); |
| 250 | else if (real_id == 2) |
| 251 | return Field(2, "Type", "base", "", nullptr, 0, 0); |
| 252 | |
| 253 | throw std::runtime_error("Invalid field ID."); |
| 254 | } |
| 255 | |
| 256 | int TypeType::GetFieldCount() const |
| 257 | { |
no test coverage detected