diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js index ebcf7180..2b005aad 100644 --- a/gentest/gentest-javascript.js +++ b/gentest/gentest-javascript.js @@ -33,7 +33,7 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { emitPrologue:{value:function() {}}, emitTestPrologue:{value:function(name, experiments) { - this.push('test(' + JSON.stringify(name) + ', function () {'); + this.push('test(' + JSON.stringify(name) + ', () => {'); this.pushIndent(); this.push('const config = Yoga.Config.create();'); this.push('let root;'); diff --git a/javascript/.eslintrc.js b/javascript/.eslintrc.js index 1c27cf59..9a11938b 100644 --- a/javascript/.eslintrc.js +++ b/javascript/.eslintrc.js @@ -8,17 +8,25 @@ */ module.exports = { + ignorePatterns: ["dist/**"], + parser: "@babel/eslint-parser", extends: [ "eslint:recommended", "plugin:jest/recommended", "plugin:prettier/recommended", ], - parser: "@babel/eslint-parser", + rules: { + "no-var": "error", + "prefer-arrow-callback": "error", + "prefer-const": "error", + "prefer-object-spread": "error", + "prefer-spread": "error", + "require-await": "error", + }, env: { commonjs: true, es6: true, }, - ignorePatterns: ["dist/**"], overrides: [ { files: ["jest.*", "tests/**"], diff --git a/javascript/CMakeLists.txt b/javascript/CMakeLists.txt index 00757fad..08e8ba34 100644 --- a/javascript/CMakeLists.txt +++ b/javascript/CMakeLists.txt @@ -16,7 +16,10 @@ include_directories(..) set(CXX_STANDARD, 11) -set(EMCC_FLAGS +add_compile_definitions( + EMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0) + +set(COMPILE_OPTIONS -flto -fno-exceptions -fno-rtti @@ -24,13 +27,10 @@ set(EMCC_FLAGS -Os "SHELL:-s STRICT=1") -add_compile_options( - ${EMCC_FLAGS} - -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 - -std=c++11) +add_compile_options(${COMPILE_OPTIONS}) add_link_options( - ${EMCC_FLAGS} + ${COMPILE_OPTIONS} --closure 1 --memory-init-file 0 --no-entry diff --git a/javascript/src_js/wrapAsm.js b/javascript/src_js/wrapAsm.js index 4112b635..3c03269f 100644 --- a/javascript/src_js/wrapAsm.js +++ b/javascript/src_js/wrapAsm.js @@ -11,14 +11,14 @@ const CONSTANTS = require("./generated/YGEnums"); module.exports = (lib) => { function patch(prototype, name, fn) { - let original = prototype[name]; + const original = prototype[name]; prototype[name] = function (...args) { return fn.call(this, original, ...args); }; } - for (let fnName of [ + for (const fnName of [ "setPosition", "setMargin", "setFlexBasis", @@ -30,7 +30,7 @@ module.exports = (lib) => { "setMaxHeight", "setPadding", ]) { - let methods = { + const methods = { [CONSTANTS.UNIT_POINT]: lib.Node.prototype[fnName], [CONSTANTS.UNIT_PERCENT]: lib.Node.prototype[`${fnName}Percent`], [CONSTANTS.UNIT_AUTO]: lib.Node.prototype[`${fnName}Auto`], @@ -40,7 +40,7 @@ module.exports = (lib) => { // We patch all these functions to add support for the following calls: // .setWidth(100) / .setWidth("100%") / .setWidth(.getWidth()) / .setWidth("auto") - let value = args.pop(); + const value = args.pop(); let unit, asNumber; if (value === "auto") { @@ -95,7 +95,7 @@ module.exports = (lib) => { lib.Config.destroy(this); }); - patch(lib.Node, "create", function (_, config) { + patch(lib.Node, "create", (_, config) => { // We decide the constructor we want to call depending on the parameters return config ? lib.Node.createWithConfig(config) diff --git a/javascript/tests/Benchmarks/YGBenchmark.test.js b/javascript/tests/Benchmarks/YGBenchmark.test.js index 01192002..5ca47071 100644 --- a/javascript/tests/Benchmarks/YGBenchmark.test.js +++ b/javascript/tests/Benchmarks/YGBenchmark.test.js @@ -8,14 +8,14 @@ const ITERATIONS = 2000; const YGBENCHMARK = global.YGBENCHMARK ?? global.test; -YGBENCHMARK("Stack with flex", function () { - var root = Yoga.Node.create(); +YGBENCHMARK("Stack with flex", () => { + const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); - var measureCounter = getMeasureCounter(Yoga); + const measureCounter = getMeasureCounter(Yoga); - for (var i = 0; i < ITERATIONS; i++) { + for (let i = 0; i < ITERATIONS; i++) { const child = Yoga.Node.create(); child.setMeasureFunc(measureCounter.inc); child.setFlex(1); @@ -26,13 +26,13 @@ YGBENCHMARK("Stack with flex", function () { root.freeRecursive(); }); -YGBENCHMARK("Align stretch in undefined axis", function () { - var root = Yoga.Node.create(); +YGBENCHMARK("Align stretch in undefined axis", () => { + const root = Yoga.Node.create(); - var measureCounter = getMeasureCounter(Yoga); + const measureCounter = getMeasureCounter(Yoga); - for (var i = 0; i < ITERATIONS; i++) { - var child = Yoga.Node.create(); + for (let i = 0; i < ITERATIONS; i++) { + const child = Yoga.Node.create(); child.setMeasureFunc(measureCounter.inc); child.setHeight(20); root.insertChild(child, 0); @@ -42,20 +42,20 @@ YGBENCHMARK("Align stretch in undefined axis", function () { root.freeRecursive(); }); -YGBENCHMARK("Nested flex", function () { - var root = Yoga.Node.create(); +YGBENCHMARK("Nested flex", () => { + const root = Yoga.Node.create(); - var measureCounter = getMeasureCounter(Yoga); + const measureCounter = getMeasureCounter(Yoga); - var iterations = Math.pow(ITERATIONS, 1 / 2); + const iterations = Math.pow(ITERATIONS, 1 / 2); - for (var i = 0; i < iterations; i++) { - var child = Yoga.Node.create(); + for (let i = 0; i < iterations; i++) { + const child = Yoga.Node.create(); child.setFlex(1); root.insertChild(child, 0); - for (var ii = 0; ii < iterations; ii++) { - var grandChild = Yoga.Node.create(); + for (let ii = 0; ii < iterations; ii++) { + const grandChild = Yoga.Node.create(); grandChild.setMeasureFunc(measureCounter.inc); grandChild.setFlex(1); child.insertChild(grandChild, 0); @@ -66,35 +66,35 @@ YGBENCHMARK("Nested flex", function () { root.freeRecursive(); }); -YGBENCHMARK("Huge nested layout", function () { - var root = Yoga.Node.create(); +YGBENCHMARK("Huge nested layout", () => { + const root = Yoga.Node.create(); - var iterations = Math.pow(ITERATIONS, 1 / 4); + const iterations = Math.pow(ITERATIONS, 1 / 4); - for (var i = 0; i < iterations; i++) { - var child = Yoga.Node.create(); + for (let i = 0; i < iterations; i++) { + const child = Yoga.Node.create(); child.setFlexGrow(1); child.setWidth(10); child.setHeight(10); root.insertChild(child, 0); - for (var ii = 0; ii < iterations; ii++) { - var grandChild = Yoga.Node.create(); + for (let ii = 0; ii < iterations; ii++) { + const grandChild = Yoga.Node.create(); grandChild.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); grandChild.setFlexGrow(1); grandChild.setWidth(10); grandChild.setHeight(10); child.insertChild(grandChild, 0); - for (var iii = 0; iii < iterations; iii++) { - var grandGrandChild = Yoga.Node.create(); + for (let iii = 0; iii < iterations; iii++) { + const grandGrandChild = Yoga.Node.create(); grandGrandChild.setFlexGrow(1); grandGrandChild.setWidth(10); grandGrandChild.setHeight(10); grandChild.insertChild(grandGrandChild, 0); - for (var iiii = 0; iiii < iterations; iiii++) { - var grandGrandGrandChild = Yoga.Node.create(); + for (let iiii = 0; iiii < iterations; iiii++) { + const grandGrandGrandChild = Yoga.Node.create(); grandGrandGrandChild.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); grandGrandGrandChild.setFlexGrow(1); grandGrandGrandChild.setWidth(10); diff --git a/javascript/tests/YGAlignBaselineTest.test.js b/javascript/tests/YGAlignBaselineTest.test.js index 01c09837..6c99fa74 100644 --- a/javascript/tests/YGAlignBaselineTest.test.js +++ b/javascript/tests/YGAlignBaselineTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("align_baseline_parent_using_child_in_column_as_reference", function () { +test("align_baseline_parent_using_child_in_column_as_reference", () => { const config = Yoga.Config.create(); let root; @@ -63,7 +63,7 @@ test("align_baseline_parent_using_child_in_column_as_reference", function () { } }); -test("align_baseline_parent_using_child_in_row_as_reference", function () { +test("align_baseline_parent_using_child_in_row_as_reference", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/YGComputedBorderTest.test.js b/javascript/tests/YGComputedBorderTest.test.js index 37cb34c1..60445800 100644 --- a/javascript/tests/YGComputedBorderTest.test.js +++ b/javascript/tests/YGComputedBorderTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("border_start", function () { +test("border_start", () => { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/YGComputedMarginTest.test.js b/javascript/tests/YGComputedMarginTest.test.js index 056c2ed8..a2e54a42 100644 --- a/javascript/tests/YGComputedMarginTest.test.js +++ b/javascript/tests/YGComputedMarginTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("margin_start", function () { +test("margin_start", () => { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/YGComputedPaddingTest.test.js b/javascript/tests/YGComputedPaddingTest.test.js index 6292c6a4..cb538697 100644 --- a/javascript/tests/YGComputedPaddingTest.test.js +++ b/javascript/tests/YGComputedPaddingTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("padding_start", function () { +test("padding_start", () => { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/YGDirtiedTest.test.js b/javascript/tests/YGDirtiedTest.test.js index 8209ec7f..befcc0e3 100644 --- a/javascript/tests/YGDirtiedTest.test.js +++ b/javascript/tests/YGDirtiedTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("dirtied", function () { +test("dirtied", () => { const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); @@ -14,11 +14,11 @@ test("dirtied", function () { root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); let dirtied = 0; - root.setDirtiedFunc(function () { + root.setDirtiedFunc(() => { dirtied++; }); // only nodes with a measure function can be marked dirty - root.setMeasureFunc(function () {}); + root.setMeasureFunc(() => {}); expect(dirtied).toBe(0); @@ -33,7 +33,7 @@ test("dirtied", function () { root.freeRecursive(); }); -test("dirtied_propagation", function () { +test("dirtied_propagation", () => { const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); @@ -43,7 +43,7 @@ test("dirtied_propagation", function () { root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root_child0.setWidth(50); root_child0.setHeight(20); - root_child0.setMeasureFunc(function () {}); + root_child0.setMeasureFunc(() => {}); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(); @@ -55,7 +55,7 @@ test("dirtied_propagation", function () { root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); let dirtied = 0; - root.setDirtiedFunc(function () { + root.setDirtiedFunc(() => { dirtied++; }); @@ -72,7 +72,7 @@ test("dirtied_propagation", function () { root.freeRecursive(); }); -test("dirtied_hierarchy", function () { +test("dirtied_hierarchy", () => { const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); @@ -82,20 +82,20 @@ test("dirtied_hierarchy", function () { root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); root_child0.setWidth(50); root_child0.setHeight(20); - root_child0.setMeasureFunc(function () {}); + root_child0.setMeasureFunc(() => {}); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(); root_child1.setAlignItems(Yoga.ALIGN_FLEX_START); root_child1.setWidth(50); root_child1.setHeight(20); - root_child1.setMeasureFunc(function () {}); + root_child1.setMeasureFunc(() => {}); root.insertChild(root_child1, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); let dirtied = 0; - root_child0.setDirtiedFunc(function () { + root_child0.setDirtiedFunc(() => { dirtied++; }); @@ -115,17 +115,17 @@ test("dirtied_hierarchy", function () { root.freeRecursive(); }); -test("dirtied_reset", function () { +test("dirtied_reset", () => { const root = Yoga.Node.create(); root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - root.setMeasureFunc(function () {}); + root.setMeasureFunc(() => {}); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); let dirtied = 0; - root.setDirtiedFunc(function () { + root.setDirtiedFunc(() => { dirtied++; }); @@ -142,7 +142,7 @@ test("dirtied_reset", function () { root.setAlignItems(Yoga.ALIGN_FLEX_START); root.setWidth(100); root.setHeight(100); - root.setMeasureFunc(function () {}); + root.setMeasureFunc(() => {}); root.markDirty(); diff --git a/javascript/tests/YGMeasureCacheTest.test.js b/javascript/tests/YGMeasureCacheTest.test.js index 7c3f9af1..08c4e485 100644 --- a/javascript/tests/YGMeasureCacheTest.test.js +++ b/javascript/tests/YGMeasureCacheTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("measure_once_single_flexible_child", function () { +test("measure_once_single_flexible_child", () => { const root = Yoga.Node.create(); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setAlignItems(Yoga.ALIGN_FLEX_START); diff --git a/javascript/tests/YGMeasureTest.test.js b/javascript/tests/YGMeasureTest.test.js index 3aa674f7..d222af6f 100644 --- a/javascript/tests/YGMeasureTest.test.js +++ b/javascript/tests/YGMeasureTest.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -test("dont_measure_single_grow_shrink_child", function () { +test("dont_measure_single_grow_shrink_child", () => { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); diff --git a/javascript/tests/generated/YGAbsolutePositionTest.test.js b/javascript/tests/generated/YGAbsolutePositionTest.test.js index be782df6..7cd75cc1 100644 --- a/javascript/tests/generated/YGAbsolutePositionTest.test.js +++ b/javascript/tests/generated/YGAbsolutePositionTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html -test("absolute_layout_width_height_start_top", function () { +test("absolute_layout_width_height_start_top", () => { const config = Yoga.Config.create(); let root; @@ -54,7 +54,7 @@ test("absolute_layout_width_height_start_top", function () { config.free(); } }); -test("absolute_layout_width_height_end_bottom", function () { +test("absolute_layout_width_height_end_bottom", () => { const config = Yoga.Config.create(); let root; @@ -101,7 +101,7 @@ test("absolute_layout_width_height_end_bottom", function () { config.free(); } }); -test("absolute_layout_start_top_end_bottom", function () { +test("absolute_layout_start_top_end_bottom", () => { const config = Yoga.Config.create(); let root; @@ -148,7 +148,7 @@ test("absolute_layout_start_top_end_bottom", function () { config.free(); } }); -test("absolute_layout_width_height_start_top_end_bottom", function () { +test("absolute_layout_width_height_start_top_end_bottom", () => { const config = Yoga.Config.create(); let root; @@ -197,7 +197,7 @@ test("absolute_layout_width_height_start_top_end_bottom", function () { config.free(); } }); -test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", function () { +test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", () => { const config = Yoga.Config.create(); let root; @@ -259,7 +259,7 @@ test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_pare config.free(); } }); -test("absolute_layout_within_border", function () { +test("absolute_layout_within_border", () => { const config = Yoga.Config.create(); let root; @@ -380,7 +380,7 @@ test("absolute_layout_within_border", function () { config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center", function () { +test("absolute_layout_align_items_and_justify_content_center", () => { const config = Yoga.Config.create(); let root; @@ -428,7 +428,7 @@ test("absolute_layout_align_items_and_justify_content_center", function () { config.free(); } }); -test("absolute_layout_align_items_and_justify_content_flex_end", function () { +test("absolute_layout_align_items_and_justify_content_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -476,7 +476,7 @@ test("absolute_layout_align_items_and_justify_content_flex_end", function () { config.free(); } }); -test("absolute_layout_justify_content_center", function () { +test("absolute_layout_justify_content_center", () => { const config = Yoga.Config.create(); let root; @@ -523,7 +523,7 @@ test("absolute_layout_justify_content_center", function () { config.free(); } }); -test("absolute_layout_align_items_center", function () { +test("absolute_layout_align_items_center", () => { const config = Yoga.Config.create(); let root; @@ -570,7 +570,7 @@ test("absolute_layout_align_items_center", function () { config.free(); } }); -test("absolute_layout_align_items_center_on_child_only", function () { +test("absolute_layout_align_items_center_on_child_only", () => { const config = Yoga.Config.create(); let root; @@ -617,7 +617,7 @@ test("absolute_layout_align_items_center_on_child_only", function () { config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center_and_top_position", function () { +test("absolute_layout_align_items_and_justify_content_center_and_top_position", () => { const config = Yoga.Config.create(); let root; @@ -666,7 +666,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_top_position", config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center_and_bottom_position", function () { +test("absolute_layout_align_items_and_justify_content_center_and_bottom_position", () => { const config = Yoga.Config.create(); let root; @@ -715,7 +715,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_bottom_position config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center_and_left_position", function () { +test("absolute_layout_align_items_and_justify_content_center_and_left_position", () => { const config = Yoga.Config.create(); let root; @@ -764,7 +764,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_left_position", config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center_and_right_position", function () { +test("absolute_layout_align_items_and_justify_content_center_and_right_position", () => { const config = Yoga.Config.create(); let root; @@ -813,7 +813,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_right_position" config.free(); } }); -test("position_root_with_rtl_should_position_withoutdirection", function () { +test("position_root_with_rtl_should_position_withoutdirection", () => { const config = Yoga.Config.create(); let root; @@ -843,7 +843,7 @@ test("position_root_with_rtl_should_position_withoutdirection", function () { config.free(); } }); -test("absolute_layout_percentage_bottom_based_on_parent_height", function () { +test("absolute_layout_percentage_bottom_based_on_parent_height", () => { const config = Yoga.Config.create(); let root; @@ -923,7 +923,7 @@ test("absolute_layout_percentage_bottom_based_on_parent_height", function () { config.free(); } }); -test("absolute_layout_in_wrap_reverse_column_container", function () { +test("absolute_layout_in_wrap_reverse_column_container", () => { const config = Yoga.Config.create(); let root; @@ -969,7 +969,7 @@ test("absolute_layout_in_wrap_reverse_column_container", function () { config.free(); } }); -test("absolute_layout_in_wrap_reverse_row_container", function () { +test("absolute_layout_in_wrap_reverse_row_container", () => { const config = Yoga.Config.create(); let root; @@ -1016,7 +1016,7 @@ test("absolute_layout_in_wrap_reverse_row_container", function () { config.free(); } }); -test("absolute_layout_in_wrap_reverse_column_container_flex_end", function () { +test("absolute_layout_in_wrap_reverse_column_container_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -1063,7 +1063,7 @@ test("absolute_layout_in_wrap_reverse_column_container_flex_end", function () { config.free(); } }); -test("absolute_layout_in_wrap_reverse_row_container_flex_end", function () { +test("absolute_layout_in_wrap_reverse_row_container_flex_end", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGAlignContentTest.test.js b/javascript/tests/generated/YGAlignContentTest.test.js index 4454fd86..bd3ec73e 100644 --- a/javascript/tests/generated/YGAlignContentTest.test.js +++ b/javascript/tests/generated/YGAlignContentTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html -test("align_content_flex_start", function () { +test("align_content_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -113,7 +113,7 @@ test("align_content_flex_start", function () { config.free(); } }); -test("align_content_flex_start_without_height_on_children", function () { +test("align_content_flex_start_without_height_on_children", () => { const config = Yoga.Config.create(); let root; @@ -215,7 +215,7 @@ test("align_content_flex_start_without_height_on_children", function () { config.free(); } }); -test("align_content_flex_start_with_flex", function () { +test("align_content_flex_start_with_flex", () => { const config = Yoga.Config.create(); let root; @@ -323,7 +323,7 @@ test("align_content_flex_start_with_flex", function () { config.free(); } }); -test("align_content_flex_end", function () { +test("align_content_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -429,7 +429,7 @@ test("align_content_flex_end", function () { config.free(); } }); -test("align_content_stretch", function () { +test("align_content_stretch", () => { const config = Yoga.Config.create(); let root; @@ -530,7 +530,7 @@ test("align_content_stretch", function () { config.free(); } }); -test("align_content_spacebetween", function () { +test("align_content_spacebetween", () => { const config = Yoga.Config.create(); let root; @@ -637,7 +637,7 @@ test("align_content_spacebetween", function () { config.free(); } }); -test("align_content_spacearound", function () { +test("align_content_spacearound", () => { const config = Yoga.Config.create(); let root; @@ -744,7 +744,7 @@ test("align_content_spacearound", function () { config.free(); } }); -test("align_content_stretch_row", function () { +test("align_content_stretch_row", () => { const config = Yoga.Config.create(); let root; @@ -846,7 +846,7 @@ test("align_content_stretch_row", function () { config.free(); } }); -test("align_content_stretch_row_with_children", function () { +test("align_content_stretch_row_with_children", () => { const config = Yoga.Config.create(); let root; @@ -964,7 +964,7 @@ test("align_content_stretch_row_with_children", function () { config.free(); } }); -test("align_content_stretch_row_with_flex", function () { +test("align_content_stretch_row_with_flex", () => { const config = Yoga.Config.create(); let root; @@ -1072,7 +1072,7 @@ test("align_content_stretch_row_with_flex", function () { config.free(); } }); -test("align_content_stretch_row_with_flex_no_shrink", function () { +test("align_content_stretch_row_with_flex_no_shrink", () => { const config = Yoga.Config.create(); let root; @@ -1179,7 +1179,7 @@ test("align_content_stretch_row_with_flex_no_shrink", function () { config.free(); } }); -test("align_content_stretch_row_with_margin", function () { +test("align_content_stretch_row_with_margin", () => { const config = Yoga.Config.create(); let root; @@ -1289,7 +1289,7 @@ test("align_content_stretch_row_with_margin", function () { config.free(); } }); -test("align_content_stretch_row_with_padding", function () { +test("align_content_stretch_row_with_padding", () => { const config = Yoga.Config.create(); let root; @@ -1399,7 +1399,7 @@ test("align_content_stretch_row_with_padding", function () { config.free(); } }); -test("align_content_stretch_row_with_single_row", function () { +test("align_content_stretch_row_with_single_row", () => { const config = Yoga.Config.create(); let root; @@ -1459,7 +1459,7 @@ test("align_content_stretch_row_with_single_row", function () { config.free(); } }); -test("align_content_stretch_row_with_fixed_height", function () { +test("align_content_stretch_row_with_fixed_height", () => { const config = Yoga.Config.create(); let root; @@ -1562,7 +1562,7 @@ test("align_content_stretch_row_with_fixed_height", function () { config.free(); } }); -test("align_content_stretch_row_with_max_height", function () { +test("align_content_stretch_row_with_max_height", () => { const config = Yoga.Config.create(); let root; @@ -1665,7 +1665,7 @@ test("align_content_stretch_row_with_max_height", function () { config.free(); } }); -test("align_content_stretch_row_with_min_height", function () { +test("align_content_stretch_row_with_min_height", () => { const config = Yoga.Config.create(); let root; @@ -1768,7 +1768,7 @@ test("align_content_stretch_row_with_min_height", function () { config.free(); } }); -test("align_content_stretch_column", function () { +test("align_content_stretch_column", () => { const config = Yoga.Config.create(); let root; @@ -1888,7 +1888,7 @@ test("align_content_stretch_column", function () { config.free(); } }); -test("align_content_stretch_is_not_overriding_align_items", function () { +test("align_content_stretch_is_not_overriding_align_items", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGAlignItemsTest.test.js b/javascript/tests/generated/YGAlignItemsTest.test.js index a53702c7..4f27c016 100644 --- a/javascript/tests/generated/YGAlignItemsTest.test.js +++ b/javascript/tests/generated/YGAlignItemsTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html -test("align_items_stretch", function () { +test("align_items_stretch", () => { const config = Yoga.Config.create(); let root; @@ -50,7 +50,7 @@ test("align_items_stretch", function () { config.free(); } }); -test("align_items_center", function () { +test("align_items_center", () => { const config = Yoga.Config.create(); let root; @@ -95,7 +95,7 @@ test("align_items_center", function () { config.free(); } }); -test("align_items_flex_start", function () { +test("align_items_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -140,7 +140,7 @@ test("align_items_flex_start", function () { config.free(); } }); -test("align_items_flex_end", function () { +test("align_items_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -185,7 +185,7 @@ test("align_items_flex_end", function () { config.free(); } }); -test("align_baseline", function () { +test("align_baseline", () => { const config = Yoga.Config.create(); let root; @@ -246,7 +246,7 @@ test("align_baseline", function () { config.free(); } }); -test("align_baseline_child", function () { +test("align_baseline_child", () => { const config = Yoga.Config.create(); let root; @@ -322,7 +322,7 @@ test("align_baseline_child", function () { config.free(); } }); -test("align_baseline_child_multiline", function () { +test("align_baseline_child_multiline", () => { const config = Yoga.Config.create(); let root; @@ -445,7 +445,7 @@ test("align_baseline_child_multiline", function () { config.free(); } }); -test("align_baseline_child_multiline_override", function () { +test("align_baseline_child_multiline_override", () => { const config = Yoga.Config.create(); let root; @@ -570,7 +570,7 @@ test("align_baseline_child_multiline_override", function () { config.free(); } }); -test("align_baseline_child_multiline_no_override_on_secondline", function () { +test("align_baseline_child_multiline_no_override_on_secondline", () => { const config = Yoga.Config.create(); let root; @@ -694,7 +694,7 @@ test("align_baseline_child_multiline_no_override_on_secondline", function () { config.free(); } }); -test("align_baseline_child_top", function () { +test("align_baseline_child_top", () => { const config = Yoga.Config.create(); let root; @@ -771,7 +771,7 @@ test("align_baseline_child_top", function () { config.free(); } }); -test("align_baseline_child_top2", function () { +test("align_baseline_child_top2", () => { const config = Yoga.Config.create(); let root; @@ -848,7 +848,7 @@ test("align_baseline_child_top2", function () { config.free(); } }); -test("align_baseline_double_nested_child", function () { +test("align_baseline_double_nested_child", () => { const config = Yoga.Config.create(); let root; @@ -939,7 +939,7 @@ test("align_baseline_double_nested_child", function () { config.free(); } }); -test("align_baseline_column", function () { +test("align_baseline_column", () => { const config = Yoga.Config.create(); let root; @@ -999,7 +999,7 @@ test("align_baseline_column", function () { config.free(); } }); -test("align_baseline_child_margin", function () { +test("align_baseline_child_margin", () => { const config = Yoga.Config.create(); let root; @@ -1083,7 +1083,7 @@ test("align_baseline_child_margin", function () { config.free(); } }); -test("align_baseline_child_padding", function () { +test("align_baseline_child_padding", () => { const config = Yoga.Config.create(); let root; @@ -1167,7 +1167,7 @@ test("align_baseline_child_padding", function () { config.free(); } }); -test("align_baseline_multiline", function () { +test("align_baseline_multiline", () => { const config = Yoga.Config.create(); let root; @@ -1289,7 +1289,7 @@ test("align_baseline_multiline", function () { config.free(); } }); -test("align_baseline_multiline_column", function () { +test("align_baseline_multiline_column", () => { const config = Yoga.Config.create(); let root; @@ -1378,7 +1378,7 @@ test("align_baseline_multiline_column", function () { expect(root_child0.getComputedWidth()).toBe(50); expect(root_child0.getComputedHeight()).toBe(50); - expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedLeft()).toBe(70); expect(root_child1.getComputedTop()).toBe(50); expect(root_child1.getComputedWidth()).toBe(30); expect(root_child1.getComputedHeight()).toBe(50); @@ -1388,7 +1388,7 @@ test("align_baseline_multiline_column", function () { expect(root_child1_child0.getComputedWidth()).toBe(20); expect(root_child1_child0.getComputedHeight()).toBe(20); - expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedLeft()).toBe(10); expect(root_child2.getComputedTop()).toBe(0); expect(root_child2.getComputedWidth()).toBe(40); expect(root_child2.getComputedHeight()).toBe(70); @@ -1410,7 +1410,7 @@ test("align_baseline_multiline_column", function () { config.free(); } }); -test("align_baseline_multiline_column2", function () { +test("align_baseline_multiline_column2", () => { const config = Yoga.Config.create(); let root; @@ -1499,7 +1499,7 @@ test("align_baseline_multiline_column2", function () { expect(root_child0.getComputedWidth()).toBe(50); expect(root_child0.getComputedHeight()).toBe(50); - expect(root_child1.getComputedLeft()).toBe(50); + expect(root_child1.getComputedLeft()).toBe(70); expect(root_child1.getComputedTop()).toBe(50); expect(root_child1.getComputedWidth()).toBe(30); expect(root_child1.getComputedHeight()).toBe(50); @@ -1509,7 +1509,7 @@ test("align_baseline_multiline_column2", function () { expect(root_child1_child0.getComputedWidth()).toBe(20); expect(root_child1_child0.getComputedHeight()).toBe(20); - expect(root_child2.getComputedLeft()).toBe(0); + expect(root_child2.getComputedLeft()).toBe(10); expect(root_child2.getComputedTop()).toBe(0); expect(root_child2.getComputedWidth()).toBe(40); expect(root_child2.getComputedHeight()).toBe(70); @@ -1531,7 +1531,7 @@ test("align_baseline_multiline_column2", function () { config.free(); } }); -test("align_baseline_multiline_row_and_column", function () { +test("align_baseline_multiline_row_and_column", () => { const config = Yoga.Config.create(); let root; @@ -1653,7 +1653,7 @@ test("align_baseline_multiline_row_and_column", function () { config.free(); } }); -test("align_items_center_child_with_margin_bigger_than_parent", function () { +test("align_items_center_child_with_margin_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1715,7 +1715,7 @@ test("align_items_center_child_with_margin_bigger_than_parent", function () { config.free(); } }); -test("align_items_flex_end_child_with_margin_bigger_than_parent", function () { +test("align_items_flex_end_child_with_margin_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1777,7 +1777,7 @@ test("align_items_flex_end_child_with_margin_bigger_than_parent", function () { config.free(); } }); -test("align_items_center_child_without_margin_bigger_than_parent", function () { +test("align_items_center_child_without_margin_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1837,7 +1837,7 @@ test("align_items_center_child_without_margin_bigger_than_parent", function () { config.free(); } }); -test("align_items_flex_end_child_without_margin_bigger_than_parent", function () { +test("align_items_flex_end_child_without_margin_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1897,7 +1897,7 @@ test("align_items_flex_end_child_without_margin_bigger_than_parent", function () config.free(); } }); -test("align_center_should_size_based_on_content", function () { +test("align_center_should_size_based_on_content", () => { const config = Yoga.Config.create(); let root; @@ -1973,7 +1973,7 @@ test("align_center_should_size_based_on_content", function () { config.free(); } }); -test("align_stretch_should_size_based_on_parent", function () { +test("align_stretch_should_size_based_on_parent", () => { const config = Yoga.Config.create(); let root; @@ -2048,7 +2048,7 @@ test("align_stretch_should_size_based_on_parent", function () { config.free(); } }); -test("align_flex_start_with_shrinking_children", function () { +test("align_flex_start_with_shrinking_children", () => { const config = Yoga.Config.create(); let root; @@ -2121,7 +2121,7 @@ test("align_flex_start_with_shrinking_children", function () { config.free(); } }); -test("align_flex_start_with_stretching_children", function () { +test("align_flex_start_with_stretching_children", () => { const config = Yoga.Config.create(); let root; @@ -2193,7 +2193,7 @@ test("align_flex_start_with_stretching_children", function () { config.free(); } }); -test("align_flex_start_with_shrinking_children_with_stretch", function () { +test("align_flex_start_with_shrinking_children_with_stretch", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGAlignSelfTest.test.js b/javascript/tests/generated/YGAlignSelfTest.test.js index feee7b0f..b8f1db3f 100644 --- a/javascript/tests/generated/YGAlignSelfTest.test.js +++ b/javascript/tests/generated/YGAlignSelfTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html -test("align_self_center", function () { +test("align_self_center", () => { const config = Yoga.Config.create(); let root; @@ -52,7 +52,7 @@ test("align_self_center", function () { config.free(); } }); -test("align_self_flex_end", function () { +test("align_self_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -97,7 +97,7 @@ test("align_self_flex_end", function () { config.free(); } }); -test("align_self_flex_start", function () { +test("align_self_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -142,7 +142,7 @@ test("align_self_flex_start", function () { config.free(); } }); -test("align_self_flex_end_override_flex_start", function () { +test("align_self_flex_end_override_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -188,7 +188,7 @@ test("align_self_flex_end_override_flex_start", function () { config.free(); } }); -test("align_self_baseline", function () { +test("align_self_baseline", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGAndroidNewsFeed.test.js b/javascript/tests/generated/YGAndroidNewsFeed.test.js index 3b146bc5..c198cae1 100644 --- a/javascript/tests/generated/YGAndroidNewsFeed.test.js +++ b/javascript/tests/generated/YGAndroidNewsFeed.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html -test("android_news_feed", function () { +test("android_news_feed", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGBorderTest.test.js b/javascript/tests/generated/YGBorderTest.test.js index 8d75a2b7..edd8aab8 100644 --- a/javascript/tests/generated/YGBorderTest.test.js +++ b/javascript/tests/generated/YGBorderTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html -test("border_no_size", function () { +test("border_no_size", () => { const config = Yoga.Config.create(); let root; @@ -38,7 +38,7 @@ test("border_no_size", function () { config.free(); } }); -test("border_container_match_child", function () { +test("border_container_match_child", () => { const config = Yoga.Config.create(); let root; @@ -84,7 +84,7 @@ test("border_container_match_child", function () { config.free(); } }); -test("border_flex_child", function () { +test("border_flex_child", () => { const config = Yoga.Config.create(); let root; @@ -132,7 +132,7 @@ test("border_flex_child", function () { config.free(); } }); -test("border_stretch_child", function () { +test("border_stretch_child", () => { const config = Yoga.Config.create(); let root; @@ -179,7 +179,7 @@ test("border_stretch_child", function () { config.free(); } }); -test("border_center_child", function () { +test("border_center_child", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGDimensionTest.test.js b/javascript/tests/generated/YGDimensionTest.test.js index 96638b44..582b4e61 100644 --- a/javascript/tests/generated/YGDimensionTest.test.js +++ b/javascript/tests/generated/YGDimensionTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html -test("wrap_child", function () { +test("wrap_child", () => { const config = Yoga.Config.create(); let root; @@ -49,7 +49,7 @@ test("wrap_child", function () { config.free(); } }); -test("wrap_grandchild", function () { +test("wrap_grandchild", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGDisplayTest.test.js b/javascript/tests/generated/YGDisplayTest.test.js index 3819330d..004ff905 100644 --- a/javascript/tests/generated/YGDisplayTest.test.js +++ b/javascript/tests/generated/YGDisplayTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html -test("display_none", function () { +test("display_none", () => { const config = Yoga.Config.create(); let root; @@ -66,7 +66,7 @@ test("display_none", function () { config.free(); } }); -test("display_none_fixed_size", function () { +test("display_none_fixed_size", () => { const config = Yoga.Config.create(); let root; @@ -126,7 +126,7 @@ test("display_none_fixed_size", function () { config.free(); } }); -test("display_none_with_margin", function () { +test("display_none_with_margin", () => { const config = Yoga.Config.create(); let root; @@ -190,7 +190,7 @@ test("display_none_with_margin", function () { config.free(); } }); -test("display_none_with_child", function () { +test("display_none_with_child", () => { const config = Yoga.Config.create(); let root; @@ -286,7 +286,7 @@ test("display_none_with_child", function () { config.free(); } }); -test("display_none_with_position", function () { +test("display_none_with_position", () => { const config = Yoga.Config.create(); let root; @@ -346,7 +346,7 @@ test("display_none_with_position", function () { config.free(); } }); -test("display_none_with_position_absolute", function () { +test("display_none_with_position_absolute", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGFlexDirectionTest.test.js b/javascript/tests/generated/YGFlexDirectionTest.test.js index 70aa6e0c..d7c5e0d7 100644 --- a/javascript/tests/generated/YGFlexDirectionTest.test.js +++ b/javascript/tests/generated/YGFlexDirectionTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html -test("flex_direction_column_no_height", function () { +test("flex_direction_column_no_height", () => { const config = Yoga.Config.create(); let root; @@ -77,7 +77,7 @@ test("flex_direction_column_no_height", function () { config.free(); } }); -test("flex_direction_row_no_width", function () { +test("flex_direction_row_no_width", () => { const config = Yoga.Config.create(); let root; @@ -148,7 +148,7 @@ test("flex_direction_row_no_width", function () { config.free(); } }); -test("flex_direction_column", function () { +test("flex_direction_column", () => { const config = Yoga.Config.create(); let root; @@ -219,7 +219,7 @@ test("flex_direction_column", function () { config.free(); } }); -test("flex_direction_row", function () { +test("flex_direction_row", () => { const config = Yoga.Config.create(); let root; @@ -291,7 +291,7 @@ test("flex_direction_row", function () { config.free(); } }); -test("flex_direction_column_reverse", function () { +test("flex_direction_column_reverse", () => { const config = Yoga.Config.create(); let root; @@ -363,7 +363,7 @@ test("flex_direction_column_reverse", function () { config.free(); } }); -test("flex_direction_row_reverse", function () { +test("flex_direction_row_reverse", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGFlexTest.test.js b/javascript/tests/generated/YGFlexTest.test.js index 93e997eb..141ad7cf 100644 --- a/javascript/tests/generated/YGFlexTest.test.js +++ b/javascript/tests/generated/YGFlexTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html -test("flex_basis_flex_grow_column", function () { +test("flex_basis_flex_grow_column", () => { const config = Yoga.Config.create(); let root; @@ -65,7 +65,7 @@ test("flex_basis_flex_grow_column", function () { config.free(); } }); -test("flex_shrink_flex_grow_row", function () { +test("flex_shrink_flex_grow_row", () => { const config = Yoga.Config.create(); let root; @@ -127,7 +127,7 @@ test("flex_shrink_flex_grow_row", function () { config.free(); } }); -test("flex_shrink_flex_grow_child_flex_shrink_other_child", function () { +test("flex_shrink_flex_grow_child_flex_shrink_other_child", () => { const config = Yoga.Config.create(); let root; @@ -190,7 +190,7 @@ test("flex_shrink_flex_grow_child_flex_shrink_other_child", function () { config.free(); } }); -test("flex_basis_flex_grow_row", function () { +test("flex_basis_flex_grow_row", () => { const config = Yoga.Config.create(); let root; @@ -249,7 +249,7 @@ test("flex_basis_flex_grow_row", function () { config.free(); } }); -test("flex_basis_flex_shrink_column", function () { +test("flex_basis_flex_shrink_column", () => { const config = Yoga.Config.create(); let root; @@ -307,7 +307,7 @@ test("flex_basis_flex_shrink_column", function () { config.free(); } }); -test("flex_basis_flex_shrink_row", function () { +test("flex_basis_flex_shrink_row", () => { const config = Yoga.Config.create(); let root; @@ -366,7 +366,7 @@ test("flex_basis_flex_shrink_row", function () { config.free(); } }); -test("flex_shrink_to_zero", function () { +test("flex_shrink_to_zero", () => { const config = Yoga.Config.create(); let root; @@ -440,7 +440,7 @@ test("flex_shrink_to_zero", function () { config.free(); } }); -test("flex_basis_overrides_main_size", function () { +test("flex_basis_overrides_main_size", () => { const config = Yoga.Config.create(); let root; @@ -515,7 +515,7 @@ test("flex_basis_overrides_main_size", function () { config.free(); } }); -test("flex_grow_shrink_at_most", function () { +test("flex_grow_shrink_at_most", () => { const config = Yoga.Config.create(); let root; @@ -572,7 +572,7 @@ test("flex_grow_shrink_at_most", function () { config.free(); } }); -test("flex_grow_less_than_factor_one", function () { +test("flex_grow_less_than_factor_one", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGFlexWrapTest.test.js b/javascript/tests/generated/YGFlexWrapTest.test.js index e670b7ca..cd0388dd 100644 --- a/javascript/tests/generated/YGFlexWrapTest.test.js +++ b/javascript/tests/generated/YGFlexWrapTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html -test("wrap_column", function () { +test("wrap_column", () => { const config = Yoga.Config.create(); let root; @@ -96,7 +96,7 @@ test("wrap_column", function () { config.free(); } }); -test("wrap_row", function () { +test("wrap_row", () => { const config = Yoga.Config.create(); let root; @@ -186,7 +186,7 @@ test("wrap_row", function () { config.free(); } }); -test("wrap_row_align_items_flex_end", function () { +test("wrap_row_align_items_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -277,7 +277,7 @@ test("wrap_row_align_items_flex_end", function () { config.free(); } }); -test("wrap_row_align_items_center", function () { +test("wrap_row_align_items_center", () => { const config = Yoga.Config.create(); let root; @@ -368,7 +368,7 @@ test("wrap_row_align_items_center", function () { config.free(); } }); -test("flex_wrap_children_with_min_main_overriding_flex_basis", function () { +test("flex_wrap_children_with_min_main_overriding_flex_basis", () => { const config = Yoga.Config.create(); let root; @@ -430,7 +430,7 @@ test("flex_wrap_children_with_min_main_overriding_flex_basis", function () { config.free(); } }); -test("flex_wrap_wrap_to_child_height", function () { +test("flex_wrap_wrap_to_child_height", () => { const config = Yoga.Config.create(); let root; @@ -517,7 +517,7 @@ test("flex_wrap_wrap_to_child_height", function () { config.free(); } }); -test("flex_wrap_align_stretch_fits_one_row", function () { +test("flex_wrap_align_stretch_fits_one_row", () => { const config = Yoga.Config.create(); let root; @@ -576,7 +576,7 @@ test("flex_wrap_align_stretch_fits_one_row", function () { config.free(); } }); -test("wrap_reverse_row_align_content_flex_start", function () { +test("wrap_reverse_row_align_content_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -681,7 +681,7 @@ test("wrap_reverse_row_align_content_flex_start", function () { config.free(); } }); -test("wrap_reverse_row_align_content_center", function () { +test("wrap_reverse_row_align_content_center", () => { const config = Yoga.Config.create(); let root; @@ -787,7 +787,7 @@ test("wrap_reverse_row_align_content_center", function () { config.free(); } }); -test("wrap_reverse_row_single_line_different_size", function () { +test("wrap_reverse_row_single_line_different_size", () => { const config = Yoga.Config.create(); let root; @@ -892,7 +892,7 @@ test("wrap_reverse_row_single_line_different_size", function () { config.free(); } }); -test("wrap_reverse_row_align_content_stretch", function () { +test("wrap_reverse_row_align_content_stretch", () => { const config = Yoga.Config.create(); let root; @@ -998,7 +998,7 @@ test("wrap_reverse_row_align_content_stretch", function () { config.free(); } }); -test("wrap_reverse_row_align_content_space_around", function () { +test("wrap_reverse_row_align_content_space_around", () => { const config = Yoga.Config.create(); let root; @@ -1104,7 +1104,7 @@ test("wrap_reverse_row_align_content_space_around", function () { config.free(); } }); -test("wrap_reverse_column_fixed_size", function () { +test("wrap_reverse_column_fixed_size", () => { const config = Yoga.Config.create(); let root; @@ -1210,7 +1210,7 @@ test("wrap_reverse_column_fixed_size", function () { config.free(); } }); -test("wrapped_row_within_align_items_center", function () { +test("wrapped_row_within_align_items_center", () => { const config = Yoga.Config.create(); let root; @@ -1285,7 +1285,7 @@ test("wrapped_row_within_align_items_center", function () { config.free(); } }); -test("wrapped_row_within_align_items_flex_start", function () { +test("wrapped_row_within_align_items_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -1360,7 +1360,7 @@ test("wrapped_row_within_align_items_flex_start", function () { config.free(); } }); -test("wrapped_row_within_align_items_flex_end", function () { +test("wrapped_row_within_align_items_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -1435,7 +1435,7 @@ test("wrapped_row_within_align_items_flex_end", function () { config.free(); } }); -test("wrapped_column_max_height", function () { +test("wrapped_column_max_height", () => { const config = Yoga.Config.create(); let root; @@ -1518,7 +1518,7 @@ test("wrapped_column_max_height", function () { config.free(); } }); -test("wrapped_column_max_height_flex", function () { +test("wrapped_column_max_height_flex", () => { const config = Yoga.Config.create(); let root; @@ -1607,7 +1607,7 @@ test("wrapped_column_max_height_flex", function () { config.free(); } }); -test("wrap_nodes_with_content_sizing_overflowing_margin", function () { +test("wrap_nodes_with_content_sizing_overflowing_margin", () => { const config = Yoga.Config.create(); let root; @@ -1709,7 +1709,7 @@ test("wrap_nodes_with_content_sizing_overflowing_margin", function () { config.free(); } }); -test("wrap_nodes_with_content_sizing_margin_cross", function () { +test("wrap_nodes_with_content_sizing_margin_cross", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGGapTest.test.js b/javascript/tests/generated/YGGapTest.test.js index ca2bc2c8..11ffa6d6 100644 --- a/javascript/tests/generated/YGGapTest.test.js +++ b/javascript/tests/generated/YGGapTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGGapTest.html -test("column_gap_flexible", function () { +test("column_gap_flexible", () => { const config = Yoga.Config.create(); let root; @@ -87,7 +87,7 @@ test("column_gap_flexible", function () { config.free(); } }); -test("column_gap_inflexible", function () { +test("column_gap_inflexible", () => { const config = Yoga.Config.create(); let root; @@ -160,7 +160,7 @@ test("column_gap_inflexible", function () { config.free(); } }); -test("column_gap_mixed_flexible", function () { +test("column_gap_mixed_flexible", () => { const config = Yoga.Config.create(); let root; @@ -235,7 +235,7 @@ test("column_gap_mixed_flexible", function () { config.free(); } }); -test("column_gap_child_margins", function () { +test("column_gap_child_margins", () => { const config = Yoga.Config.create(); let root; @@ -320,7 +320,7 @@ test("column_gap_child_margins", function () { config.free(); } }); -test("column_row_gap_wrapping", function () { +test("column_row_gap_wrapping", () => { const config = Yoga.Config.create(); let root; @@ -487,7 +487,7 @@ test("column_row_gap_wrapping", function () { config.free(); } }); -test("column_gap_justify_flex_start", function () { +test("column_gap_justify_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -560,7 +560,7 @@ test("column_gap_justify_flex_start", function () { config.free(); } }); -test("column_gap_justify_center", function () { +test("column_gap_justify_center", () => { const config = Yoga.Config.create(); let root; @@ -634,7 +634,7 @@ test("column_gap_justify_center", function () { config.free(); } }); -test("column_gap_justify_flex_end", function () { +test("column_gap_justify_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -708,7 +708,7 @@ test("column_gap_justify_flex_end", function () { config.free(); } }); -test("column_gap_justify_space_between", function () { +test("column_gap_justify_space_between", () => { const config = Yoga.Config.create(); let root; @@ -782,7 +782,7 @@ test("column_gap_justify_space_between", function () { config.free(); } }); -test("column_gap_justify_space_around", function () { +test("column_gap_justify_space_around", () => { const config = Yoga.Config.create(); let root; @@ -856,7 +856,7 @@ test("column_gap_justify_space_around", function () { config.free(); } }); -test("column_gap_justify_space_evenly", function () { +test("column_gap_justify_space_evenly", () => { const config = Yoga.Config.create(); let root; @@ -930,7 +930,7 @@ test("column_gap_justify_space_evenly", function () { config.free(); } }); -test("column_gap_wrap_align_flex_start", function () { +test("column_gap_wrap_align_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -1053,7 +1053,7 @@ test("column_gap_wrap_align_flex_start", function () { config.free(); } }); -test("column_gap_wrap_align_center", function () { +test("column_gap_wrap_align_center", () => { const config = Yoga.Config.create(); let root; @@ -1177,7 +1177,7 @@ test("column_gap_wrap_align_center", function () { config.free(); } }); -test("column_gap_wrap_align_flex_end", function () { +test("column_gap_wrap_align_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -1301,7 +1301,7 @@ test("column_gap_wrap_align_flex_end", function () { config.free(); } }); -test("column_gap_wrap_align_space_between", function () { +test("column_gap_wrap_align_space_between", () => { const config = Yoga.Config.create(); let root; @@ -1425,7 +1425,7 @@ test("column_gap_wrap_align_space_between", function () { config.free(); } }); -test("column_gap_wrap_align_space_around", function () { +test("column_gap_wrap_align_space_around", () => { const config = Yoga.Config.create(); let root; @@ -1549,7 +1549,7 @@ test("column_gap_wrap_align_space_around", function () { config.free(); } }); -test("column_gap_wrap_align_stretch", function () { +test("column_gap_wrap_align_stretch", () => { const config = Yoga.Config.create(); let root; @@ -1657,7 +1657,7 @@ test("column_gap_wrap_align_stretch", function () { config.free(); } }); -test("column_gap_determines_parent_width", function () { +test("column_gap_determines_parent_width", () => { const config = Yoga.Config.create(); let root; @@ -1729,7 +1729,7 @@ test("column_gap_determines_parent_width", function () { config.free(); } }); -test("row_gap_align_items_stretch", function () { +test("row_gap_align_items_stretch", () => { const config = Yoga.Config.create(); let root; @@ -1847,7 +1847,7 @@ test("row_gap_align_items_stretch", function () { config.free(); } }); -test("row_gap_align_items_end", function () { +test("row_gap_align_items_end", () => { const config = Yoga.Config.create(); let root; @@ -1965,7 +1965,7 @@ test("row_gap_align_items_end", function () { config.free(); } }); -test("row_gap_column_child_margins", function () { +test("row_gap_column_child_margins", () => { const config = Yoga.Config.create(); let root; @@ -2049,7 +2049,7 @@ test("row_gap_column_child_margins", function () { config.free(); } }); -test("row_gap_row_wrap_child_margins", function () { +test("row_gap_row_wrap_child_margins", () => { const config = Yoga.Config.create(); let root; @@ -2129,7 +2129,7 @@ test("row_gap_row_wrap_child_margins", function () { config.free(); } }); -test("row_gap_determines_parent_height", function () { +test("row_gap_determines_parent_height", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGJustifyContentTest.test.js b/javascript/tests/generated/YGJustifyContentTest.test.js index bca80053..145eb54a 100644 --- a/javascript/tests/generated/YGJustifyContentTest.test.js +++ b/javascript/tests/generated/YGJustifyContentTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html -test("justify_content_row_flex_start", function () { +test("justify_content_row_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -79,7 +79,7 @@ test("justify_content_row_flex_start", function () { config.free(); } }); -test("justify_content_row_flex_end", function () { +test("justify_content_row_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -152,7 +152,7 @@ test("justify_content_row_flex_end", function () { config.free(); } }); -test("justify_content_row_center", function () { +test("justify_content_row_center", () => { const config = Yoga.Config.create(); let root; @@ -225,7 +225,7 @@ test("justify_content_row_center", function () { config.free(); } }); -test("justify_content_row_space_between", function () { +test("justify_content_row_space_between", () => { const config = Yoga.Config.create(); let root; @@ -298,7 +298,7 @@ test("justify_content_row_space_between", function () { config.free(); } }); -test("justify_content_row_space_around", function () { +test("justify_content_row_space_around", () => { const config = Yoga.Config.create(); let root; @@ -371,7 +371,7 @@ test("justify_content_row_space_around", function () { config.free(); } }); -test("justify_content_column_flex_start", function () { +test("justify_content_column_flex_start", () => { const config = Yoga.Config.create(); let root; @@ -442,7 +442,7 @@ test("justify_content_column_flex_start", function () { config.free(); } }); -test("justify_content_column_flex_end", function () { +test("justify_content_column_flex_end", () => { const config = Yoga.Config.create(); let root; @@ -514,7 +514,7 @@ test("justify_content_column_flex_end", function () { config.free(); } }); -test("justify_content_column_center", function () { +test("justify_content_column_center", () => { const config = Yoga.Config.create(); let root; @@ -586,7 +586,7 @@ test("justify_content_column_center", function () { config.free(); } }); -test("justify_content_column_space_between", function () { +test("justify_content_column_space_between", () => { const config = Yoga.Config.create(); let root; @@ -658,7 +658,7 @@ test("justify_content_column_space_between", function () { config.free(); } }); -test("justify_content_column_space_around", function () { +test("justify_content_column_space_around", () => { const config = Yoga.Config.create(); let root; @@ -730,7 +730,7 @@ test("justify_content_column_space_around", function () { config.free(); } }); -test("justify_content_row_min_width_and_margin", function () { +test("justify_content_row_min_width_and_margin", () => { const config = Yoga.Config.create(); let root; @@ -776,7 +776,7 @@ test("justify_content_row_min_width_and_margin", function () { config.free(); } }); -test("justify_content_row_max_width_and_margin", function () { +test("justify_content_row_max_width_and_margin", () => { const config = Yoga.Config.create(); let root; @@ -823,7 +823,7 @@ test("justify_content_row_max_width_and_margin", function () { config.free(); } }); -test("justify_content_column_min_height_and_margin", function () { +test("justify_content_column_min_height_and_margin", () => { const config = Yoga.Config.create(); let root; @@ -868,7 +868,7 @@ test("justify_content_column_min_height_and_margin", function () { config.free(); } }); -test("justify_content_colunn_max_height_and_margin", function () { +test("justify_content_colunn_max_height_and_margin", () => { const config = Yoga.Config.create(); let root; @@ -914,7 +914,7 @@ test("justify_content_colunn_max_height_and_margin", function () { config.free(); } }); -test("justify_content_column_space_evenly", function () { +test("justify_content_column_space_evenly", () => { const config = Yoga.Config.create(); let root; @@ -986,7 +986,7 @@ test("justify_content_column_space_evenly", function () { config.free(); } }); -test("justify_content_row_space_evenly", function () { +test("justify_content_row_space_evenly", () => { const config = Yoga.Config.create(); let root; @@ -1059,7 +1059,7 @@ test("justify_content_row_space_evenly", function () { config.free(); } }); -test("justify_content_min_width_with_padding_child_width_greater_than_parent", function () { +test("justify_content_min_width_with_padding_child_width_greater_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1140,7 +1140,7 @@ test("justify_content_min_width_with_padding_child_width_greater_than_parent", f config.free(); } }); -test("justify_content_min_width_with_padding_child_width_lower_than_parent", function () { +test("justify_content_min_width_with_padding_child_width_lower_than_parent", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGMarginTest.test.js b/javascript/tests/generated/YGMarginTest.test.js index debf3c49..888b189a 100644 --- a/javascript/tests/generated/YGMarginTest.test.js +++ b/javascript/tests/generated/YGMarginTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html -test("margin_start", function () { +test("margin_start", () => { const config = Yoga.Config.create(); let root; @@ -52,7 +52,7 @@ test("margin_start", function () { config.free(); } }); -test("margin_top", function () { +test("margin_top", () => { const config = Yoga.Config.create(); let root; @@ -96,7 +96,7 @@ test("margin_top", function () { config.free(); } }); -test("margin_end", function () { +test("margin_end", () => { const config = Yoga.Config.create(); let root; @@ -142,7 +142,7 @@ test("margin_end", function () { config.free(); } }); -test("margin_bottom", function () { +test("margin_bottom", () => { const config = Yoga.Config.create(); let root; @@ -187,7 +187,7 @@ test("margin_bottom", function () { config.free(); } }); -test("margin_and_flex_row", function () { +test("margin_and_flex_row", () => { const config = Yoga.Config.create(); let root; @@ -233,7 +233,7 @@ test("margin_and_flex_row", function () { config.free(); } }); -test("margin_and_flex_column", function () { +test("margin_and_flex_column", () => { const config = Yoga.Config.create(); let root; @@ -278,7 +278,7 @@ test("margin_and_flex_column", function () { config.free(); } }); -test("margin_and_stretch_row", function () { +test("margin_and_stretch_row", () => { const config = Yoga.Config.create(); let root; @@ -324,7 +324,7 @@ test("margin_and_stretch_row", function () { config.free(); } }); -test("margin_and_stretch_column", function () { +test("margin_and_stretch_column", () => { const config = Yoga.Config.create(); let root; @@ -369,7 +369,7 @@ test("margin_and_stretch_column", function () { config.free(); } }); -test("margin_with_sibling_row", function () { +test("margin_with_sibling_row", () => { const config = Yoga.Config.create(); let root; @@ -428,7 +428,7 @@ test("margin_with_sibling_row", function () { config.free(); } }); -test("margin_with_sibling_column", function () { +test("margin_with_sibling_column", () => { const config = Yoga.Config.create(); let root; @@ -486,7 +486,7 @@ test("margin_with_sibling_column", function () { config.free(); } }); -test("margin_auto_bottom", function () { +test("margin_auto_bottom", () => { const config = Yoga.Config.create(); let root; @@ -547,7 +547,7 @@ test("margin_auto_bottom", function () { config.free(); } }); -test("margin_auto_top", function () { +test("margin_auto_top", () => { const config = Yoga.Config.create(); let root; @@ -608,7 +608,7 @@ test("margin_auto_top", function () { config.free(); } }); -test("margin_auto_bottom_and_top", function () { +test("margin_auto_bottom_and_top", () => { const config = Yoga.Config.create(); let root; @@ -670,7 +670,7 @@ test("margin_auto_bottom_and_top", function () { config.free(); } }); -test("margin_auto_bottom_and_top_justify_center", function () { +test("margin_auto_bottom_and_top_justify_center", () => { const config = Yoga.Config.create(); let root; @@ -732,7 +732,7 @@ test("margin_auto_bottom_and_top_justify_center", function () { config.free(); } }); -test("margin_auto_mutiple_children_column", function () { +test("margin_auto_mutiple_children_column", () => { const config = Yoga.Config.create(); let root; @@ -809,7 +809,7 @@ test("margin_auto_mutiple_children_column", function () { config.free(); } }); -test("margin_auto_mutiple_children_row", function () { +test("margin_auto_mutiple_children_row", () => { const config = Yoga.Config.create(); let root; @@ -887,7 +887,7 @@ test("margin_auto_mutiple_children_row", function () { config.free(); } }); -test("margin_auto_left_and_right_column", function () { +test("margin_auto_left_and_right_column", () => { const config = Yoga.Config.create(); let root; @@ -950,7 +950,7 @@ test("margin_auto_left_and_right_column", function () { config.free(); } }); -test("margin_auto_left_and_right", function () { +test("margin_auto_left_and_right", () => { const config = Yoga.Config.create(); let root; @@ -1011,7 +1011,7 @@ test("margin_auto_left_and_right", function () { config.free(); } }); -test("margin_auto_start_and_end_column", function () { +test("margin_auto_start_and_end_column", () => { const config = Yoga.Config.create(); let root; @@ -1074,7 +1074,7 @@ test("margin_auto_start_and_end_column", function () { config.free(); } }); -test("margin_auto_start_and_end", function () { +test("margin_auto_start_and_end", () => { const config = Yoga.Config.create(); let root; @@ -1135,7 +1135,7 @@ test("margin_auto_start_and_end", function () { config.free(); } }); -test("margin_auto_left_and_right_column_and_center", function () { +test("margin_auto_left_and_right_column_and_center", () => { const config = Yoga.Config.create(); let root; @@ -1197,7 +1197,7 @@ test("margin_auto_left_and_right_column_and_center", function () { config.free(); } }); -test("margin_auto_left", function () { +test("margin_auto_left", () => { const config = Yoga.Config.create(); let root; @@ -1258,7 +1258,7 @@ test("margin_auto_left", function () { config.free(); } }); -test("margin_auto_right", function () { +test("margin_auto_right", () => { const config = Yoga.Config.create(); let root; @@ -1319,7 +1319,7 @@ test("margin_auto_right", function () { config.free(); } }); -test("margin_auto_left_and_right_stretch", function () { +test("margin_auto_left_and_right_stretch", () => { const config = Yoga.Config.create(); let root; @@ -1381,7 +1381,7 @@ test("margin_auto_left_and_right_stretch", function () { config.free(); } }); -test("margin_auto_top_and_bottom_stretch", function () { +test("margin_auto_top_and_bottom_stretch", () => { const config = Yoga.Config.create(); let root; @@ -1442,7 +1442,7 @@ test("margin_auto_top_and_bottom_stretch", function () { config.free(); } }); -test("margin_should_not_be_part_of_max_height", function () { +test("margin_should_not_be_part_of_max_height", () => { const config = Yoga.Config.create(); let root; @@ -1488,7 +1488,7 @@ test("margin_should_not_be_part_of_max_height", function () { config.free(); } }); -test("margin_should_not_be_part_of_max_width", function () { +test("margin_should_not_be_part_of_max_width", () => { const config = Yoga.Config.create(); let root; @@ -1534,7 +1534,7 @@ test("margin_should_not_be_part_of_max_width", function () { config.free(); } }); -test("margin_auto_left_right_child_bigger_than_parent", function () { +test("margin_auto_left_right_child_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1581,7 +1581,7 @@ test("margin_auto_left_right_child_bigger_than_parent", function () { config.free(); } }); -test("margin_auto_left_child_bigger_than_parent", function () { +test("margin_auto_left_child_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1627,7 +1627,7 @@ test("margin_auto_left_child_bigger_than_parent", function () { config.free(); } }); -test("margin_fix_left_auto_right_child_bigger_than_parent", function () { +test("margin_fix_left_auto_right_child_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1674,7 +1674,7 @@ test("margin_fix_left_auto_right_child_bigger_than_parent", function () { config.free(); } }); -test("margin_auto_left_fix_right_child_bigger_than_parent", function () { +test("margin_auto_left_fix_right_child_bigger_than_parent", () => { const config = Yoga.Config.create(); let root; @@ -1721,7 +1721,7 @@ test("margin_auto_left_fix_right_child_bigger_than_parent", function () { config.free(); } }); -test("margin_auto_top_stretching_child", function () { +test("margin_auto_top_stretching_child", () => { const config = Yoga.Config.create(); let root; @@ -1783,7 +1783,7 @@ test("margin_auto_top_stretching_child", function () { config.free(); } }); -test("margin_auto_left_stretching_child", function () { +test("margin_auto_left_stretching_child", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGMinMaxDimensionTest.test.js b/javascript/tests/generated/YGMinMaxDimensionTest.test.js index f2c63f30..0642e299 100644 --- a/javascript/tests/generated/YGMinMaxDimensionTest.test.js +++ b/javascript/tests/generated/YGMinMaxDimensionTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html -test("max_width", function () { +test("max_width", () => { const config = Yoga.Config.create(); let root; @@ -51,7 +51,7 @@ test("max_width", function () { config.free(); } }); -test("max_height", function () { +test("max_height", () => { const config = Yoga.Config.create(); let root; @@ -96,7 +96,7 @@ test("max_height", function () { config.free(); } }); -test("justify_content_min_max", function () { +test("justify_content_min_max", () => { const config = Yoga.Config.create(); let root; @@ -142,7 +142,7 @@ test("justify_content_min_max", function () { config.free(); } }); -test("align_items_min_max", function () { +test("align_items_min_max", () => { const config = Yoga.Config.create(); let root; @@ -188,7 +188,7 @@ test("align_items_min_max", function () { config.free(); } }); -test("justify_content_overflow_min_max", function () { +test("justify_content_overflow_min_max", () => { const config = Yoga.Config.create(); let root; @@ -263,7 +263,7 @@ test("justify_content_overflow_min_max", function () { config.free(); } }); -test("flex_grow_to_min", function () { +test("flex_grow_to_min", () => { const config = Yoga.Config.create(); let root; @@ -322,7 +322,7 @@ test("flex_grow_to_min", function () { config.free(); } }); -test("flex_grow_in_at_most_container", function () { +test("flex_grow_in_at_most_container", () => { const config = Yoga.Config.create(); let root; @@ -382,7 +382,7 @@ test("flex_grow_in_at_most_container", function () { config.free(); } }); -test("flex_grow_child", function () { +test("flex_grow_child", () => { const config = Yoga.Config.create(); let root; @@ -426,7 +426,7 @@ test("flex_grow_child", function () { config.free(); } }); -test("flex_grow_within_constrained_min_max_column", function () { +test("flex_grow_within_constrained_min_max_column", () => { const config = Yoga.Config.create(); let root; @@ -483,7 +483,7 @@ test("flex_grow_within_constrained_min_max_column", function () { config.free(); } }); -test("flex_grow_within_max_width", function () { +test("flex_grow_within_max_width", () => { const config = Yoga.Config.create(); let root; @@ -542,7 +542,7 @@ test("flex_grow_within_max_width", function () { config.free(); } }); -test("flex_grow_within_constrained_max_width", function () { +test("flex_grow_within_constrained_max_width", () => { const config = Yoga.Config.create(); let root; @@ -601,7 +601,7 @@ test("flex_grow_within_constrained_max_width", function () { config.free(); } }); -test("flex_root_ignored", function () { +test("flex_root_ignored", () => { const config = Yoga.Config.create(); let root; @@ -661,7 +661,7 @@ test("flex_root_ignored", function () { config.free(); } }); -test("flex_grow_root_minimized", function () { +test("flex_grow_root_minimized", () => { const config = Yoga.Config.create(); let root; @@ -736,7 +736,7 @@ test("flex_grow_root_minimized", function () { config.free(); } }); -test("flex_grow_height_maximized", function () { +test("flex_grow_height_maximized", () => { const config = Yoga.Config.create(); let root; @@ -810,7 +810,7 @@ test("flex_grow_height_maximized", function () { config.free(); } }); -test("flex_grow_within_constrained_min_row", function () { +test("flex_grow_within_constrained_min_row", () => { const config = Yoga.Config.create(); let root; @@ -868,7 +868,7 @@ test("flex_grow_within_constrained_min_row", function () { config.free(); } }); -test("flex_grow_within_constrained_min_column", function () { +test("flex_grow_within_constrained_min_column", () => { const config = Yoga.Config.create(); let root; @@ -924,7 +924,7 @@ test("flex_grow_within_constrained_min_column", function () { config.free(); } }); -test("flex_grow_within_constrained_max_row", function () { +test("flex_grow_within_constrained_max_row", () => { const config = Yoga.Config.create(); let root; @@ -997,7 +997,7 @@ test("flex_grow_within_constrained_max_row", function () { config.free(); } }); -test("flex_grow_within_constrained_max_column", function () { +test("flex_grow_within_constrained_max_column", () => { const config = Yoga.Config.create(); let root; @@ -1055,7 +1055,7 @@ test("flex_grow_within_constrained_max_column", function () { config.free(); } }); -test("child_min_max_width_flexing", function () { +test("child_min_max_width_flexing", () => { const config = Yoga.Config.create(); let root; @@ -1117,7 +1117,7 @@ test("child_min_max_width_flexing", function () { config.free(); } }); -test("min_width_overrides_width", function () { +test("min_width_overrides_width", () => { const config = Yoga.Config.create(); let root; @@ -1146,7 +1146,7 @@ test("min_width_overrides_width", function () { config.free(); } }); -test("max_width_overrides_width", function () { +test("max_width_overrides_width", () => { const config = Yoga.Config.create(); let root; @@ -1175,7 +1175,7 @@ test("max_width_overrides_width", function () { config.free(); } }); -test("min_height_overrides_height", function () { +test("min_height_overrides_height", () => { const config = Yoga.Config.create(); let root; @@ -1204,7 +1204,7 @@ test("min_height_overrides_height", function () { config.free(); } }); -test("max_height_overrides_height", function () { +test("max_height_overrides_height", () => { const config = Yoga.Config.create(); let root; @@ -1233,7 +1233,7 @@ test("max_height_overrides_height", function () { config.free(); } }); -test("min_max_percent_no_width_height", function () { +test("min_max_percent_no_width_height", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGPaddingTest.test.js b/javascript/tests/generated/YGPaddingTest.test.js index 8e2df73e..1f9498c3 100644 --- a/javascript/tests/generated/YGPaddingTest.test.js +++ b/javascript/tests/generated/YGPaddingTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html -test("padding_no_size", function () { +test("padding_no_size", () => { const config = Yoga.Config.create(); let root; @@ -38,7 +38,7 @@ test("padding_no_size", function () { config.free(); } }); -test("padding_container_match_child", function () { +test("padding_container_match_child", () => { const config = Yoga.Config.create(); let root; @@ -84,7 +84,7 @@ test("padding_container_match_child", function () { config.free(); } }); -test("padding_flex_child", function () { +test("padding_flex_child", () => { const config = Yoga.Config.create(); let root; @@ -132,7 +132,7 @@ test("padding_flex_child", function () { config.free(); } }); -test("padding_stretch_child", function () { +test("padding_stretch_child", () => { const config = Yoga.Config.create(); let root; @@ -179,7 +179,7 @@ test("padding_stretch_child", function () { config.free(); } }); -test("padding_center_child", function () { +test("padding_center_child", () => { const config = Yoga.Config.create(); let root; @@ -228,7 +228,7 @@ test("padding_center_child", function () { config.free(); } }); -test("child_with_padding_align_end", function () { +test("child_with_padding_align_end", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGPercentageTest.test.js b/javascript/tests/generated/YGPercentageTest.test.js index def08b5a..2c34df61 100644 --- a/javascript/tests/generated/YGPercentageTest.test.js +++ b/javascript/tests/generated/YGPercentageTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html -test("percentage_width_height", function () { +test("percentage_width_height", () => { const config = Yoga.Config.create(); let root; @@ -52,7 +52,7 @@ test("percentage_width_height", function () { config.free(); } }); -test("percentage_position_left_top", function () { +test("percentage_position_left_top", () => { const config = Yoga.Config.create(); let root; @@ -99,7 +99,7 @@ test("percentage_position_left_top", function () { config.free(); } }); -test("percentage_position_bottom_right", function () { +test("percentage_position_bottom_right", () => { const config = Yoga.Config.create(); let root; @@ -146,7 +146,7 @@ test("percentage_position_bottom_right", function () { config.free(); } }); -test("percentage_flex_basis", function () { +test("percentage_flex_basis", () => { const config = Yoga.Config.create(); let root; @@ -206,7 +206,7 @@ test("percentage_flex_basis", function () { config.free(); } }); -test("percentage_flex_basis_cross", function () { +test("percentage_flex_basis_cross", () => { const config = Yoga.Config.create(); let root; @@ -265,7 +265,7 @@ test("percentage_flex_basis_cross", function () { config.free(); } }); -test("percentage_flex_basis_main_max_height", function () { +test("percentage_flex_basis_main_max_height", () => { const config = Yoga.Config.create(); let root; @@ -327,7 +327,7 @@ test("percentage_flex_basis_main_max_height", function () { config.free(); } }); -test("percentage_flex_basis_cross_max_height", function () { +test("percentage_flex_basis_cross_max_height", () => { const config = Yoga.Config.create(); let root; @@ -388,7 +388,7 @@ test("percentage_flex_basis_cross_max_height", function () { config.free(); } }); -test("percentage_flex_basis_main_max_width", function () { +test("percentage_flex_basis_main_max_width", () => { const config = Yoga.Config.create(); let root; @@ -450,7 +450,7 @@ test("percentage_flex_basis_main_max_width", function () { config.free(); } }); -test("percentage_flex_basis_cross_max_width", function () { +test("percentage_flex_basis_cross_max_width", () => { const config = Yoga.Config.create(); let root; @@ -511,7 +511,7 @@ test("percentage_flex_basis_cross_max_width", function () { config.free(); } }); -test("percentage_flex_basis_main_min_width", function () { +test("percentage_flex_basis_main_min_width", () => { const config = Yoga.Config.create(); let root; @@ -573,7 +573,7 @@ test("percentage_flex_basis_main_min_width", function () { config.free(); } }); -test("percentage_flex_basis_cross_min_width", function () { +test("percentage_flex_basis_cross_min_width", () => { const config = Yoga.Config.create(); let root; @@ -634,7 +634,7 @@ test("percentage_flex_basis_cross_min_width", function () { config.free(); } }); -test("percentage_multiple_nested_with_padding_margin_and_percentage_values", function () { +test("percentage_multiple_nested_with_padding_margin_and_percentage_values", () => { const config = Yoga.Config.create(); let root; @@ -747,7 +747,7 @@ test("percentage_multiple_nested_with_padding_margin_and_percentage_values", fun config.free(); } }); -test("percentage_margin_should_calculate_based_only_on_width", function () { +test("percentage_margin_should_calculate_based_only_on_width", () => { const config = Yoga.Config.create(); let root; @@ -809,7 +809,7 @@ test("percentage_margin_should_calculate_based_only_on_width", function () { config.free(); } }); -test("percentage_padding_should_calculate_based_only_on_width", function () { +test("percentage_padding_should_calculate_based_only_on_width", () => { const config = Yoga.Config.create(); let root; @@ -871,7 +871,7 @@ test("percentage_padding_should_calculate_based_only_on_width", function () { config.free(); } }); -test("percentage_absolute_position", function () { +test("percentage_absolute_position", () => { const config = Yoga.Config.create(); let root; @@ -918,7 +918,7 @@ test("percentage_absolute_position", function () { config.free(); } }); -test("percentage_width_height_undefined_parent_size", function () { +test("percentage_width_height_undefined_parent_size", () => { const config = Yoga.Config.create(); let root; @@ -960,7 +960,7 @@ test("percentage_width_height_undefined_parent_size", function () { config.free(); } }); -test("percent_within_flex_grow", function () { +test("percent_within_flex_grow", () => { const config = Yoga.Config.create(); let root; @@ -1046,7 +1046,7 @@ test("percent_within_flex_grow", function () { config.free(); } }); -test("percentage_container_in_wrapping_container", function () { +test("percentage_container_in_wrapping_container", () => { const config = Yoga.Config.create(); let root; @@ -1136,7 +1136,7 @@ test("percentage_container_in_wrapping_container", function () { config.free(); } }); -test("percent_absolute_position", function () { +test("percent_absolute_position", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGRoundingTest.test.js b/javascript/tests/generated/YGRoundingTest.test.js index 52937ca8..c1cac6e4 100644 --- a/javascript/tests/generated/YGRoundingTest.test.js +++ b/javascript/tests/generated/YGRoundingTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html -test("rounding_flex_basis_flex_grow_row_width_of_100", function () { +test("rounding_flex_basis_flex_grow_row_width_of_100", () => { const config = Yoga.Config.create(); let root; @@ -79,7 +79,7 @@ test("rounding_flex_basis_flex_grow_row_width_of_100", function () { config.free(); } }); -test("rounding_flex_basis_flex_grow_row_prime_number_width", function () { +test("rounding_flex_basis_flex_grow_row_prime_number_width", () => { const config = Yoga.Config.create(); let root; @@ -179,7 +179,7 @@ test("rounding_flex_basis_flex_grow_row_prime_number_width", function () { config.free(); } }); -test("rounding_flex_basis_flex_shrink_row", function () { +test("rounding_flex_basis_flex_shrink_row", () => { const config = Yoga.Config.create(); let root; @@ -252,7 +252,7 @@ test("rounding_flex_basis_flex_shrink_row", function () { config.free(); } }); -test("rounding_flex_basis_overrides_main_size", function () { +test("rounding_flex_basis_overrides_main_size", () => { const config = Yoga.Config.create(); let root; @@ -327,7 +327,7 @@ test("rounding_flex_basis_overrides_main_size", function () { config.free(); } }); -test("rounding_total_fractial", function () { +test("rounding_total_fractial", () => { const config = Yoga.Config.create(); let root; @@ -402,7 +402,7 @@ test("rounding_total_fractial", function () { config.free(); } }); -test("rounding_total_fractial_nested", function () { +test("rounding_total_fractial_nested", () => { const config = Yoga.Config.create(); let root; @@ -511,7 +511,7 @@ test("rounding_total_fractial_nested", function () { config.free(); } }); -test("rounding_fractial_input_1", function () { +test("rounding_fractial_input_1", () => { const config = Yoga.Config.create(); let root; @@ -586,7 +586,7 @@ test("rounding_fractial_input_1", function () { config.free(); } }); -test("rounding_fractial_input_2", function () { +test("rounding_fractial_input_2", () => { const config = Yoga.Config.create(); let root; @@ -661,7 +661,7 @@ test("rounding_fractial_input_2", function () { config.free(); } }); -test("rounding_fractial_input_3", function () { +test("rounding_fractial_input_3", () => { const config = Yoga.Config.create(); let root; @@ -737,7 +737,7 @@ test("rounding_fractial_input_3", function () { config.free(); } }); -test("rounding_fractial_input_4", function () { +test("rounding_fractial_input_4", () => { const config = Yoga.Config.create(); let root; @@ -813,7 +813,7 @@ test("rounding_fractial_input_4", function () { config.free(); } }); -test("rounding_inner_node_controversy_horizontal", function () { +test("rounding_inner_node_controversy_horizontal", () => { const config = Yoga.Config.create(); let root; @@ -902,7 +902,7 @@ test("rounding_inner_node_controversy_horizontal", function () { config.free(); } }); -test("rounding_inner_node_controversy_vertical", function () { +test("rounding_inner_node_controversy_vertical", () => { const config = Yoga.Config.create(); let root; @@ -990,7 +990,7 @@ test("rounding_inner_node_controversy_vertical", function () { config.free(); } }); -test("rounding_inner_node_controversy_combined", function () { +test("rounding_inner_node_controversy_combined", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/generated/YGSizeOverflowTest.test.js b/javascript/tests/generated/YGSizeOverflowTest.test.js index 69df93f4..6fa2c119 100644 --- a/javascript/tests/generated/YGSizeOverflowTest.test.js +++ b/javascript/tests/generated/YGSizeOverflowTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html -test("nested_overflowing_child", function () { +test("nested_overflowing_child", () => { const config = Yoga.Config.create(); let root; @@ -64,7 +64,7 @@ test("nested_overflowing_child", function () { config.free(); } }); -test("nested_overflowing_child_in_constraint_parent", function () { +test("nested_overflowing_child_in_constraint_parent", () => { const config = Yoga.Config.create(); let root; @@ -123,7 +123,7 @@ test("nested_overflowing_child_in_constraint_parent", function () { config.free(); } }); -test("parent_wrap_child_size_overflowing_parent", function () { +test("parent_wrap_child_size_overflowing_parent", () => { const config = Yoga.Config.create(); let root; diff --git a/javascript/tests/run-bench.js b/javascript/tests/run-bench.js index 7263c833..57940928 100644 --- a/javascript/tests/run-bench.js +++ b/javascript/tests/run-bench.js @@ -10,20 +10,20 @@ require(`./tools`); -let fs = require(`fs`); -let vm = require(`vm`); +const fs = require(`fs`); +const vm = require(`vm`); -let WARMUP_ITERATIONS = 3; -let BENCHMARK_ITERATIONS = 10; +const WARMUP_ITERATIONS = 3; +const BENCHMARK_ITERATIONS = 10; -let testFiles = process.argv.slice(2).map((file) => { +const testFiles = process.argv.slice(2).map((file) => { return fs.readFileSync(file).toString(); }); -let testResults = new Map(); +const testResults = new Map(); -for (let type of ["asmjs", "wasm"]) { - for (let file of testFiles) { +for (const type of ["asmjs", "wasm"]) { + for (const file of testFiles) { vm.runInNewContext( file, Object.assign(Object.create(global), { @@ -38,11 +38,11 @@ for (let type of ["asmjs", "wasm"]) { for (let t = 0; t < WARMUP_ITERATIONS; ++t) fn(); - let start = Date.now(); + const start = Date.now(); for (let t = 0; t < BENCHMARK_ITERATIONS; ++t) fn(); - let end = Date.now(); + const end = Date.now(); testEntry.set(type, (end - start) / BENCHMARK_ITERATIONS); }, @@ -55,14 +55,14 @@ console.log( `Note: those tests are independants; there is no time relation to be expected between them` ); -for (let [name, results] of testResults) { +for (const [name, results] of testResults) { console.log(); - let min = Math.min(Infinity, ...results.values()); + const min = Math.min(Infinity, ...results.values()); console.log(name); - for (let [type, result] of results) { + for (const [type, result] of results) { console.log( ` - ${type}: ${result}ms (${Math.round((result / min) * 10000) / 100}%)` ); diff --git a/javascript/tests/tools.js b/javascript/tests/tools.js index b3820792..a72464ee 100644 --- a/javascript/tests/tools.js +++ b/javascript/tests/tools.js @@ -8,7 +8,7 @@ */ global.getMeasureCounter = function (Yoga, cb, staticWidth, staticHeight) { - var counter = 0; + let counter = 0; return { inc: function (width, widthMode, height, heightMode) { @@ -26,35 +26,29 @@ global.getMeasureCounter = function (Yoga, cb, staticWidth, staticHeight) { }; global.getMeasureCounterMax = function (Yoga) { - return getMeasureCounter( - Yoga, - function (width, widthMode, height, heightMode) { - var measuredWidth = - widthMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : width; - var measuredHeight = - heightMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : height; + return getMeasureCounter(Yoga, (width, widthMode, height, heightMode) => { + const measuredWidth = + widthMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : width; + const measuredHeight = + heightMode === Yoga.MEASURE_MODE_UNDEFINED ? 10 : height; - return { width: measuredWidth, height: measuredHeight }; - } - ); + return { width: measuredWidth, height: measuredHeight }; + }); }; global.getMeasureCounterMin = function (Yoga) { - return getMeasureCounter( - Yoga, - function (width, widthMode, height, heightMode) { - var measuredWidth = - widthMode === Yoga.MEASURE_MODE_UNDEFINED || - (widthMode == Yoga.MEASURE_MODE_AT_MOST && width > 10) - ? 10 - : width; - var measuredHeight = - heightMode === Yoga.MEASURE_MODE_UNDEFINED || - (heightMode == Yoga.MEASURE_MODE_AT_MOST && height > 10) - ? 10 - : height; + return getMeasureCounter(Yoga, (width, widthMode, height, heightMode) => { + const measuredWidth = + widthMode === Yoga.MEASURE_MODE_UNDEFINED || + (widthMode == Yoga.MEASURE_MODE_AT_MOST && width > 10) + ? 10 + : width; + const measuredHeight = + heightMode === Yoga.MEASURE_MODE_UNDEFINED || + (heightMode == Yoga.MEASURE_MODE_AT_MOST && height > 10) + ? 10 + : height; - return { width: measuredWidth, height: measuredHeight }; - } - ); + return { width: measuredWidth, height: measuredHeight }; + }); };