From dev-return-13433-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Thu Nov 25 11:15:36 2010 Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 97284 invoked from network); 25 Nov 2010 11:15:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Nov 2010 11:15:35 -0000 Received: (qmail 91290 invoked by uid 500); 25 Nov 2010 11:15:35 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 91035 invoked by uid 500); 25 Nov 2010 11:15:35 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 91027 invoked by uid 99); 25 Nov 2010 11:15:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Nov 2010 11:15:34 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Nov 2010 11:15:33 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oAPBFDRJ025213 for ; Thu, 25 Nov 2010 11:15:13 GMT Message-ID: <27107175.306871290683713660.JavaMail.jira@thor> Date: Thu, 25 Nov 2010 06:15:13 -0500 (EST) From: "afters (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-925) altering 'doc' variable in map function affects other map functions In-Reply-To: <12557320.74301288077320316.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12935723#action_12935723 ] afters commented on COUCHDB-925: -------------------------------- You're right, it does. It's actually a pretty sane behaviour. Thanks Filipe, and Paul. > altering 'doc' variable in map function affects other map functions > ------------------------------------------------------------------- > > Key: COUCHDB-925 > URL: https://issues.apache.org/jira/browse/COUCHDB-925 > Project: CouchDB > Issue Type: Bug > Affects Versions: 1.0.1 > Environment: Erlang R13B03, Spidermonkey 1.7, Ubuntu 10.04 > Reporter: afters > Assignee: Filipe Manana > Attachments: COUCHDB-925.patch > > > 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.