| 351 | } |
| 352 | |
| 353 | Value Array::GetFieldByName(const String& field, bool sandboxed, const DebugInfo& debugInfo) const |
| 354 | { |
| 355 | int index; |
| 356 | |
| 357 | try { |
| 358 | index = Convert::ToLong(field); |
| 359 | } catch (...) { |
| 360 | return Object::GetFieldByName(field, sandboxed, debugInfo); |
| 361 | } |
| 362 | |
| 363 | ObjectLock olock(this); |
| 364 | |
| 365 | if (index < 0 || static_cast<size_t>(index) >= GetLength()) |
| 366 | BOOST_THROW_EXCEPTION(ScriptError("Array index '" + Convert::ToString(index) + "' is out of bounds.", debugInfo)); |
| 367 | |
| 368 | return Get(index); |
| 369 | } |
| 370 | |
| 371 | void Array::SetFieldByName(const String& field, const Value& value, const DebugInfo& debugInfo) |
| 372 | { |
no test coverage detected