| 697 | if (!exceptionTracker) { |
| 698 | return; |
| 699 | } |
| 700 | |
| 701 | if (key->IsName()) { |
| 702 | v8::Local<v8::Context> context = v8::Local<v8::Context>::New(_isolate, _context); |
| 703 | auto keyName = v8::Local<v8::Name>::Cast(key); |
| 704 | setObjectPropertyHelper(context, obj, keyName, val, enumerable, exceptionTracker); |
| 705 | } else if (key->IsInt32()) { |
| 706 | v8::Local<v8::Context> context = v8::Local<v8::Context>::New(_isolate, _context); |
| 707 | auto index = v8::Local<v8::Int32>::Cast(key)->Value(); |
| 708 | setObjectPropertyIndexHelper(context, obj, index, val, enumerable, exceptionTracker); |
| 709 | } else { |
| 710 | exceptionTracker.onError("Failed to set key object because it does not belong to a supported type"); |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | void V8JavaScriptContext::setObjectPropertyIndex(const JSValue& object, |
| 715 | size_t index, |
| 716 | const JSValue& value, |
| 717 | JSExceptionTracker& exceptionTracker) { |
| 718 | v8::HandleScope handleScope(_isolate); |
| 719 | auto obj = v8::Local<v8::Object>::Cast(fromValdiJSValue(_isolate, object, exceptionTracker)); |
| 720 | if (!exceptionTracker) { |
| 721 | return; |
| 722 | } |
| 723 | if (!obj->IsObject()) { |
no test coverage detected