Home | History | Annotate | Download | only in v8

Lines Matching refs:Collection

52 template<class Collection> static Collection* toNativeCollection(v8::Local<v8::Object> object)
54 return reinterpret_cast<Collection*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
62 // Returns named property of a collection.
63 template<class Collection, class ItemType> static v8::Handle<v8::Value> getNamedPropertyOfCollection(v8::Local<v8::String> name, v8::Local<v8::Object> object)
65 // FIXME: assert object is a collection type
68 Collection* collection = toNativeCollection<Collection>(object);
70 return getV8Object<ItemType>(collection->namedItem(propertyName));
74 template<class Collection, class ItemType> static v8::Handle<v8::Value> collectionNamedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
85 return getNamedPropertyOfCollection<Collection, ItemType>(name, info.Holder());
88 // Returns the property at the index of a collection.
89 template<class Collection, class ItemType> static v8::Handle<v8::Value> getIndexedPropertyOfCollection(uint32_t index, v8::Local<v8::Object> object)
91 // FIXME: Assert that object must be a collection type.
94 Collection* collection = toNativeCollection<Collection>(object);
95 return getV8Object<ItemType>(collection->item(index));
99 template<class Collection, class ItemType> static v8::Handle<v8::Value> collectionIndexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
101 return getIndexedPropertyOfCollection<Collection, ItemType>(index, info.Holder());
105 template<class Collection> static v8::Handle<v8::Array> nodeCollectionIndexedPropertyEnumerator(const v8::AccessorInfo& info)
108 Collection* collection = toNativeCollection<Collection>(info.Holder());
109 int length = collection->length();
119 // Get an array containing the names of indexed properties in a collection.
120 template<class Collection> static v8::Handle<v8::Array> collectionIndexedPropertyEnumerator(const v8::AccessorInfo& info)
123 Collection* collection = toNativeCollection<Collection>(info.Holder());
124 int length = collection->length();
136 template<class Collection> static v8::Handle<v8::Value> collectionStringOrNullIndexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
138 // FIXME: assert that object must be a collection type
140 Collection* collection = toNativeCollection<Collection>(info.Holder());
141 String result = collection->item(index);
147 template<class Collection> static v8::Handle<v8::Value> collectionStringIndexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
149 // FIXME: assert that object must be a collection type
151 Collection* collection = toNativeCollection<Collection>(info.Holder());
152 String result = collection->item(index);
157 // Add indexed getter to the function template for a collection.
158 template<class Collection, class ItemType> static void setCollectionIndexedGetter(v8::Handle<v8::FunctionTemplate> desc)
160 desc->InstanceTemplate()->SetIndexedPropertyHandler(collectionIndexedPropertyGetter<Collection, ItemType>, 0, 0, 0, collectionIndexedPropertyEnumerator<Collection>);
164 // Add named getter to the function template for a collection.
165 template<class Collection, class ItemType> static void setCollectionNamedGetter(v8::Handle<v8::FunctionTemplate> desc)
167 desc->InstanceTemplate()->SetNamedPropertyHandler(collectionNamedPropertyGetter<Collection, ItemType>, 0, 0, 0, 0);
170 // Add indexed getter returning a string or null to a function template for a collection.
171 template<class Collection> static void setCollectionStringOrNullIndexedGetter(v8::Handle<v8::FunctionTemplate> desc)
173 desc->InstanceTemplate()->SetIndexedPropertyHandler(collectionStringOrNullIndexedPropertyGetter<Collection>, 0, 0, 0, collectionIndexedPropertyEnumerator<Collection>);
177 // Add indexed getter returning a string to a function template for a collection.
178 template<class Collection> static void setCollectionStringIndexedGetter(v8::Handle<v8::FunctionTemplate> desc)
180 desc->InstanceTemplate()->SetIndexedPropertyHandler(collectionStringIndexedPropertyGetter<Collection>, 0, 0, 0, collectionIndexedPropertyEnumerator<Collection>);