Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mikearmstrong001/9f5d87ed622119c97cebc6ebd1534bd6 to your computer and use it in GitHub Desktop.
Save mikearmstrong001/9f5d87ed622119c97cebc6ebd1534bd6 to your computer and use it in GitHub Desktop.
diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js
index 44b5209..93d547d 100644
--- a/gentest/gentest-javascript.js
+++ b/gentest/gentest-javascript.js
@@ -50,6 +50,13 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, {
}},
emitTestEpilogue:{value:function(experiments) {
+ this.push([
+ 'console.log(\'before instanceCount\', Yoga.instanceCount());',
+ 'root.disposeRecursive();',
+ 'console.log(\'after instanceCount\', Yoga.instanceCount());',
+ 'console.assert(0 === Yoga.instanceCount());',
+ ]);
+
if (experiments.length > 0) {
this.push('');
for (var i in experiments) {
diff --git a/javascript/sources/Node.cc b/javascript/sources/Node.cc
index 6cb047a..c4ead29 100644
--- a/javascript/sources/Node.cc
+++ b/javascript/sources/Node.cc
@@ -29,7 +29,31 @@ Node::Node(void)
Node::~Node(void)
{
- YGNodeFree(m_node);
+ dispose();
+}
+
+void Node::dispose()
+{
+ if (m_node)
+ {
+ YGNodeFree(m_node);
+ m_node = 0;
+ }
+}
+
+void Node::disposeRecursive()
+{
+ if (!m_node)
+ {
+ return;
+ }
+ for (signed childIndex = (signed)getChildCount()-1; childIndex >= 0; --childIndex)
+ {
+ auto child = getChild(childIndex);
+ child->disposeRecursive();
+ removeChild(child);
+ }
+ dispose();
}
void Node::reset(void)
diff --git a/javascript/sources/Node.hh b/javascript/sources/Node.hh
index b3bddb9..a6da8ac 100644
--- a/javascript/sources/Node.hh
+++ b/javascript/sources/Node.hh
@@ -30,6 +30,9 @@ class Node {
~Node(void);
+ void dispose();
+ void disposeRecursive();
+
public: // Prevent accidental copy
Node(Node const &) = delete;
diff --git a/javascript/sources/entry-common.js b/javascript/sources/entry-common.js
index e1c74fa..4ebae92 100644
--- a/javascript/sources/entry-common.js
+++ b/javascript/sources/entry-common.js
@@ -142,9 +142,15 @@ module.exports = function (bind, lib) {
}
+ function instanceCount() {
+
+ return lib.instanceCount();
+
+ }
+
bind(`Layout`, Layout);
bind(`Size`, Size);
- return Object.assign({ Layout, Node: function() { return Node.makeNode(); }, Size, setExperimentalFeatureEnabled, isExperimentalFeatureEnabled }, constants);
+ return Object.assign({ Layout, Node: function() { return Node.makeNode(); }, Size, setExperimentalFeatureEnabled, isExperimentalFeatureEnabled, instanceCount }, constants);
};
diff --git a/javascript/sources/global.cc b/javascript/sources/global.cc
index 8e039e1..40addca 100644
--- a/javascript/sources/global.cc
+++ b/javascript/sources/global.cc
@@ -11,3 +11,8 @@ bool isExperimentalFeatureEnabled(int feature)
{
return YGIsExperimentalFeatureEnabled(static_cast<YGExperimentalFeature>(feature));
}
+
+int instanceCount(void)
+{
+ return YGNodeGetInstanceCount();
+}
diff --git a/javascript/sources/global.hh b/javascript/sources/global.hh
index eeaef3b..d28e245 100644
--- a/javascript/sources/global.hh
+++ b/javascript/sources/global.hh
@@ -2,3 +2,4 @@
void setExperimentalFeatureEnabled(int feature, bool enabled);
bool isExperimentalFeatureEnabled(int feature);
+int instanceCount(void);
diff --git a/javascript/sources/nbind.cc b/javascript/sources/nbind.cc
index 9a56aaa..386d143 100644
--- a/javascript/sources/nbind.cc
+++ b/javascript/sources/nbind.cc
@@ -11,6 +11,7 @@ NBIND_GLOBAL()
{
function(setExperimentalFeatureEnabled);
function(isExperimentalFeatureEnabled);
+ function(instanceCount);
}
NBIND_CLASS(Size)
@@ -30,6 +31,9 @@ NBIND_CLASS(Node)
construct<>();
+ method(dispose);
+ method(disposeRecursive);
+
method(reset);
method(copyStyle);
diff --git a/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js b/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js
index 7e4fb88..7e686c1 100644
--- a/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js
+++ b/javascript/tests/Facebook.Yoga/YGAbsolutePositionTest.js
@@ -46,6 +46,10 @@ it("absolute_layout_width_height_start_top", function () {
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("absolute_layout_width_height_end_bottom", function () {
var root = new Yoga.Node();
@@ -82,6 +86,10 @@ it("absolute_layout_width_height_end_bottom", function () {
console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("absolute_layout_start_top_end_bottom", function () {
var root = new Yoga.Node();
@@ -118,6 +126,10 @@ it("absolute_layout_start_top_end_bottom", function () {
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop()");
console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth()");
console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("absolute_layout_width_height_start_top_end_bottom", function () {
var root = new Yoga.Node();
@@ -156,6 +168,10 @@ it("absolute_layout_width_height_start_top_end_bottom", function () {
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", function () {
var root = new Yoga.Node();
@@ -207,6 +223,10 @@ it("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop()");
console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth()");
console.assert(100 === root_child0_child0.getComputedHeight(), "100 === root_child0_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("absolute_layout_within_border", function () {
var root = new Yoga.Node();
@@ -273,4 +293,8 @@ it("absolute_layout_within_border", function () {
console.assert(40 === root_child1.getComputedTop(), "40 === root_child1.getComputedTop()");
console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth()");
console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGAlignContentTest.js b/javascript/tests/Facebook.Yoga/YGAlignContentTest.js
index efce559..6091038 100644
--- a/javascript/tests/Facebook.Yoga/YGAlignContentTest.js
+++ b/javascript/tests/Facebook.Yoga/YGAlignContentTest.js
@@ -104,6 +104,10 @@ it("align_content_flex_start", function () {
console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop()");
console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth()");
console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("align_content_flex_end", function () {
var root = new Yoga.Node();
@@ -199,6 +203,10 @@ it("align_content_flex_end", function () {
console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop()");
console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth()");
console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("align_content_center", function () {
var root = new Yoga.Node();
@@ -294,6 +302,10 @@ it("align_content_center", function () {
console.assert(40 === root_child4.getComputedTop(), "40 === root_child4.getComputedTop()");
console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth()");
console.assert(10 === root_child4.getComputedHeight(), "10 === root_child4.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("align_content_stretch", function () {
var root = new Yoga.Node();
@@ -384,4 +396,8 @@ it("align_content_stretch", function () {
console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop()");
console.assert(50 === root_child4.getComputedWidth(), "50 === root_child4.getComputedWidth()");
console.assert(0 === root_child4.getComputedHeight(), "0 === root_child4.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js b/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js
index ec2d3cd..8f14009 100644
--- a/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js
+++ b/javascript/tests/Facebook.Yoga/YGAlignItemsTest.js
@@ -42,6 +42,10 @@ it("align_items_stretch", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("align_items_center", function () {
var root = new Yoga.Node();
@@ -76,6 +80,10 @@ it("align_items_center", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("align_items_flex_start", function () {
var root = new Yoga.Node();
@@ -110,6 +118,10 @@ it("align_items_flex_start", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("align_items_flex_end", function () {
var root = new Yoga.Node();
@@ -144,4 +156,8 @@ it("align_items_flex_end", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js b/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js
index 9c80134..8c290d9 100644
--- a/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js
+++ b/javascript/tests/Facebook.Yoga/YGAlignSelfTest.js
@@ -44,6 +44,10 @@ it("align_self_center", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("align_self_flex_end", function () {
var root = new Yoga.Node();
@@ -78,6 +82,10 @@ it("align_self_flex_end", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("align_self_flex_start", function () {
var root = new Yoga.Node();
@@ -112,6 +120,10 @@ it("align_self_flex_start", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("align_self_flex_end_override_flex_start", function () {
var root = new Yoga.Node();
@@ -147,4 +159,8 @@ it("align_self_flex_end_override_flex_start", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGBorderTest.js b/javascript/tests/Facebook.Yoga/YGBorderTest.js
index ed42aac..caf5dc6 100644
--- a/javascript/tests/Facebook.Yoga/YGBorderTest.js
+++ b/javascript/tests/Facebook.Yoga/YGBorderTest.js
@@ -30,6 +30,10 @@ it("border_no_size", function () {
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop()");
console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth()");
console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("border_container_match_child", function () {
var root = new Yoga.Node();
@@ -65,6 +69,10 @@ it("border_container_match_child", function () {
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("border_flex_child", function () {
var root = new Yoga.Node();
@@ -102,6 +110,10 @@ it("border_flex_child", function () {
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("border_stretch_child", function () {
var root = new Yoga.Node();
@@ -138,6 +150,10 @@ it("border_stretch_child", function () {
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop()");
console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("border_center_child", function () {
var root = new Yoga.Node();
@@ -176,4 +192,8 @@ it("border_center_child", function () {
console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js b/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js
index 7be63ae..75b3093 100644
--- a/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js
+++ b/javascript/tests/Facebook.Yoga/YGFlexDirectionTest.js
@@ -69,6 +69,10 @@ it("flex_direction_column_no_height", function () {
console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop()");
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth()");
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_direction_row_no_width", function () {
var root = new Yoga.Node();
@@ -129,6 +133,10 @@ it("flex_direction_row_no_width", function () {
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop()");
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth()");
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_direction_column", function () {
var root = new Yoga.Node();
@@ -189,6 +197,10 @@ it("flex_direction_column", function () {
console.assert(20 === root_child2.getComputedTop(), "20 === root_child2.getComputedTop()");
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth()");
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_direction_row", function () {
var root = new Yoga.Node();
@@ -250,6 +262,10 @@ it("flex_direction_row", function () {
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop()");
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth()");
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_direction_column_reverse", function () {
var root = new Yoga.Node();
@@ -311,6 +327,10 @@ it("flex_direction_column_reverse", function () {
console.assert(70 === root_child2.getComputedTop(), "70 === root_child2.getComputedTop()");
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth()");
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_direction_row_reverse", function () {
var root = new Yoga.Node();
@@ -372,4 +392,8 @@ it("flex_direction_row_reverse", function () {
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop()");
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth()");
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGFlexTest.js b/javascript/tests/Facebook.Yoga/YGFlexTest.js
index 5960641..a897d6e 100644
--- a/javascript/tests/Facebook.Yoga/YGFlexTest.js
+++ b/javascript/tests/Facebook.Yoga/YGFlexTest.js
@@ -57,6 +57,10 @@ it("flex_basis_flex_grow_column", function () {
console.assert(75 === root_child1.getComputedTop(), "75 === root_child1.getComputedTop()");
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth()");
console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_basis_flex_grow_row", function () {
var root = new Yoga.Node();
@@ -105,6 +109,10 @@ it("flex_basis_flex_grow_row", function () {
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop()");
console.assert(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth()");
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_basis_flex_shrink_column", function () {
var root = new Yoga.Node();
@@ -152,6 +160,10 @@ it("flex_basis_flex_shrink_column", function () {
console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop()");
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth()");
console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_basis_flex_shrink_row", function () {
var root = new Yoga.Node();
@@ -200,6 +212,10 @@ it("flex_basis_flex_shrink_row", function () {
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop()");
console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth()");
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_shrink_to_zero", function () {
var root = new Yoga.Node();
@@ -263,6 +279,10 @@ it("flex_shrink_to_zero", function () {
console.assert(50 === root_child2.getComputedTop(), "50 === root_child2.getComputedTop()");
console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth()");
console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_basis_overrides_main_size", function () {
var root = new Yoga.Node();
@@ -327,6 +347,10 @@ it("flex_basis_overrides_main_size", function () {
console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop()");
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth()");
console.assert(20 === root_child2.getComputedHeight(), "20 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_grow_shrink_at_most", function () {
var root = new Yoga.Node();
@@ -373,4 +397,8 @@ it("flex_grow_shrink_at_most", function () {
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop()");
console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth()");
console.assert(0 === root_child0_child0.getComputedHeight(), "0 === root_child0_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js b/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js
index 0b70bee..5044d70 100644
--- a/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js
+++ b/javascript/tests/Facebook.Yoga/YGFlexWrapTest.js
@@ -88,6 +88,10 @@ it("wrap_column", function () {
console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop()");
console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth()");
console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("wrap_row", function () {
var root = new Yoga.Node();
@@ -167,6 +171,10 @@ it("wrap_row", function () {
console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop()");
console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth()");
console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("wrap_row_align_items_flex_end", function () {
var root = new Yoga.Node();
@@ -247,6 +255,10 @@ it("wrap_row_align_items_flex_end", function () {
console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop()");
console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth()");
console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("wrap_row_align_items_center", function () {
var root = new Yoga.Node();
@@ -327,4 +339,8 @@ it("wrap_row_align_items_center", function () {
console.assert(30 === root_child3.getComputedTop(), "30 === root_child3.getComputedTop()");
console.assert(30 === root_child3.getComputedWidth(), "30 === root_child3.getComputedWidth()");
console.assert(30 === root_child3.getComputedHeight(), "30 === root_child3.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js b/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js
index a498b9c..656d134 100644
--- a/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js
+++ b/javascript/tests/Facebook.Yoga/YGJustifyContentTest.js
@@ -71,6 +71,10 @@ it("justify_content_row_flex_start", function () {
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop()");
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth()");
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("justify_content_row_flex_end", function () {
var root = new Yoga.Node();
@@ -133,6 +137,10 @@ it("justify_content_row_flex_end", function () {
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop()");
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth()");
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("justify_content_row_center", function () {
var root = new Yoga.Node();
@@ -195,6 +203,10 @@ it("justify_content_row_center", function () {
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop()");
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth()");
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("justify_content_row_space_between", function () {
var root = new Yoga.Node();
@@ -257,6 +269,10 @@ it("justify_content_row_space_between", function () {
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop()");
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth()");
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("justify_content_row_space_around", function () {
var root = new Yoga.Node();
@@ -319,6 +335,10 @@ it("justify_content_row_space_around", function () {
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop()");
console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth()");
console.assert(102 === root_child2.getComputedHeight(), "102 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("justify_content_column_flex_start", function () {
var root = new Yoga.Node();
@@ -378,6 +398,10 @@ it("justify_content_column_flex_start", function () {
console.assert(10 === root_child2.getComputedTop(), "10 === root_child2.getComputedTop()");
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth()");
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("justify_content_column_flex_end", function () {
var root = new Yoga.Node();
@@ -439,6 +463,10 @@ it("justify_content_column_flex_end", function () {
console.assert(92 === root_child2.getComputedTop(), "92 === root_child2.getComputedTop()");
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth()");
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("justify_content_column_center", function () {
var root = new Yoga.Node();
@@ -500,6 +528,10 @@ it("justify_content_column_center", function () {
console.assert(56 === root_child2.getComputedTop(), "56 === root_child2.getComputedTop()");
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth()");
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("justify_content_column_space_between", function () {
var root = new Yoga.Node();
@@ -561,6 +593,10 @@ it("justify_content_column_space_between", function () {
console.assert(92 === root_child2.getComputedTop(), "92 === root_child2.getComputedTop()");
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth()");
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("justify_content_column_space_around", function () {
var root = new Yoga.Node();
@@ -622,4 +658,8 @@ it("justify_content_column_space_around", function () {
console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop()");
console.assert(102 === root_child2.getComputedWidth(), "102 === root_child2.getComputedWidth()");
console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGMarginTest.js b/javascript/tests/Facebook.Yoga/YGMarginTest.js
index f335ce5..cb08fb4 100644
--- a/javascript/tests/Facebook.Yoga/YGMarginTest.js
+++ b/javascript/tests/Facebook.Yoga/YGMarginTest.js
@@ -44,6 +44,10 @@ it("margin_start", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("margin_top", function () {
var root = new Yoga.Node();
@@ -77,6 +81,10 @@ it("margin_top", function () {
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop()");
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("margin_end", function () {
var root = new Yoga.Node();
@@ -112,6 +120,10 @@ it("margin_end", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("margin_bottom", function () {
var root = new Yoga.Node();
@@ -146,6 +158,10 @@ it("margin_bottom", function () {
console.assert(80 === root_child0.getComputedTop(), "80 === root_child0.getComputedTop()");
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("margin_and_flex_row", function () {
var root = new Yoga.Node();
@@ -180,6 +196,10 @@ it("margin_and_flex_row", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(90 === root_child0.getComputedWidth(), "90 === root_child0.getComputedWidth()");
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("margin_and_flex_column", function () {
var root = new Yoga.Node();
@@ -213,6 +233,10 @@ it("margin_and_flex_column", function () {
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop()");
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth()");
console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("margin_and_stretch_row", function () {
var root = new Yoga.Node();
@@ -247,6 +271,10 @@ it("margin_and_stretch_row", function () {
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop()");
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth()");
console.assert(90 === root_child0.getComputedHeight(), "90 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("margin_and_stretch_column", function () {
var root = new Yoga.Node();
@@ -280,6 +308,10 @@ it("margin_and_stretch_column", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(90 === root_child0.getComputedWidth(), "90 === root_child0.getComputedWidth()");
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("margin_with_sibling_row", function () {
var root = new Yoga.Node();
@@ -327,6 +359,10 @@ it("margin_with_sibling_row", function () {
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop()");
console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth()");
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("margin_with_sibling_column", function () {
var root = new Yoga.Node();
@@ -373,4 +409,8 @@ it("margin_with_sibling_column", function () {
console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop()");
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth()");
console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js b/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js
index d98dac9..f7b6c62 100644
--- a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js
+++ b/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js
@@ -26,4 +26,8 @@ it("measure_once_single_flexible_child", function () {
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(1 === measureCounter.get(), "1 === measureCounter.get()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGMeasureTest.js b/javascript/tests/Facebook.Yoga/YGMeasureTest.js
index e60dea6..96da030 100644
--- a/javascript/tests/Facebook.Yoga/YGMeasureTest.js
+++ b/javascript/tests/Facebook.Yoga/YGMeasureTest.js
@@ -24,4 +24,8 @@ it("dont_measure_single_grow_shrink_child", function () {
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
console.assert(0 === measureCounter.get(), "0 === measureCounter.get()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js b/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js
index 286bcba..28ed862 100644
--- a/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js
+++ b/javascript/tests/Facebook.Yoga/YGMinMaxDimensionTest.js
@@ -43,6 +43,10 @@ it("max_width", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(50 === root_child0.getComputedWidth(), "50 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("max_height", function () {
var root = new Yoga.Node();
@@ -77,6 +81,10 @@ it("max_height", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(50 === root_child0.getComputedHeight(), "50 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("min_height", function () {
var root = new Yoga.Node();
@@ -124,6 +132,10 @@ it("min_height", function () {
console.assert(80 === root_child1.getComputedTop(), "80 === root_child1.getComputedTop()");
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth()");
console.assert(20 === root_child1.getComputedHeight(), "20 === root_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("min_width", function () {
var root = new Yoga.Node();
@@ -172,6 +184,10 @@ it("min_width", function () {
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop()");
console.assert(20 === root_child1.getComputedWidth(), "20 === root_child1.getComputedWidth()");
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("justify_content_min_max", function () {
var root = new Yoga.Node();
@@ -207,6 +223,10 @@ it("justify_content_min_max", function () {
console.assert(20 === root_child0.getComputedTop(), "20 === root_child0.getComputedTop()");
console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth()");
console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("align_items_min_max", function () {
var root = new Yoga.Node();
@@ -242,6 +262,10 @@ it("align_items_min_max", function () {
console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop()");
console.assert(60 === root_child0.getComputedWidth(), "60 === root_child0.getComputedWidth()");
console.assert(60 === root_child0.getComputedHeight(), "60 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("justify_content_overflow_min_max", function () {
var root = new Yoga.Node();
@@ -306,6 +330,10 @@ it("justify_content_overflow_min_max", function () {
console.assert(80 === root_child2.getComputedTop(), "80 === root_child2.getComputedTop()");
console.assert(50 === root_child2.getComputedWidth(), "50 === root_child2.getComputedWidth()");
console.assert(50 === root_child2.getComputedHeight(), "50 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_grow_within_max_width", function () {
var root = new Yoga.Node();
@@ -354,6 +382,10 @@ it("flex_grow_within_max_width", function () {
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop()");
console.assert(100 === root_child0_child0.getComputedWidth(), "100 === root_child0_child0.getComputedWidth()");
console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_grow_within_constrained_max_width", function () {
var root = new Yoga.Node();
@@ -402,6 +434,10 @@ it("flex_grow_within_constrained_max_width", function () {
console.assert(0 === root_child0_child0.getComputedTop(), "0 === root_child0_child0.getComputedTop()");
console.assert(200 === root_child0_child0.getComputedWidth(), "200 === root_child0_child0.getComputedWidth()");
console.assert(20 === root_child0_child0.getComputedHeight(), "20 === root_child0_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_grow_within_constrained_min_row", function () {
var root = new Yoga.Node();
@@ -449,6 +485,10 @@ it("flex_grow_within_constrained_min_row", function () {
console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop()");
console.assert(50 === root_child1.getComputedWidth(), "50 === root_child1.getComputedWidth()");
console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_grow_within_constrained_min_column", function () {
var root = new Yoga.Node();
@@ -494,6 +534,10 @@ it("flex_grow_within_constrained_min_column", function () {
console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop()");
console.assert(0 === root_child1.getComputedWidth(), "0 === root_child1.getComputedWidth()");
console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_grow_within_constrained_max_row", function () {
var root = new Yoga.Node();
@@ -556,6 +600,10 @@ it("flex_grow_within_constrained_max_row", function () {
console.assert(0 === root_child0_child1.getComputedTop(), "0 === root_child0_child1.getComputedTop()");
console.assert(50 === root_child0_child1.getComputedWidth(), "50 === root_child0_child1.getComputedWidth()");
console.assert(100 === root_child0_child1.getComputedHeight(), "100 === root_child0_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("flex_grow_within_constrained_max_column", function () {
var root = new Yoga.Node();
@@ -603,4 +651,8 @@ it("flex_grow_within_constrained_max_column", function () {
console.assert(50 === root_child1.getComputedTop(), "50 === root_child1.getComputedTop()");
console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth()");
console.assert(50 === root_child1.getComputedHeight(), "50 === root_child1.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGPaddingTest.js b/javascript/tests/Facebook.Yoga/YGPaddingTest.js
index da15f09..e04ff9a 100644
--- a/javascript/tests/Facebook.Yoga/YGPaddingTest.js
+++ b/javascript/tests/Facebook.Yoga/YGPaddingTest.js
@@ -30,6 +30,10 @@ it("padding_no_size", function () {
console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop()");
console.assert(20 === root.getComputedWidth(), "20 === root.getComputedWidth()");
console.assert(20 === root.getComputedHeight(), "20 === root.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("padding_container_match_child", function () {
var root = new Yoga.Node();
@@ -65,6 +69,10 @@ it("padding_container_match_child", function () {
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("padding_flex_child", function () {
var root = new Yoga.Node();
@@ -102,6 +110,10 @@ it("padding_flex_child", function () {
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(80 === root_child0.getComputedHeight(), "80 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("padding_stretch_child", function () {
var root = new Yoga.Node();
@@ -138,6 +150,10 @@ it("padding_stretch_child", function () {
console.assert(10 === root_child0.getComputedTop(), "10 === root_child0.getComputedTop()");
console.assert(80 === root_child0.getComputedWidth(), "80 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("padding_center_child", function () {
var root = new Yoga.Node();
@@ -176,6 +192,10 @@ it("padding_center_child", function () {
console.assert(35 === root_child0.getComputedTop(), "35 === root_child0.getComputedTop()");
console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth()");
console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
it("child_with_padding_align_end", function () {
var root = new Yoga.Node();
@@ -215,4 +235,8 @@ it("child_with_padding_align_end", function () {
console.assert(100 === root_child0.getComputedTop(), "100 === root_child0.getComputedTop()");
console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth()");
console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
});
diff --git a/javascript/tests/Facebook.Yoga/YGRoundingTest.js b/javascript/tests/Facebook.Yoga/YGRoundingTest.js
index 3dbf7ff..5a7cf43 100644
--- a/javascript/tests/Facebook.Yoga/YGRoundingTest.js
+++ b/javascript/tests/Facebook.Yoga/YGRoundingTest.js
@@ -73,6 +73,10 @@ it("rounding_flex_basis_flex_grow_row_width_of_100", function () {
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop()");
console.assert(33 === root_child2.getComputedWidth(), "33 === root_child2.getComputedWidth()");
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
Yoga.setExperimentalFeatureEnabled(Yoga.FEATURE_ROUNDING, false);
});
@@ -166,6 +170,10 @@ it("rounding_flex_basis_flex_grow_row_prime_number_width", function () {
console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop()");
console.assert(23 === root_child4.getComputedWidth(), "23 === root_child4.getComputedWidth()");
console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
Yoga.setExperimentalFeatureEnabled(Yoga.FEATURE_ROUNDING, false);
});
@@ -232,6 +240,10 @@ it("rounding_flex_basis_flex_shrink_row", function () {
console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop()");
console.assert(25 === root_child2.getComputedWidth(), "25 === root_child2.getComputedWidth()");
console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
Yoga.setExperimentalFeatureEnabled(Yoga.FEATURE_ROUNDING, false);
});
@@ -300,6 +312,10 @@ it("rounding_flex_basis_overrides_main_size", function () {
console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop()");
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth()");
console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
Yoga.setExperimentalFeatureEnabled(Yoga.FEATURE_ROUNDING, false);
});
@@ -368,6 +384,10 @@ it("rounding_total_fractial", function () {
console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop()");
console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth()");
console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
Yoga.setExperimentalFeatureEnabled(Yoga.FEATURE_ROUNDING, false);
});
@@ -470,6 +490,10 @@ it("rounding_total_fractial_nested", function () {
console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop()");
console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth()");
console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
Yoga.setExperimentalFeatureEnabled(Yoga.FEATURE_ROUNDING, false);
});
@@ -538,6 +562,10 @@ it("rounding_fractial_input_1", function () {
console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop()");
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth()");
console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
Yoga.setExperimentalFeatureEnabled(Yoga.FEATURE_ROUNDING, false);
});
@@ -606,6 +634,10 @@ it("rounding_fractial_input_2", function () {
console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop()");
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth()");
console.assert(25 === root_child2.getComputedHeight(), "25 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
Yoga.setExperimentalFeatureEnabled(Yoga.FEATURE_ROUNDING, false);
});
@@ -675,6 +707,10 @@ it("rounding_fractial_input_3", function () {
console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop()");
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth()");
console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
Yoga.setExperimentalFeatureEnabled(Yoga.FEATURE_ROUNDING, false);
});
@@ -744,6 +780,10 @@ it("rounding_fractial_input_4", function () {
console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop()");
console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth()");
console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight()");
+ console.log('before instanceCount', Yoga.instanceCount());
+ root.disposeRecursive();
+ console.log('after instanceCount', Yoga.instanceCount());
+ console.assert(0 === Yoga.instanceCount());
Yoga.setExperimentalFeatureEnabled(Yoga.FEATURE_ROUNDING, false);
});
diff --git a/javascript/yarn.lock b/javascript/yarn.lock
index cad2c66..35ed683 100644
--- a/javascript/yarn.lock
+++ b/javascript/yarn.lock
@@ -1216,17 +1216,17 @@ [email protected]:
version "0.7.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098"
-nan@^2.3.0, nan@^2.4.0:
+nan@^2.3.0, nan@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.0.tgz#aa8f1e34531d807e9e27755b234b4a6ec0c152a8"
-nbind@arcanis/nbind:
- version "0.3.7"
- resolved "https://codeload.github.com/arcanis/nbind/tar.gz/26eae81cbec9b697a25f20c48630e7a6b4275498"
+nbind@^0.3.8:
+ version "0.3.8"
+ resolved "https://registry.yarnpkg.com/nbind/-/nbind-0.3.8.tgz#87dc038e88f7107734cf3ee1090782bbf9ac51e3"
dependencies:
emscripten-library-decorator "~0.2.0"
mkdirp "~0.5.1"
- nan "^2.4.0"
+ nan "^2.5.0"
node-gyp@^3.4.0:
version "3.4.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment