(input)
| 4068 | } |
| 4069 | |
| 4070 | function evalView(input) { |
| 4071 | var code = [ |
| 4072 | 'return function(doc) {', |
| 4073 | ' "use strict";', |
| 4074 | ' var emitted = false;', |
| 4075 | ' var emit = function (a, b) {', |
| 4076 | ' emitted = true;', |
| 4077 | ' };', |
| 4078 | ' var view = ' + input + ';', |
| 4079 | ' view(doc);', |
| 4080 | ' if (emitted) {', |
| 4081 | ' return true;', |
| 4082 | ' }', |
| 4083 | '};' |
| 4084 | ].join('\n'); |
| 4085 | |
| 4086 | return scopeEval(code, {}); |
| 4087 | } |
| 4088 | |
| 4089 | function validate(opts, callback) { |
| 4090 | if (opts.selector) { |