From user-return-18113-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Thu Sep 29 11:24:24 2011 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BAA239428 for ; Thu, 29 Sep 2011 11:24:24 +0000 (UTC) Received: (qmail 46104 invoked by uid 500); 29 Sep 2011 11:24:23 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 45972 invoked by uid 500); 29 Sep 2011 11:24:22 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 45963 invoked by uid 99); 29 Sep 2011 11:24:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Sep 2011 11:24:22 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of matt.goodall@gmail.com designates 209.85.210.180 as permitted sender) Received: from [209.85.210.180] (HELO mail-iy0-f180.google.com) (209.85.210.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Sep 2011 11:24:14 +0000 Received: by iahk25 with SMTP id k25so849846iah.11 for ; Thu, 29 Sep 2011 04:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=sfdjF72AF+Guz3XtszMCcP0R6g7stX9MysKIMx1tjEc=; b=PPcK9/H4L4/AuD8huv6vMKUEw5Ae5Ry2ZemIhvsmLsvnH4HwB2XtQkS6iKK1Ipogcj oWqGLq1qojSmBIHYZDFsiUmn2OdXUazirP0vzRKbZ68+2W+G1CANw/8ZOqxQ+8drpqaH nvGL/4MgWqkQdAYJ+8MDlrysXbvb2OoYRlEsA= MIME-Version: 1.0 Received: by 10.231.25.210 with SMTP id a18mr7827397ibc.31.1317295433878; Thu, 29 Sep 2011 04:23:53 -0700 (PDT) Received: by 10.231.37.13 with HTTP; Thu, 29 Sep 2011 04:23:53 -0700 (PDT) Date: Thu, 29 Sep 2011 12:23:53 +0100 Message-ID: Subject: Warning: minor incompatability in the 1.1.x branch with map helper functions From: Matt Goodall To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hi, I just tested an app against the latest 1.1.x branch and discovered something annoying but easily fixable in a view. I have a view with something like the following for the map part: function some_helper() { return "blah"; } function(doc) { emit(doc._id, some_helper()); } Note how the some_helper func is defined *outside* the anonymous map func. This used to work until the "Fix function evaluation by newer SpiderMonkey's" commit (61f10e7590bd352b367ad426a56587cbef3700b6) on 27th Sept. Now, I'm honestly not sure why I have a helper func outside the actual map func - it certainly looks a bit weird - so I'm going to move it inside. However, I'm fairly sure I saw that done somewhere else, so I thought I'd post a quick warning in case it affects anyone else. - Matt