diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-01-20 17:34:02 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-01-20 17:34:02 (GMT) |
commit | a0666b3ab907c0036f5e3f036b32e9ec5a6e551d (patch) | |
tree | d3db8b6beb8622fa41b87b0934d4702cf0b61819 /src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp | |
parent | f4f05b40c8c464daf1e11df6fcdb63d05766ed1f (diff) | |
download | uscxml-a0666b3ab907c0036f5e3f036b32e9ec5a6e551d.zip uscxml-a0666b3ab907c0036f5e3f036b32e9ec5a6e551d.tar.gz uscxml-a0666b3ab907c0036f5e3f036b32e9ec5a6e551d.tar.bz2 |
Regenerated V8 DOM and beautified code
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp index 5c1ac46..2756287 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp @@ -4,37 +4,37 @@ namespace Arabica { namespace DOM { - + v8::Handle<v8::Value> V8Document::evaluateCustomCallback(const v8::Arguments& args) { - if (args.Length() < 1) - throw V8Exception("Wrong number of arguments in evaluate"); + if (args.Length() < 1) + throw V8Exception("Wrong number of arguments in evaluate"); // if (!((V8Node::hasInstance(args[1])) && (V8XPathResult::hasInstance(args[3])))) // throw V8Exception("Parameter mismatch while calling evaluate"); - v8::Local<v8::Object> self = args.Holder(); - V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - - v8::String::AsciiValue localExpression(args[0]); - - XPath::XPathValue<std::string>* retVal; - if (args.Length() > 1) { - Arabica::DOM::Node<std::string>* localContextNode = V8DOM::toClassPtr<Arabica::DOM::Node<std::string> >(args[1]->ToObject()->GetInternalField(0)); - retVal = new XPath::XPathValue<std::string>(privData->dom->xpath->evaluate(*localExpression, *localContextNode)); - } else { - retVal = new XPath::XPathValue<std::string>(privData->dom->xpath->evaluate(*localExpression, *privData->arabicaThis)); - } - - v8::Handle<v8::Function> retCtor = V8XPathResult::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - V8XPathResult::V8XPathResultPrivate* retPrivData = new V8XPathResult::V8XPathResultPrivate(); - retPrivData->dom = privData->dom; - retPrivData->arabicaThis = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8XPathResult::jsDestructor); - return retObj; + v8::Local<v8::Object> self = args.Holder(); + V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); + + v8::String::AsciiValue localExpression(args[0]); + + XPath::XPathValue<std::string>* retVal; + if (args.Length() > 1) { + Arabica::DOM::Node<std::string>* localContextNode = V8DOM::toClassPtr<Arabica::DOM::Node<std::string> >(args[1]->ToObject()->GetInternalField(0)); + retVal = new XPath::XPathValue<std::string>(privData->dom->xpath->evaluate(*localExpression, *localContextNode)); + } else { + retVal = new XPath::XPathValue<std::string>(privData->dom->xpath->evaluate(*localExpression, *privData->arabicaThis)); + } + + v8::Handle<v8::Function> retCtor = V8XPathResult::getTmpl()->GetFunction(); + v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); + + V8XPathResult::V8XPathResultPrivate* retPrivData = new V8XPathResult::V8XPathResultPrivate(); + retPrivData->dom = privData->dom; + retPrivData->arabicaThis = retVal; + + retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); + + retObj.MakeWeak(0, V8XPathResult::jsDestructor); + return retObj; } |