From 944bf0780b1a0979c3a24afa1c07572156f84893 Mon Sep 17 00:00:00 2001 From: Sarah Hayman Date: Fri, 24 Oct 2014 14:04:02 +0100 Subject: [PATCH] Adding hasOwnProperty check to stop lookup on the prototype --- lib/template.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/template.js b/lib/template.js index 14f396d..398178f 100644 --- a/lib/template.js +++ b/lib/template.js @@ -266,7 +266,7 @@ var Hogan = {}; if (scope && typeof scope == 'object') { - if (scope[key] !== undefined) { + if (scope[key] !== undefined && scope.hasOwnProperty(key)) { val = scope[key]; // try lookup with get for backbone or similar model data