From 538cb2e940e0a3967cd1154d0e36210fb08107d3 Mon Sep 17 00:00:00 2001 From: Colin Eberhardt Date: Mon, 5 Oct 2015 13:30:59 +0100 Subject: [PATCH] Fixed build (I was using an older verson of eslint locally) --- src/CSharpTranspiler.js | 30 ++++++++++++++--------------- src/JavaTranspiler.js | 20 +++++++++---------- src/__tests__/Layout-random-test.js | 10 +++++----- src/css-layout.js | 12 ++++++------ 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/CSharpTranspiler.js b/src/CSharpTranspiler.js index d2576f55..52d8eef0 100644 --- a/src/CSharpTranspiler.js +++ b/src/CSharpTranspiler.js @@ -70,34 +70,34 @@ function __transpileSingleTestToCSharp(code) { .replace( // style.position[CSS_TOP] => style.position[CSSLayout.POSITION_TOP] /(style|layout)\.position\[CSS_(LEFT|TOP|RIGHT|BOTTOM)\]/g, function (str, match1, match2) { - return match1 + '.position[POSITION_' + match2 + ']'; - }) + return match1 + '.position[POSITION_' + match2 + ']'; + }) .replace( // style.dimensions[CSS_WIDTH] => style.dimensions[CSSLayout.DIMENSION_WIDTH] /(style|layout)\.dimensions\[CSS_(WIDTH|HEIGHT)\]/g, function (str, match1, match2) { - return match1 + '.dimensions[DIMENSION_' + match2 + ']'; - }) + return match1 + '.dimensions[DIMENSION_' + match2 + ']'; + }) .replace( // style.maxDimensions[CSS_WIDTH] => style.maxWidth /(style|layout)\.maxDimensions\[CSS_(WIDTH|HEIGHT)\]/g, function (str, match1, match2) { - return match1 + '.max' + match2.substr(0, 1).toUpperCase() + match2.substr(1).toLowerCase(); - }) + return match1 + '.max' + match2.substr(0, 1).toUpperCase() + match2.substr(1).toLowerCase(); + }) .replace( // style.minDimensions[CSS_WIDTH] => style.minWidth /(style|layout)\.minDimensions\[CSS_(WIDTH|HEIGHT)\]/g, function (str, match1, match2) { - return match1 + '.min' + match2.substr(0, 1).toUpperCase() + match2.substr(1).toLowerCase(); - }) + return match1 + '.min' + match2.substr(0, 1).toUpperCase() + match2.substr(1).toLowerCase(); + }) .replace( // style.margin[CSS_TOP] = 12.3 => style.margin[Spacing.TOP].set(12.3) /style\.(margin|border|padding)\[CSS_(TOP|BOTTOM|LEFT|RIGHT|START|END)\]\s+=\s+(-?[\.\d]+)/g, function (str, match1, match2, match3) { - var propertyCap = match1.charAt(0).toUpperCase() + match1.slice(1); - return 'set' + propertyCap + '(Spacing.' + match2 + ', ' + match3 + ')'; - }) + var propertyCap = match1.charAt(0).toUpperCase() + match1.slice(1); + return 'set' + propertyCap + '(Spacing.' + match2 + ', ' + match3 + ')'; + }) .replace( // style.margin[CSS_TOP] => style.margin[Spacing.TOP] /style\.(margin|border|padding)\[CSS_(TOP|BOTTOM|LEFT|RIGHT|START|END)\]/g, function (str, match1, match2) { - return 'style.' + match1 + '.get(Spacing.' + match2 + ')'; - }) + return 'style.' + match1 + '.get(Spacing.' + match2 + ')'; + }) .replace(/get_child\(.*context\,\s([^\)]+)\)/g, 'getChildAt($1)') .replace(/init_css_node_children/g, 'addChildren') .replace(/css_node_t(\s)\*/g, 'TestCSSNode$1') @@ -106,8 +106,8 @@ function __transpileSingleTestToCSharp(code) { .replace( // style.flex_direction => style.flexDirection /style\.([^_\[\]\s]+)_(\w)(\w+)/g, function (str, match1, match2, match3) { - return 'style.' + match1 + match2.toUpperCase() + match3; - }) + return 'style.' + match1 + match2.toUpperCase() + match3; + }) .replace(/(\w+)\.measure\s+=\s+.+/, '$1.setMeasureFunction(sTestMeasureFunction);') // additional case conversions diff --git a/src/JavaTranspiler.js b/src/JavaTranspiler.js index b7f2d212..58caf08a 100644 --- a/src/JavaTranspiler.js +++ b/src/JavaTranspiler.js @@ -63,23 +63,23 @@ function __transpileSingleTestToJava(code) { .replace( // style.position[CSS_TOP] => style.position[CSSLayout.POSITION_TOP] /(style|layout)\.position\[CSS_(LEFT|TOP|RIGHT|BOTTOM)\]/g, function (str, match1, match2) { - return match1 + '.position[POSITION_' + match2 + ']'; - }) + return match1 + '.position[POSITION_' + match2 + ']'; + }) .replace( // style.dimensions[CSS_WIDTH] => style.dimensions[CSSLayout.DIMENSION_WIDTH] /(style|layout)\.dimensions\[CSS_(WIDTH|HEIGHT)\]/g, function (str, match1, match2) { - return match1 + '.dimensions[DIMENSION_' + match2 + ']'; - }) + return match1 + '.dimensions[DIMENSION_' + match2 + ']'; + }) .replace( // style.maxDimensions[CSS_WIDTH] => style.maxWidth /(style|layout)\.maxDimensions\[CSS_(WIDTH|HEIGHT)\]/g, function (str, match1, match2) { - return match1 + '.max' + match2.substr(0, 1).toUpperCase() + match2.substr(1).toLowerCase(); - }) + return match1 + '.max' + match2.substr(0, 1).toUpperCase() + match2.substr(1).toLowerCase(); + }) .replace( // style.minDimensions[CSS_WIDTH] => style.minWidth /(style|layout)\.minDimensions\[CSS_(WIDTH|HEIGHT)\]/g, function (str, match1, match2) { - return match1 + '.min' + match2.substr(0, 1).toUpperCase() + match2.substr(1).toLowerCase(); - }) + return match1 + '.min' + match2.substr(0, 1).toUpperCase() + match2.substr(1).toLowerCase(); + }) .replace( // style.margin[CSS_TOP] = 12.3 => style.margin[Spacing.TOP].set(12.3) /style\.(margin|border|padding)\[CSS_(TOP|BOTTOM|LEFT|RIGHT|START|END)\]\s+=\s+(-?[\.\d]+)/g, function (str, match1, match2, match3) { @@ -99,8 +99,8 @@ function __transpileSingleTestToJava(code) { .replace( // style.flex_direction => style.flexDirection /style\.([^_\[\]\s]+)_(\w)(\w+)/g, function (str, match1, match2, match3) { - return 'style.' + match1 + match2.toUpperCase() + match3; - }) + return 'style.' + match1 + match2.toUpperCase() + match3; + }) .replace(/(\w+)\.measure\s+=\s+.+/, '$1.setMeasureFunction(sTestMeasureFunction);'); } diff --git a/src/__tests__/Layout-random-test.js b/src/__tests__/Layout-random-test.js index d2da1dc7..355a2779 100644 --- a/src/__tests__/Layout-random-test.js +++ b/src/__tests__/Layout-random-test.js @@ -99,12 +99,12 @@ describe('Random layout', function() { function checkRandomLayout(i, node) { it('should layout randomly #' + i + '.', function(node) { - if (JSON.stringify(computeLayout(node)) !== JSON.stringify(computeDOMLayout(node))) { - node = reduceTest(node); - } + if (JSON.stringify(computeLayout(node)) !== JSON.stringify(computeDOMLayout(node))) { + node = reduceTest(node); + } - testRandomLayout(node, i); - }.bind(this, node)); + testRandomLayout(node, i); + }.bind(this, node)); } for (var i = 0; i < 100; ++i) { diff --git a/src/css-layout.js b/src/css-layout.js index bfa5c74f..5ee1f466 100644 --- a/src/css-layout.js +++ b/src/css-layout.js @@ -17,10 +17,10 @@ root.computeLayout = factory(); } }(this, function () { - // @@include('./Layout.js') + // @@include('./Layout.js') - return function(node) { - computeLayout.fillNodes(node); - computeLayout.computeLayout(node); - }; - })); + return function(node) { + computeLayout.fillNodes(node); + computeLayout.computeLayout(node); + }; +}));