From 4788427f9de7feb533ef206810fed5710a013a52 Mon Sep 17 00:00:00 2001 From: Avital Oliver Date: Tue, 22 Oct 2013 22:02:47 -0700 Subject: [PATCH] Fix spacebars-tests The "inclusion args" tests broke with commit 1c37ac1a982f967bbd1feac67661f584272e8032. Within 'lookup' we were wrapping results in functions even when they were constants. This led `{{> foo bar}}` to not correctly pass `bar` as data into the Template pointed to by `foo`. --- packages/ui/fields.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/ui/fields.js b/packages/ui/fields.js index 7539cfde89..fafd4cf716 100644 --- a/packages/ui/fields.js +++ b/packages/ui/fields.js @@ -89,11 +89,12 @@ _extend(UI.Component, { }; } - return function (/*arguments*/) { - if (typeof result === 'function') { + if (typeof result === 'function') { + return function (/*arguments*/) { var data = getComponentData(self); return result.apply(data, arguments); - } + }; + } else { return result; }; },