diff options
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp index fc7513b..0e84442 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp @@ -53,15 +53,21 @@ JSStaticFunction JSCNode::staticFunctions[] = { JSValueRef JSCNode::nodeNameAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); + JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getNodeName().c_str()); - return JSValueMakeString(ctx, stringRef); + JSValueRef retVal = JSValueMakeString(ctx, stringRef); + JSStringRelease(stringRef); + return retVal; } JSValueRef JSCNode::nodeValueAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); + JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getNodeValue().c_str()); - return JSValueMakeString(ctx, stringRef); + JSValueRef retVal = JSValueMakeString(ctx, stringRef); + JSStringRelease(stringRef); + return retVal; } @@ -207,15 +213,21 @@ JSValueRef JSCNode::ownerDocumentAttrGetter(JSContextRef ctx, JSObjectRef object JSValueRef JSCNode::namespaceURIAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); + JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getNamespaceURI().c_str()); - return JSValueMakeString(ctx, stringRef); + JSValueRef retVal = JSValueMakeString(ctx, stringRef); + JSStringRelease(stringRef); + return retVal; } JSValueRef JSCNode::prefixAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); + JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getPrefix().c_str()); - return JSValueMakeString(ctx, stringRef); + JSValueRef retVal = JSValueMakeString(ctx, stringRef); + JSStringRelease(stringRef); + return retVal; } @@ -235,8 +247,11 @@ bool JSCNode::prefixAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRe JSValueRef JSCNode::localNameAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); + JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getLocalName().c_str()); - return JSValueMakeString(ctx, stringRef); + JSValueRef retVal = JSValueMakeString(ctx, stringRef); + JSStringRelease(stringRef); + return retVal; } JSValueRef JSCNode::ELEMENT_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { |