couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Smith (JIRA)" <j...@apache.org>
Subject [jira] Created: (COUCHDB-959) runProvides should set this to design doc for show and list funcs
Date Mon, 22 Nov 2010 09:17:13 GMT
runProvides should set this to design doc for show and list funcs
-----------------------------------------------------------------

                 Key: COUCHDB-959
                 URL: https://issues.apache.org/jira/browse/COUCHDB-959
             Project: CouchDB
          Issue Type: Bug
          Components: JavaScript View Server
    Affects Versions: 1.0.1
         Environment: N/A
            Reporter: Timothy Smith
            Priority: Minor


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; }); } }



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message