| Index: Source/bindings/v8/ExceptionState.cpp
|
| diff --git a/Source/core/dom/NodeList.cpp b/Source/bindings/v8/ExceptionState.cpp
|
| similarity index 68%
|
| copy from Source/core/dom/NodeList.cpp
|
| copy to Source/bindings/v8/ExceptionState.cpp
|
| index fb06c70817bff7406297e671ca5dd5f5ff7f29e6..8a1cdb154ba84ec163993efb3430879350db8c70 100644
|
| --- a/Source/core/dom/NodeList.cpp
|
| +++ b/Source/bindings/v8/ExceptionState.cpp
|
| @@ -29,29 +29,40 @@
|
| */
|
|
|
| #include "config.h"
|
| -#include "core/dom/NodeList.h"
|
| +#include "bindings/v8/ExceptionState.h"
|
|
|
| -#include "core/dom/Node.h"
|
| +#include "bindings/v8/V8ThrowException.h"
|
| +#include "core/dom/ExceptionCode.h"
|
|
|
| namespace WebCore {
|
|
|
| -void NodeList::anonymousNamedGetter(const AtomicString& name, bool& returnValue0Enabled, RefPtr<Node>& returnValue0, bool& returnValue1Enabled, unsigned& returnValue1)
|
| +void ExceptionState::throwDOMException(const ExceptionCode& ec, const char* message)
|
| {
|
| - // Length property cannot be overridden.
|
| - DEFINE_STATIC_LOCAL(const AtomicString, length, ("length", AtomicString::ConstructFromLiteral));
|
| - if (name == length) {
|
| - returnValue1Enabled = true;
|
| - returnValue1 = this->length();
|
| + if (m_exceptionThrown)
|
| return;
|
| - }
|
| + V8ThrowException::setDOMException(ec, message, m_isolate);
|
| + m_exceptionThrown = true;
|
| +}
|
|
|
| - Node* result = namedItem(name);
|
| - if (!result)
|
| +void ExceptionState::throwTypeError(const char* message)
|
| +{
|
| + if (m_exceptionThrown)
|
| return;
|
| + V8ThrowException::throwTypeError(message, m_isolate);
|
| + m_exceptionThrown = true;
|
| +}
|
| +
|
| +NonThrowExceptionState::NonThrowExceptionState()
|
| + : ExceptionState(0) { }
|
|
|
| - returnValue0Enabled = true;
|
| - returnValue0 = result;
|
| +void NonThrowExceptionState::throwDOMException(const ExceptionCode& ec, const char*)
|
| +{
|
| + m_code = ec;
|
| }
|
|
|
| +void NonThrowExceptionState::throwTypeError(const char*)
|
| +{
|
| + m_code = TypeError;
|
| +}
|
|
|
| } // namespace WebCore
|
|
|