paularmstrong/swig — pull request #354 by josheverett (2013-11-08 04:04:55+00:00)
Title: Fix a few references where `exports.fn` should be `this.fn`.

We found that when setting delimiters and using Swig a la...

var renderer = new swig.Swig({
varControls: ['<<<<', '>>>>']
});

renderer.renderFile('path/to/file', {}, someCallback);

...that the Swig default options were being used to render the file, instead of
the options that we had passed into the Swig constructor. This was due to the
fact that a couple of functions were referencing `exports` instead of `this`
when calling other methods, causing the `defaultInstance` to be the context for
these method calls, instead of the instance we created.

This change resolves our issue, and all tests pass. :)

Huge thanks to @diurnalist for helping to find and fix this issue!