Fix tests of splitted config feature
Summary: The following PR fixes the tests used in the javascript port (it modifies gentest.rb). These changes don't yet pass, it seems something is segfaulting somewhere. I have to check if it comes from nbind, the yoga library, or the node bridge itself. There's also some fails on the browser build, but it might be the same issue. Closes https://github.com/facebook/yoga/pull/487 Reviewed By: emilsjolander Differential Revision: D4778870 Pulled By: astreet fbshipit-source-id: 936fbca564ec89738c78e50c4402c53eb6867dec
This commit is contained in:
committed by
Facebook Github Bot
parent
91a34bb875
commit
36f6fa9861
@@ -169,6 +169,22 @@ module.exports = function (bind, lib) {
|
||||
|
||||
}
|
||||
|
||||
patch(lib.Config.prototype, `free`, function () {
|
||||
|
||||
// Since we handle the memory allocation ourselves (via lib.Config.create), we also need to handle the deallocation
|
||||
|
||||
lib.Config.destroy(this);
|
||||
|
||||
});
|
||||
|
||||
patch(lib.Node, `create`, function (_, config) {
|
||||
|
||||
// We decide the constructor we want to call depending on the parameters
|
||||
|
||||
return config ? lib.Node.createWithConfig(config) : lib.Node.createDefault();
|
||||
|
||||
});
|
||||
|
||||
patch(lib.Node.prototype, `free`, function () {
|
||||
|
||||
// Since we handle the memory allocation ourselves (via lib.Node.create), we also need to handle the deallocation
|
||||
@@ -207,18 +223,6 @@ module.exports = function (bind, lib) {
|
||||
|
||||
});
|
||||
|
||||
function setExperimentalFeatureEnabled(... args) {
|
||||
|
||||
return lib.setExperimentalFeatureEnabled(... args);
|
||||
|
||||
}
|
||||
|
||||
function isExperimentalFeatureEnabled(... args) {
|
||||
|
||||
return lib.isExperimentalFeatureEnabled(... args);
|
||||
|
||||
}
|
||||
|
||||
function getInstanceCount(... args) {
|
||||
|
||||
return lib.getInstanceCount(... args);
|
||||
@@ -231,15 +235,13 @@ module.exports = function (bind, lib) {
|
||||
|
||||
return Object.assign({
|
||||
|
||||
Config: lib.Config,
|
||||
Node: lib.Node,
|
||||
|
||||
Layout,
|
||||
Size,
|
||||
Value,
|
||||
|
||||
setExperimentalFeatureEnabled,
|
||||
isExperimentalFeatureEnabled,
|
||||
|
||||
getInstanceCount
|
||||
|
||||
}, constants);
|
||||
|
Reference in New Issue
Block a user