| Index: Source/bindings/v8/custom/V8NodeIteratorCustom.cpp
|
| diff --git a/Source/core/dom/NodeList.cpp b/Source/bindings/v8/custom/V8NodeIteratorCustom.cpp
|
| similarity index 71%
|
| copy from Source/core/dom/NodeList.cpp
|
| copy to Source/bindings/v8/custom/V8NodeIteratorCustom.cpp
|
| index fb06c70817bff7406297e671ca5dd5f5ff7f29e6..d758730f6bd19942ca02ecf19c195d0ad8636443 100644
|
| --- a/Source/core/dom/NodeList.cpp
|
| +++ b/Source/bindings/v8/custom/V8NodeIteratorCustom.cpp
|
| @@ -29,29 +29,26 @@
|
| */
|
|
|
| #include "config.h"
|
| -#include "core/dom/NodeList.h"
|
| +#include "V8NodeIterator.h"
|
|
|
| +#include "V8NodeFilter.h"
|
| +#include "bindings/v8/V8Binding.h"
|
| +#include "bindings/v8/V8HiddenPropertyName.h"
|
| #include "core/dom/Node.h"
|
|
|
| namespace WebCore {
|
|
|
| -void NodeList::anonymousNamedGetter(const AtomicString& name, bool& returnValue0Enabled, RefPtr<Node>& returnValue0, bool& returnValue1Enabled, unsigned& returnValue1)
|
| +v8::Handle<v8::Object> wrap(NodeIterator* nodeIterator, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
|
| {
|
| - // Length property cannot be overridden.
|
| - DEFINE_STATIC_LOCAL(const AtomicString, length, ("length", AtomicString::ConstructFromLiteral));
|
| - if (name == length) {
|
| - returnValue1Enabled = true;
|
| - returnValue1 = this->length();
|
| - return;
|
| - }
|
| -
|
| - Node* result = namedItem(name);
|
| - if (!result)
|
| - return;
|
| -
|
| - returnValue0Enabled = true;
|
| - returnValue0 = result;
|
| -}
|
| + ASSERT(nodeIterator);
|
| + ASSERT(DOMDataStore::getWrapper<V8NodeIterator>(nodeIterator, isolate).IsEmpty());
|
| +
|
| + v8::Handle<v8::Object> wrapper = V8NodeIterator::createWrapper(nodeIterator, creationContext, isolate);
|
|
|
| + if (nodeIterator->filter())
|
| + V8HiddenPropertyName::setNamedHiddenReference(wrapper, "filter", toV8(nodeIterator->filter(), creationContext, isolate));
|
| +
|
| + return wrapper;
|
| +}
|
|
|
| } // namespace WebCore
|
|
|