From cb23f1f911523752db095781d0d5fa3e334f1aa5 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 29 Jul 2015 00:08:08 +0100 Subject: Add property generation and add it to prototype construction --- test/data/bindings/browser-duk.bnd | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'test') 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() %{ %} -- cgit v1.2.3