Changeset 20340
- Timestamp:
- 10/01/08 08:44:11 (5 years ago)
- Location:
- lang/cplusplus/llv8call/branches/gdome
- Files:
-
- 4 modified
-
ext/gdome/document.cc (modified) (1 diff)
-
ext/gdome/element.cc (modified) (2 diffs)
-
ext/gdome/gdome.h (modified) (1 diff)
-
t/020_ext/09_gdome.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/cplusplus/llv8call/branches/gdome/ext/gdome/document.cc
r20254 r20340 149 149 ot->Set("getElementById", FunctionTemplate::New(_getElementById)); 150 150 ot->Set("firstChild", FunctionTemplate::New(_firstChild)); 151 ot->Set("lastChild", FunctionTemplate::New(_lastChild));151 ot->Set("lastChild", FunctionTemplate::New(_lastChild)); 152 152 ot->Set("hasChildNodes", FunctionTemplate::New(_hasChildNodes)); 153 153 ot->Set("Close", FunctionTemplate::New(_close)); -
lang/cplusplus/llv8call/branches/gdome/ext/gdome/element.cc
r20254 r20340 147 147 END 148 148 149 GFUNCTION(_nodeValue) 150 ARG_COUNT(0); 151 EXTERNAL_ELEM(); 152 GdomeDOMString *s = gdome_el_nodeValue(elem, &exc); 153 HANDLE_EXCEPTION(); 154 if (s) { 155 RETURN_STRING(s); 156 } else { 157 return Undefined(); 158 } 159 END 160 161 GFUNCTION(_setNodeValue) 162 ARG_COUNT(0); 163 ARG_gstr(val, 0); 164 EXTERNAL_ELEM(); 165 gdome_el_set_nodeValue(elem, *val, &exc); 166 HANDLE_EXCEPTION(); 167 return Undefined(); 168 END 169 149 170 GFUNCTION(_hasChildNodes) 150 171 ARG_COUNT(0); … … 173 194 ot->Set("hasChildNodes", FunctionTemplate::New(_hasChildNodes)); 174 195 ot->Set("firstChild", FunctionTemplate::New(_firstChild)); 196 ot->Set("nodeValue", FunctionTemplate::New(_nodeValue)); 197 ot->Set("setNodeValue", FunctionTemplate::New(_setNodeValue)); 175 198 ot->Set("lastChild", FunctionTemplate::New(_lastChild)); 176 199 ot->Set("Close", FunctionTemplate::New(_Close)); -
lang/cplusplus/llv8call/branches/gdome/ext/gdome/gdome.h
r20252 r20340 78 78 #define RETURN_TEXT(e) RETURN_BASE("Text", e); 79 79 #define RETURN_DOC(e) RETURN_BASE("Document", e); 80 #define RETURN_STRING(e) do { Handle<String> __buf = String::New((e)->str); gdome_str_unref((e)); return __buf; } while(0) 80 81 -
lang/cplusplus/llv8call/branches/gdome/t/020_ext/09_gdome.js
r20254 r20340 1 1 require('t/util.js'); 2 2 3 Test.More.plan({tests: 3});3 Test.More.plan({tests:19}); 4 4 5 5 check_lib("org.coderepos.gdome"); … … 68 68 }()); 69 69 70 (function () { 71 var di = new gdome.GDOME(); 72 var doc = di.createDocFromMemory('<?xml version="1.0"?>' + "\n" + '<TEST>3</TEST>' + "\n"); 73 var e = doc.firstChild().firstChild(); 74 Test.More.is(e.nodeValue(), '3', "doc.nodeValue()"); 75 e.setNodeValue(5); 76 Test.More.is(e.nodeValue(), '5', "doc.nodeValue()"); 77 Test.More.is(doc.firstChild().nodeValue(), undefined, "doc.nodeValue( element node's node value should be undefined )"); 78 doc.Close(); 79 di.Close(); 80 }()); 81 70 82 // doc.getElementsByTagName 71 83 // doc.getElementById(no test)
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)