summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-07-29 00:08:08 +0100
committerVincent Sanders <vince@kyllikki.org>2015-07-29 00:08:08 +0100
commitcb23f1f911523752db095781d0d5fa3e334f1aa5 (patch)
tree4c9044542443243067f9e57d4710573b49122f74 /test
parent3f0d06f529fb5efaeb4edd89e61b3421951b8bf2 (diff)
downloadnsgenbind-cb23f1f911523752db095781d0d5fa3e334f1aa5.tar.gz
nsgenbind-cb23f1f911523752db095781d0d5fa3e334f1aa5.tar.bz2
Add property generation and add it to prototype construction
Diffstat (limited to 'test')
-rw-r--r--test/data/bindings/browser-duk.bnd17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/data/bindings/browser-duk.bnd b/test/data/bindings/browser-duk.bnd
index 0ddfa02..513ad99 100644
--- a/test/data/bindings/browser-duk.bnd
+++ b/test/data/bindings/browser-duk.bnd
@@ -161,10 +161,23 @@ method Node::appendChild()
dom_node_unref(spare);
%}
-getter Node::aprop()
+getter Node::textContent()
%{
+ dom_exception exc;
+ dom_string *content;
+
+ exc = dom_node_get_text_content(priv->node, &content);
+ if (exc != DOM_NO_ERR) {
+ return 0;
+ }
+
+ if (content != NULL) {
+ duk_push_lstring(ctx, dom_string_data(content), dom_string_length(content));
+ dom_string_unref(content);
+ return 1;
+ }
%}
-setter Node::aprop()
+setter Node::textContent()
%{
%}