From 669af2251e8c27395a6d7c03fa104e9a4733e81f Mon Sep 17 00:00:00 2001 From: Maira Bello Date: Wed, 31 Aug 2016 10:24:01 -0300 Subject: [PATCH] Fixes key creation skipping elements with null keys --- packages/metal-jsx/src/JSXRenderer.js | 2 +- packages/metal-jsx/test/JSXRenderer.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/metal-jsx/src/JSXRenderer.js b/packages/metal-jsx/src/JSXRenderer.js index 029bbc2a..54bc89c6 100644 --- a/packages/metal-jsx/src/JSXRenderer.js +++ b/packages/metal-jsx/src/JSXRenderer.js @@ -56,7 +56,7 @@ class JSXRenderer extends IncrementalDomRenderer { handleJSXElementOpened_({args}) { if (childrenCount.length > 0) { const count = ++childrenCount[childrenCount.length - 1]; - if (!core.isDef(args[1])) { + if (!core.isDefAndNotNull(args[1])) { args[1] = JSXRenderer.KEY_PREFIX + count; } } diff --git a/packages/metal-jsx/test/JSXRenderer.js b/packages/metal-jsx/test/JSXRenderer.js index fd2f7739..c130ee58 100644 --- a/packages/metal-jsx/test/JSXRenderer.js +++ b/packages/metal-jsx/test/JSXRenderer.js @@ -157,8 +157,8 @@ describe('JSXRenderer', function() { class TestComponent extends TestJSXComponent { render() { return
- {!this.props.hide &&
} -
+ {!this.props.hide &&
} +
} }