kanso/kanso — Issue #361: setting 'this' in show functions
Author: ryanramage
Created: 2012-01-31 23:44:25+00:00
State: open

I need to access the design doc attachments array in a show function. But the way kanso wraps the show function, 'this' is not resolving to the design doc.

How my show functions are getting wrapped, in the design doc.

```json
{
"not_found": "function(doc, req){var core = require(\"duality/core\");var fn = require(\"lib/app\")[\"shows\"][\"not_found\"];return core.runShow(fn, doc, req);}",
"recorder.jnlp": "function(doc, req){var core = require(\"duality/core\");var fn = require(\"lib/app\")[\"shows\"][\"recorder.jnlp\"];return core.runShow(fn, doc, req);}"
}
```

maybe we can do

core.runShow.call(this, fn, doc, req)