Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 64486 invoked from network); 25 Mar 2010 14:11:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Mar 2010 14:11:04 -0000 Received: (qmail 97666 invoked by uid 500); 25 Mar 2010 14:11:04 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 97633 invoked by uid 500); 25 Mar 2010 14:11:04 -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 97624 invoked by uid 99); 25 Mar 2010 14:11:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Mar 2010 14:11:04 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.211.175 as permitted sender) Received: from [209.85.211.175] (HELO mail-yw0-f175.google.com) (209.85.211.175) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Mar 2010 14:10:57 +0000 Received: by ywh5 with SMTP id 5so2575314ywh.13 for ; Thu, 25 Mar 2010 07:10:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:received:message-id:subject:to:content-type :content-transfer-encoding; bh=I6bsiARG0ZBzih4Q9PN2JzvJFL8CvTXhE9LrHk+Ez9o=; b=UGsNFHuJx0YJsL9w1qzuQ48CuRwtiaxQfmexx9aLED7psIOjjSaiRYy+4gikIRyuE4 jJBDkqq4sK+4m8iCmUme1tWxP7FmKGv8lLKZDjfvzN4d+qzUZS9ww/uTiO4ShuJq/lpX 8KdGMJHIBZUvNi0r842plLygaHk06zvAAr4dU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=bRIGSZKz0jem9RKqKTdBw59HoX67KEMKsk/3Pt96mIcgkCSz9s9ixZW/sHiCuseJ7W v4Y8MtGYHmawEQv+l2gqtIhCgKBdsGXbBluOUf87c1GrOrMHSQOOul2Fcjto8OPzfQDM N8ejT91TkGvmfF9rf60zJt6YHvBUoZUBgAYbE= MIME-Version: 1.0 Received: by 10.100.229.20 with HTTP; Thu, 25 Mar 2010 07:10:15 -0700 (PDT) In-Reply-To: <717bc8231003250648u21b62f4eqb729c5c3f02a8511@mail.gmail.com> References: <717bc8231003250648u21b62f4eqb729c5c3f02a8511@mail.gmail.com> From: Paul Davis Date: Thu, 25 Mar 2010 10:10:15 -0400 Received: by 10.150.141.14 with SMTP id o14mr1147727ybd.131.1269526235267; Thu, 25 Mar 2010 07:10:35 -0700 (PDT) Message-ID: Subject: Re: JavaScript specification changes at 0.11? To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org The fact that you used to be able to attach to the 'this' object was definitely just a coincidence. I'm fairly surprised it even worked consistently for you. That said, it looks like you're wanting to check out the require("path.to.stuff") method that's now available for show and list. This will let you define arbitrary JS in your _design doc and import it in your show/list functions. HTH, Paul Davis On Thu, Mar 25, 2010 at 9:48 AM, Yohei SASAKI wrote: > Hello, > > I tried some my snnipets on CouchDB 0.11.0, but several code fails. > One of big issue for me is the following code (which works on 0.10) > does not work on 0.11. > > // _design/app/_show/test > function(doc, req){ > =A0 this["hello"] =3D function(){ > =A0 =A0 =A0return "hello"; > =A0 }; > =A0 return hello(); > } > > I use "this" object to register global (show/list function wide) > methods and variables > like as window object on client side javascipt. > > I can make workaround for 0.11.0, but I'd like to know this change > is a intended specification change or an bug. > > Thanks. > > -- > Yohei SASAKI > http://www.yssk22.info/ >