summaryrefslogtreecommitdiff
path: root/javascript/duktape
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/duktape')
-rw-r--r--javascript/duktape/character_data.c2
-rw-r--r--javascript/duktape/comment.c2
-rw-r--r--javascript/duktape/document.c4
-rw-r--r--javascript/duktape/element.c2
-rw-r--r--javascript/duktape/html_element.c2
-rw-r--r--javascript/duktape/html_unknown_element.c2
-rw-r--r--javascript/duktape/node.c4
-rw-r--r--javascript/duktape/node_list.c4
-rw-r--r--javascript/duktape/private.h5
-rw-r--r--javascript/duktape/prototypes.h1
-rw-r--r--javascript/duktape/text.c2
-rw-r--r--javascript/duktape/window.c4
12 files changed, 19 insertions, 15 deletions
diff --git a/javascript/duktape/character_data.c b/javascript/duktape/character_data.c
index a71de478f..608c6554d 100644
--- a/javascript/duktape/character_data.c
+++ b/javascript/duktape/character_data.c
@@ -41,7 +41,7 @@ DUKKY_FUNC(character_data, __proto)
/* Populate character_data's prototypical functionality */
/* Set this prototype's prototype (left-parent)*/
- DUKKY_GET_PROTOTYPE(node);
+ DUKKY_GET_PROTOTYPE(NODE);
duk_set_prototype(ctx, 0);
/* And the initialiser/finalizer */
DUKKY_SET_DESTRUCTOR(0, character_data);
diff --git a/javascript/duktape/comment.c b/javascript/duktape/comment.c
index 877793af2..8fbf79f55 100644
--- a/javascript/duktape/comment.c
+++ b/javascript/duktape/comment.c
@@ -41,7 +41,7 @@ DUKKY_FUNC(comment, __proto)
/* Populate comment's prototypical functionality */
/* Set this prototype's prototype (left-parent)*/
- DUKKY_GET_PROTOTYPE(character_data);
+ DUKKY_GET_PROTOTYPE(CHARACTERDATA);
duk_set_prototype(ctx, 0);
/* And the initialiser/finalizer */
DUKKY_SET_DESTRUCTOR(0, comment);
diff --git a/javascript/duktape/document.c b/javascript/duktape/document.c
index 76fec7501..f09629ac6 100644
--- a/javascript/duktape/document.c
+++ b/javascript/duktape/document.c
@@ -223,7 +223,7 @@ static DUKKY_FUNC(document, getElementsByTagName)
if (nodes == NULL) return 0; /* coerced to undefined */
duk_push_pointer(ctx, nodes);
- dukky_create_object(ctx, PROTO_NAME(node_list), 1);
+ dukky_create_object(ctx, PROTO_NAME(NODELIST), 1);
dom_nodelist_unref(nodes);
return 1;
}
@@ -239,7 +239,7 @@ DUKKY_FUNC(document, __proto)
DUKKY_POPULATE_READONLY_PROPERTY(document, body);
DUKKY_POPULATE_READONLY_PROPERTY(document, head);
/* Set this prototype's prototype (left-parent)*/
- DUKKY_GET_PROTOTYPE(node);
+ DUKKY_GET_PROTOTYPE(NODE);
duk_set_prototype(ctx, 0);
/* And the initialiser/finalizer */
DUKKY_SET_DESTRUCTOR(0, document);
diff --git a/javascript/duktape/element.c b/javascript/duktape/element.c
index 23c76278a..b86e940f2 100644
--- a/javascript/duktape/element.c
+++ b/javascript/duktape/element.c
@@ -211,7 +211,7 @@ DUKKY_FUNC(element, __proto)
DUKKY_POPULATE_READONLY_PROPERTY(element, previousElementSibling);
DUKKY_POPULATE_READONLY_PROPERTY(element, childElementCount);
/* Set this prototype's prototype (left-parent)*/
- DUKKY_GET_PROTOTYPE(node);
+ DUKKY_GET_PROTOTYPE(NODE);
duk_set_prototype(ctx, 0);
/* And the initialiser/finalizer */
DUKKY_SET_DESTRUCTOR(0, element);
diff --git a/javascript/duktape/html_element.c b/javascript/duktape/html_element.c
index c129866e4..1b22f6788 100644
--- a/javascript/duktape/html_element.c
+++ b/javascript/duktape/html_element.c
@@ -41,7 +41,7 @@ DUKKY_FUNC(html_element, __proto)
/* Populate html_element's prototypical functionality */
/* Set this prototype's prototype (left-parent)*/
- DUKKY_GET_PROTOTYPE(element);
+ DUKKY_GET_PROTOTYPE(ELEMENT);
duk_set_prototype(ctx, 0);
/* And the initialiser/finalizer */
DUKKY_SET_DESTRUCTOR(0, html_element);
diff --git a/javascript/duktape/html_unknown_element.c b/javascript/duktape/html_unknown_element.c
index e728b4831..977450a02 100644
--- a/javascript/duktape/html_unknown_element.c
+++ b/javascript/duktape/html_unknown_element.c
@@ -41,7 +41,7 @@ DUKKY_FUNC(html_unknown_element, __proto)
/* Populate html_unknown_element's prototypical functionality */
/* Set this prototype's prototype (left-parent)*/
- DUKKY_GET_PROTOTYPE(html_element);
+ DUKKY_GET_PROTOTYPE(HTMLELEMENT);
duk_set_prototype(ctx, 0);
/* And the initialiser/finalizer */
DUKKY_SET_DESTRUCTOR(0, html_unknown_element);
diff --git a/javascript/duktape/node.c b/javascript/duktape/node.c
index 2d7b1cf29..c81c1be10 100644
--- a/javascript/duktape/node.c
+++ b/javascript/duktape/node.c
@@ -42,7 +42,7 @@ static DUKKY_FUNC(node, appendChild)
{
DUKKY_GET_METHOD_PRIVATE(node);
- if (!dukky_instanceof(ctx, PROTO_NAME(node))) return 0;
+ if (!dukky_instanceof(ctx, PROTO_NAME(NODE))) return 0;
DUKKY_SAFE_GET_ANOTHER(other,node,0);
@@ -82,7 +82,7 @@ DUKKY_FUNC(node, __proto)
DUKKY_ADD_METHOD(node, appendChild, 1);
DUKKY_POPULATE_READONLY_PROPERTY(node, textContent);
/* Set this prototype's prototype (left-parent)*/
- DUKKY_GET_PROTOTYPE(event_target);
+ DUKKY_GET_PROTOTYPE(EVENTTARGET);
duk_set_prototype(ctx, 0);
/* And the initialiser/finalizer */
DUKKY_SET_DESTRUCTOR(0, node);
diff --git a/javascript/duktape/node_list.c b/javascript/duktape/node_list.c
index c127c2468..5ee9ec600 100644
--- a/javascript/duktape/node_list.c
+++ b/javascript/duktape/node_list.c
@@ -40,7 +40,7 @@ static DUKKY_GETTER(node_list, length)
{
DUKKY_GET_METHOD_PRIVATE(node_list);
dom_exception err;
- unsigned long len;
+ uint32_t len;
err = dom_nodelist_get_length(priv->nodes, &len);
@@ -57,8 +57,6 @@ static DUKKY_FUNC(node_list, item)
dom_exception err;
dom_node *node;
- LOG("Looking up %u in %p", i, priv->nodes);
-
err = dom_nodelist_item(priv->nodes, i, &node);
if (err != DOM_NO_ERR) return 0; /* coerced to undefied */
diff --git a/javascript/duktape/private.h b/javascript/duktape/private.h
index 42c207987..da97031f3 100644
--- a/javascript/duktape/private.h
+++ b/javascript/duktape/private.h
@@ -12,6 +12,7 @@ struct dom_node_text;
struct dom_node_list;
struct dom_node_comment;
struct dom_html_collection;
+struct dom_html_br_element;
typedef struct {
} event_target_private_t;
@@ -52,6 +53,10 @@ typedef struct {
} html_unknown_element_private_t;
typedef struct {
+ html_element_private_t parent;
+} html_br_element_private_t;
+
+typedef struct {
node_private_t parent;
} document_private_t;
diff --git a/javascript/duktape/prototypes.h b/javascript/duktape/prototypes.h
index 1f25424ac..746f85cc5 100644
--- a/javascript/duktape/prototypes.h
+++ b/javascript/duktape/prototypes.h
@@ -11,6 +11,7 @@ DUKKY_DECLARE_INTERFACE(document, struct dom_document *);
DUKKY_DECLARE_INTERFACE(element, struct dom_element *);
DUKKY_DECLARE_INTERFACE(html_element, struct dom_html_element *);
DUKKY_DECLARE_INTERFACE(html_unknown_element, struct dom_html_element *);
+DUKKY_DECLARE_INTERFACE(html_br_element, struct dom_html_br_element *);
DUKKY_DECLARE_INTERFACE(html_collection, struct dom_html_collection *);
DUKKY_DECLARE_INTERFACE(node_list, struct dom_nodelist *);
diff --git a/javascript/duktape/text.c b/javascript/duktape/text.c
index 7669bae11..26457749d 100644
--- a/javascript/duktape/text.c
+++ b/javascript/duktape/text.c
@@ -41,7 +41,7 @@ DUKKY_FUNC(text, __proto)
/* Populate text's prototypical functionality */
/* Set this prototype's prototype (left-parent)*/
- DUKKY_GET_PROTOTYPE(character_data);
+ DUKKY_GET_PROTOTYPE(CHARACTERDATA);
duk_set_prototype(ctx, 0);
/* And the initialiser/finalizer */
DUKKY_SET_DESTRUCTOR(0, text);
diff --git a/javascript/duktape/window.c b/javascript/duktape/window.c
index 3bad2ab9a..fd070aa2c 100644
--- a/javascript/duktape/window.c
+++ b/javascript/duktape/window.c
@@ -78,10 +78,10 @@ DUKKY_FUNC(window, __proto)
/* Populate window's prototypical functionality */
DUKKY_POPULATE_FULL_PROPERTY(window, document);
/* Exposed prototypes */
- DUKKY_GET_PROTOTYPE(node);
+ DUKKY_GET_PROTOTYPE(NODE);
duk_put_prop_string(ctx, 0, "Node");
/* Set this prototype's prototype (left-parent)*/
- DUKKY_GET_PROTOTYPE(event_target);
+ DUKKY_GET_PROTOTYPE(EVENTTARGET);
duk_set_prototype(ctx, 0);
/* And the initialiser/finalizer */
DUKKY_SET_DESTRUCTOR(0, window);