void moveEventListenerToNewWrapper(v8::Handle<v8::Object> object, EventListener* oldValue, v8::Local<v8::Value> newValue, int arrayIndex, v8::Isolate* isolate) { if (oldValue) { V8AbstractEventListener* oldListener = V8AbstractEventListener::cast(oldValue); if (oldListener) { v8::Local<v8::Object> oldListenerObject = oldListener->getExistingListenerObject(); if (!oldListenerObject.IsEmpty()) removeHiddenValueFromArray(object, oldListenerObject, arrayIndex, isolate); } } // Non-callable input is treated as null and ignored if (newValue->IsFunction()) addHiddenValueToArray(object, newValue, arrayIndex, isolate); }
void transferHiddenDependency(v8::Handle<v8::Object> object, EventListener* oldValue, v8::Local<v8::Value> newValue, int cacheIndex, v8::Isolate* isolate) { if (oldValue) { V8AbstractEventListener* oldListener = V8AbstractEventListener::cast(oldValue); if (oldListener) { v8::Local<v8::Object> oldListenerObject = oldListener->getExistingListenerObject(); if (!oldListenerObject.IsEmpty()) removeHiddenDependency(object, oldListenerObject, cacheIndex, isolate); } } // Non-callable input is treated as null and ignored if (newValue->IsFunction()) createHiddenDependency(object, newValue, cacheIndex, isolate); }
void transferHiddenDependency(v8::Handle<v8::Object> object, EventListener* oldValue, v8::Local<v8::Value> newValue, int cacheIndex) { if (oldValue) { V8AbstractEventListener* oldListener = V8AbstractEventListener::cast(oldValue); if (oldListener) { v8::Local<v8::Object> oldListenerObject = oldListener->getExistingListenerObject(); if (!oldListenerObject.IsEmpty()) removeHiddenDependency(object, oldListenerObject, cacheIndex); } } if (!newValue->IsNull() && !newValue->IsUndefined()) createHiddenDependency(object, newValue, cacheIndex); }