[
https://issues.apache.org/jira/browse/COUCHDB-959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Timothy Smith updated COUCHDB-959:
----------------------------------
Attachment: provides-this.patch
Patch for this issue
> 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
> Attachments: provides-this.patch
>
> Original Estimate: 0.5h
> Remaining Estimate: 0.5h
>
> 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.