summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/core/dom/Node.cpp1
-rw-r--r--src/core/dom/Node.hpp7
3 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53fa6a2..3f375f4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,6 +136,7 @@ IF(TEST)
# Add all unit test files
ADD_EXECUTABLE(ousia_test_core
test/core/dom/ManagedTest
+ test/core/dom/NodeTest
test/core/script/FunctionTest
test/core/script/ObjectTest
test/core/script/VariantTest
diff --git a/src/core/dom/Node.cpp b/src/core/dom/Node.cpp
index df5bfcb..a65fc7f 100644
--- a/src/core/dom/Node.cpp
+++ b/src/core/dom/Node.cpp
@@ -87,6 +87,7 @@ std::vector<Rooted<Node>> Node::resolve(const std::vector<std::string> &path,
resolve(res, path, filter, filterData, 0, visited, nullptr);
return res;
}
+
}
}
diff --git a/src/core/dom/Node.hpp b/src/core/dom/Node.hpp
index 571eedd..9c006a1 100644
--- a/src/core/dom/Node.hpp
+++ b/src/core/dom/Node.hpp
@@ -123,7 +123,10 @@ public:
*
* @param mgr is a reference to the Manager instace the node belongs to.
*/
- Node(Manager &mgr) : Managed(mgr) {}
+ Node(Manager &mgr, Handle<Node> parent = nullptr)
+ : Managed(mgr), parent(acquire(parent))
+ {
+ }
/**
* Constructs a new node with the given name and the given parent element.
@@ -132,7 +135,7 @@ public:
* @param name is the name of the Node.
* @param parent is a handle pointing at the parent node.
*/
- Node(Manager &mgr, std::string name, Handle<Node> parent = Null)
+ Node(Manager &mgr, std::string name, Handle<Node> parent = nullptr)
: Managed(mgr), name(name), parent(acquire(parent))
{
}