couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <paul.joseph.da...@gmail.com>
Subject Re: JavaScript specification changes at 0.11?
Date Thu, 25 Mar 2010 14:10:15 GMT
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 <yssk22@gmail.com> 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){
>   this["hello"] = function(){
>      return "hello";
>   };
>   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/
>

Mime
View raw message