couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Joseph Davis (JIRA)" <>
Subject [jira] Commented: (COUCHDB-925) altering 'doc' variable in map function affects other map functions
Date Wed, 27 Oct 2010 20:49:19 GMT


Paul Joseph Davis commented on COUCHDB-925:

It would appear that the error occurred on early versions of the 1.9.x branch of spidermonkey.
It has since been patched into 1.9.1 and 1.9.2 Unfortunately there its not really easy to
define what that means in terms of what people may have installed on their machines.

If someone wants to write a patch for this, it may be easiest to just seal objects and ignore
the error, and then have a Futon tests that tells people whether or not it works. I'm not
entirely certain if that's the best approach, but its the best I can think of right at this

The original SM bug is here:

> altering 'doc' variable in map function affects other map functions
> -------------------------------------------------------------------
>                 Key: COUCHDB-925
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>         Environment: Erlang R13B03, Spidermonkey 1.7, Ubuntu 10.04
>            Reporter: afters
> I have the following two map functions (v1.0.1):
> function (doc) {
>   emit(doc.path[0], null);
> }
> function (doc) {
>  doc.path = [ 'an intruder from another view' ];
> }
> When the views are built, the first map function sees a 'doc' variable that
> was changed by the second map function, and thus emits the key 'an intruder
> from another view'.
> The real documents remain untouched.

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

View raw message