Changeset 21023
- Timestamp:
- 10/09/08 08:48:31 (3 months ago)
- Location:
- lang/cplusplus/llv8call/trunk
- Files:
-
- 3 modified
-
ext/libxml/element.cc (modified) (2 diffs)
-
ext/libxml/libxml.h (modified) (1 diff)
-
t/070_libxml/02_dom.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/cplusplus/llv8call/trunk/ext/libxml/element.cc
r21008 r21023 47 47 xmlFree(ret); 48 48 return s; 49 } else { 50 return Undefined(); 51 } 52 END 53 54 FUNCTION(getAttributeNode) 55 ARG_COUNT(1); 56 ARG_str(name, 0); 57 EXTERNAL_NODE(); 58 EXTERNAL_DOC(); 59 xmlAttrPtr attr = domGetAttrNode(node, (const xmlChar*)*name); 60 if (attr) { 61 return CREATE_ATTR(doc, attr); 49 62 } else { 50 63 return Undefined(); … … 108 121 BIND_IM("appendTextNode", appendText); // alias 109 122 BIND_IM("getAttribute", getAttribute); 123 BIND_IM("getAttributeNode", getAttributeNode); 110 124 BIND_IM("hasAttribute", hasAttribute); 111 125 BIND_IM("removeAttribute", removeAttribute); -
lang/cplusplus/llv8call/trunk/ext/libxml/libxml.h
r20986 r21023 35 35 } 36 36 37 #define CREATE_NODE(doc, node) createObject("Node", doc, node)38 #define CREATE_ATTR(doc, node) createObject("Attr ibute", doc,node)37 #define CREATE_NODE(doc, node) createObject("Node", doc, node) 38 #define CREATE_ATTR(doc, node) createObject("Attr", doc, (xmlNodePtr)node) 39 39 40 40 #define ARG_node(name, n) EXTERNAL(xmlNodePtr, name, args[n]->ToObject(), 0) -
lang/cplusplus/llv8call/trunk/t/070_libxml/02_dom.js
r21020 r21023 1 1 require('t/util.js'); 2 2 3 plan({tests:4 2});3 plan({tests:44}); 4 4 5 5 check_lib("org.coderepos.libxml"); … … 162 162 }); 163 163 164 test(function () { 165 root.setAttributeNode(doc.createAttribute("foo", "bar")); 166 is(root.getAttributeNode('foo').getValue(), 'bar', 'node.getAttributeNode()'); 167 is(root.getAttributeNode('noo'), undefined, 'node.getAttributeNode()'); 168 }); 169 164 170 doc.close(); 165 171
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)