From 8c02af42dda23fdb4ed5acdb1e3480cadc41f338 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 11 Jan 2015 11:27:37 -0800 Subject: [PATCH] Fix `scope` handling Also do not override `context`, which is the newer option. Fixes #19 --- lib/ejs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ejs.js b/lib/ejs.js index ea0933b9..cab7a42a 100644 --- a/lib/ejs.js +++ b/lib/ejs.js @@ -158,8 +158,8 @@ exports.render = function () { // 'scope' is 'context' // FIXME: Remove this in a future version if (opts.scope) { - opts.context = opts.scope; - delete opts.context; + if (!opts.context) opts.context = opts.scope; + delete opts.scope; } if (opts.cache) {