Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.0.1
-
None
-
N/A
-
New Contributors Level (Easy)
Description
The Javascript query server's runProvides() function currently calls the functions with this referencing the sandbox object. Instead, it should reference the design doc object, the same as in the outer show or list function.
Patch to fix:
https://github.com/couchtim/couchdb/commit/49cca724cb3aa76de339f55827e84259bf2da6ea
A workaround for now is to save the value of this in the outer function, like:
lists: { foo: function(head, req) { var that = this; provides('html', function()
{ var value_from_ddoc = that.some_value; }); } }