summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp')
-rw-r--r--WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp b/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
index 93a9b68..c22d127 100644
--- a/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
@@ -50,11 +50,15 @@ CALLBACK_FUNC_DECL(HTMLOptionElementConstructor)
if (!args.IsConstructCall())
return throwError("DOM object constructor cannot be called as a function.");
- Document* document = V8Proxy::retrieveFrame()->document();
+ Frame* frame = V8Proxy::retrieveFrameForCurrentContext();
+ if (!frame)
+ return throwError("Option constructor associated frame is unavailable", V8Proxy::ReferenceError);
+
+ Document* document = frame->document();
if (!document)
- return throwError("Option constructor associated document is unavailable", V8Proxy::REFERENCE_ERROR);
+ return throwError("Option constructor associated document is unavailable", V8Proxy::ReferenceError);
- RefPtr<HTMLOptionElement> option = new HTMLOptionElement(HTMLNames::optionTag, V8Proxy::retrieveFrame()->document());
+ RefPtr<HTMLOptionElement> option = new HTMLOptionElement(HTMLNames::optionTag, document);
ExceptionCode ec = 0;
RefPtr<Text> text = document->createTextNode("");
@@ -81,9 +85,9 @@ CALLBACK_FUNC_DECL(HTMLOptionElementConstructor)
}
}
- V8Proxy::SetDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::NODE), option.get());
+ V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::NODE), option.get());
option->ref();
- V8Proxy::SetJSWrapperForDOMNode(option.get(), v8::Persistent<v8::Object>::New(args.Holder()));
+ V8DOMWrapper::setJSWrapperForDOMNode(option.get(), v8::Persistent<v8::Object>::New(args.Holder()));
return args.Holder();
}