static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) { TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder()); V8TRYCATCH_VOID(Node*, propertyValue, V8Node::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); bool result = collection->anonymousIndexedSetter(index, propertyValue); if (!result) return; v8SetReturnValue(info, jsValue); }
static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) { TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder()); V8TRYCATCH_VOID(Node*, propertyValue, V8Node::toNativeWithTypeCheck(info.GetIsolate(), jsValue)); if (!isUndefinedOrNull(jsValue) && !V8Node::hasInstance(jsValue, info.GetIsolate())) { exceptionState.throwTypeError("The provided value is not of type 'Node'."); exceptionState.throwIfNeeded(); return; } bool result = imp->anonymousIndexedSetter(index, propertyValue); if (!result) return; v8SetReturnValue(info, jsValue); }