| 'use strict'; | |
| module.exports = evalView; | |
| function evalView(input) { | |
| /*jshint evil: true */ | |
| return eval([ | |
| '(function () {', | |
| ' return function (doc) {', | |
| ' var emitted = false;', | |
| ' var emit = function (a, b) {', | |
| ' emitted = true;', | |
| ' };', | |
| ' var view = ' + input + ';', | |
| ' view(doc);', | |
| ' if (emitted) {', | |
| ' return true;', | |
| ' }', | |
| ' }', | |
| '})()' | |
| ].join('\n')); | |
| } |