Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7BB417FF5 for ; Thu, 6 Oct 2011 08:56:34 +0000 (UTC) Received: (qmail 48435 invoked by uid 500); 6 Oct 2011 08:56:34 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 48397 invoked by uid 500); 6 Oct 2011 08:56:34 -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 48389 invoked by uid 99); 6 Oct 2011 08:56:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2011 08:56:33 +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 (athena.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.220.180 as permitted sender) Received: from [209.85.220.180] (HELO mail-vx0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2011 08:56:28 +0000 Received: by vcbf11 with SMTP id f11so3148034vcb.11 for ; Thu, 06 Oct 2011 01:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=mUsjjJqiSVvIboDk/8doF5837fADE3NLSBo6Mf8wkDE=; b=nJTk4hogUdEv/J6YQ2jVdwfUmQYbzGyVJE6lkKJXCHyoJqWe4VlqPVpaoJC4dm7hV2 ysWft7rhPkrm0ga9A2ew85xRyyGWY/FlffQ+DJtOTBcHFvGYsEozZSkmURR+HtlYD9eK GVfTfl2Gyk1y8vq+bNsMnkxGw7c3tjgVtQrh8= Received: by 10.52.65.109 with SMTP id w13mr452530vds.21.1317891368123; Thu, 06 Oct 2011 01:56:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.160.130 with HTTP; Thu, 6 Oct 2011 01:55:28 -0700 (PDT) In-Reply-To: References: From: Paul Davis Date: Thu, 6 Oct 2011 03:55:28 -0500 Message-ID: Subject: Re: CouchDB 1.1.1 To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 On Thu, Oct 6, 2011 at 3:29 AM, Dirkjan Ochtman wrote: > On Thu, Oct 6, 2011 at 10:25, Paul Davis wrote: >> +1 on removing the paren hack for sure. > > Can you elaborate on what the paren hack is? Unfotunately, SM 1.8.5 breaks the ability to evaluate anonymous functions at global scope. So all CouchDB code examples are effectively broken. The "fix" is to wrap the function in parentheses to trick the parser into returning the anonymous function. Ie, Given a standard CouchDB map function like: function(doc) { if(doc.my_type) emit(doc.my_type, 1); } The "fix" is to do: (function(doc) { if(doc.my_type) emit(doc.my_type, 1); }) However, if people are using helper functions at global scope, it turns into this: (var f = function() {return 2;}; function(doc) { if(doc.my_type) emit(doc.my_type, f()); }) Which is an error on all versions of SpiderMonkey. Basically, SpiderMonkey got stricter about following the spec by hard coding a check for the exact type of anonymous function declarations that CouchDB has relied on (unknowingly in my case) for years. > >> Not sure about removing 1.8.5 support completely. On the one hand, it >> would prevent breakage because people couldn't link against the >> breaking SM. On the other hand, it prevents people from linking >> against 1.8.5 which means it won't build on Ubuntu 11.x. > > That seems problematic. With my packager hat on, I would also prefer > if 1.8.5 support came sooner rather than later. > > Cheers, > > Dirkjan >