From adff8d96dd8c0264202c34672c6dee8c0925445c Mon Sep 17 00:00:00 2001 From: Sidharth Guglani Date: Wed, 31 Jul 2019 06:38:30 -0700 Subject: [PATCH] remove getInstanceCount usages Summary: This diffs removes the usages of getInstanceCount as it has been removed from yoga. We will add event support in js later to handle these test cases Reviewed By: davidaurelio Differential Revision: D16560269 fbshipit-source-id: 52590c426faf87209f8635602b401fd5760af8ab --- javascript/binding.gyp | 1 - javascript/sources/entry-common.js | 3 --- javascript/sources/global.hh | 9 --------- javascript/sources/nbind.cc | 5 ----- javascript/tests/Facebook.Yoga/YGComputedBorderTest.js | 2 +- javascript/tests/Facebook.Yoga/YGComputedMarginTest.js | 2 +- javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js | 2 +- javascript/tests/Facebook.Yoga/YGDirtiedTest.js | 8 ++++---- javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js | 2 +- javascript/tests/Facebook.Yoga/YGMeasureTest.js | 2 +- 10 files changed, 9 insertions(+), 27 deletions(-) delete mode 100644 javascript/sources/global.hh diff --git a/javascript/binding.gyp b/javascript/binding.gyp index 6f72fb61..da48de18 100644 --- a/javascript/binding.gyp +++ b/javascript/binding.gyp @@ -10,7 +10,6 @@ " { Layout: bind('Layout', Layout), Size: bind('Size', Size), Value: bind('Value', Value), - getInstanceCount(...args) { - return lib.getInstanceCount(...args); - }, ...CONSTANTS, }; }; diff --git a/javascript/sources/global.hh b/javascript/sources/global.hh deleted file mode 100644 index ea9d476b..00000000 --- a/javascript/sources/global.hh +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the LICENSE - * file in the root directory of this source tree. - */ -#pragma once - -unsigned getInstanceCount(void); diff --git a/javascript/sources/nbind.cc b/javascript/sources/nbind.cc index 5a6b459f..5b51bdcf 100644 --- a/javascript/sources/nbind.cc +++ b/javascript/sources/nbind.cc @@ -11,14 +11,9 @@ #include "./Size.hh" #include "./Value.hh" #include "./Config.hh" -#include "./global.hh" #include -NBIND_GLOBAL() { - function(getInstanceCount); -} - NBIND_CLASS(Size) { construct<>(); construct(); diff --git a/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js b/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js index 3e585d0b..4ee0f48d 100644 --- a/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js +++ b/javascript/tests/Facebook.Yoga/YGComputedBorderTest.js @@ -27,5 +27,5 @@ it("border_start", function () { root.freeRecursive(); (typeof gc !== "undefined") && gc(); - console.assert(0 === Yoga.getInstanceCount(), "0 === Yoga.getInstanceCount() (" + Yoga.getInstanceCount() + ")"); + // TODO Add event support in js and check instace allocation and de allocation using that }); diff --git a/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js b/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js index 0a40bbb4..c25cdb0f 100644 --- a/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js +++ b/javascript/tests/Facebook.Yoga/YGComputedMarginTest.js @@ -27,5 +27,5 @@ it("margin_start", function () { root.freeRecursive(); (typeof gc !== "undefined") && gc(); - console.assert(0 === Yoga.getInstanceCount(), "0 === Yoga.getInstanceCount() (" + Yoga.getInstanceCount() + ")"); + // TODO Add event support in js and check instace allocation and de allocation using that }); diff --git a/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js b/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js index deaf0e01..daca4aa4 100644 --- a/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js +++ b/javascript/tests/Facebook.Yoga/YGComputedPaddingTest.js @@ -27,5 +27,5 @@ it("padding_start", function () { root.freeRecursive(); (typeof gc !== "undefined") && gc(); - console.assert(0 === Yoga.getInstanceCount(), "0 === Yoga.getInstanceCount() (" + Yoga.getInstanceCount() + ")"); + // TODO Add event support in js and check instace allocation and de allocation using that }); diff --git a/javascript/tests/Facebook.Yoga/YGDirtiedTest.js b/javascript/tests/Facebook.Yoga/YGDirtiedTest.js index 20320c43..c920c514 100644 --- a/javascript/tests/Facebook.Yoga/YGDirtiedTest.js +++ b/javascript/tests/Facebook.Yoga/YGDirtiedTest.js @@ -34,7 +34,7 @@ it("dirtied", function() { root.freeRecursive(); typeof gc !== "undefined" && gc(); - console.assert(0 === Yoga.getInstanceCount(), "0 === Yoga.getInstanceCount() (" + Yoga.getInstanceCount() + ")"); + // TODO Add event support in js and check instace allocation and de allocation using that }); it("dirtied_propagation", function() { @@ -75,7 +75,7 @@ it("dirtied_propagation", function() { root.freeRecursive(); typeof gc !== "undefined" && gc(); - console.assert(0 === Yoga.getInstanceCount(), "0 === Yoga.getInstanceCount() (" + Yoga.getInstanceCount() + ")"); + // TODO Add event support in js and check instace allocation and de allocation using that }); it("dirtied_hierarchy", function() { @@ -122,7 +122,7 @@ it("dirtied_hierarchy", function() { root.freeRecursive(); typeof gc !== "undefined" && gc(); - console.assert(0 === Yoga.getInstanceCount(), "0 === Yoga.getInstanceCount() (" + Yoga.getInstanceCount() + ")"); + // TODO Add event support in js and check instace allocation and de allocation using that }); it("dirtied_reset", function() { @@ -164,5 +164,5 @@ it("dirtied_reset", function() { root.freeRecursive(); typeof gc !== "undefined" && gc(); - console.assert(0 === Yoga.getInstanceCount(), "0 === Yoga.getInstanceCount() (" + Yoga.getInstanceCount() + ")"); + // TODO Add event support in js and check instace allocation and de allocation using that }); diff --git a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js b/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js index 3bd578da..4a19e2a6 100644 --- a/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js +++ b/javascript/tests/Facebook.Yoga/YGMeasureCacheTest.js @@ -29,5 +29,5 @@ it("measure_once_single_flexible_child", function () { root.freeRecursive(); (typeof gc !== "undefined") && gc(); - console.assert(0 === Yoga.getInstanceCount(), "0 === Yoga.getInstanceCount() (" + Yoga.getInstanceCount() + ")"); + // TODO Add event support in js and check instace allocation and de allocation using that }); diff --git a/javascript/tests/Facebook.Yoga/YGMeasureTest.js b/javascript/tests/Facebook.Yoga/YGMeasureTest.js index bb3b3c37..186f842b 100644 --- a/javascript/tests/Facebook.Yoga/YGMeasureTest.js +++ b/javascript/tests/Facebook.Yoga/YGMeasureTest.js @@ -27,5 +27,5 @@ it("dont_measure_single_grow_shrink_child", function () { root.freeRecursive(); (typeof gc !== "undefined") && gc(); - console.assert(0 === Yoga.getInstanceCount(), "0 === Yoga.getInstanceCount() (" + Yoga.getInstanceCount() + ")"); + // TODO Add event support in js and check instace allocation and de allocation using that });