Skip to content
Myr

made`str` local

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by mgutz · committed by Tj Holowaychuk · parent 544d688 · Browse files · 2 files+17 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+17 added−3 removed

  • tests:+15 added−1 removed
  • other:+2 added−2 removed

2 files+17 added−3 removed

modified:lib/express/view.js+2 added-2 removed
248 unmodified lines
249 try {250 var engine = view.templateEngine251 , template = cacheTemplates252 ? cache[view.path] || (cache[view.path] = engine.compile(view.contents, options))253 : engine.compile(view.contents, options);254 str = template.call(options.scope, options);253 : engine.compile(view.contents, options)254 , str = template.call(options.scope, options);255 } catch (err) {256 return error(err);257 }258
15 unmodified lines
modified:test/view.test.js+15 added-1 removed
767 unmodified lines
768 769 assert.response(app,770 { url: '/' },771 { body: '<p>This is actually jade :)</p>' });772 },773774 'test global-variable-leak `str`': function() {775 var app = create();776 app.set('view engine', 'jade');777 778 app.get('/', function(req, res){779 res.render('index', { layout: 'cool-layout' });780 assert.equal(typeof global.str, 'undefined');781 });782783 assert.response(app,784 { url: '/' },785 { body: '<cool><p>Welcome</p></cool>' });786 }773};787};