documentcloud/underscore — Issue #411: Template containing text "null" causes error if templateSettings has evaluate undefined
Author: bradlord
Created: 2011-12-21 16:11:50+00:00
State: open

The following code differs from an example in the documentation only in the content of the template string, but it results in a TypeError.

```javascript
_.templateSettings = {
interpolate : /\{\{(.+?)\}\}/g
};

var template = _.template("Hello null {{ name }}!");
template({name : "Mustache"});
```

A TypeError also occurs if the template string contains the text "undefined", probably due to the lack of templateSettings.escape regex.