Subj : Re: xpcshell js object getters aren't working as of 1.4 To : Brendan Eich From : Pete Collins Date : Wed Jun 11 2003 11:24 am Ok, object getters seem to fail after I use the subscript loader which jslib uses to implement "include" func. How do I know this you ask? Well, I manually loaded jslib libraries using load() and they work fine. It seems when they are loaded via the subscript loader getters stop working. I'll break this out into a bug. --pete Brendan Eich wrote: > Pete Collins wrote: > >>> Pete, can you try the following in your js\src directory: >>> >>> cvs update -j3.142 -j3.141 jsobj.c >> >> >> js> function foo() {} >> js> foo.prototype = { >> get bar () { print ('test'); } >> } >> [object Object] >> js> var f = new foo(); >> js> f.bar; >> test >> js> >> >> Works now w/ the 3.141 join. >> >> $ build/autoconf/config.guess >> i686-pc-linux-gnu >> >> $ uname -a >> Linux linuxbox 2.4.20-9smp #1 SMP Wed Apr 2 13:28:49 EST 2003 i686 >> i686 i386 GNU/Linux > > > > Weird -- I still can't reproduce. What does gcc --version say? > > Can you undo the join (rm jsobj.c; cvs up -A jsobj.c) and the apply the > attached patch, and let me know if, in a debug build, you see the > JS_ASSERT(cx->resolving); that the patch adds fail? Thanks, > > /be > > > ------------------------------------------------------------------------ > > Index: jsobj.c > =================================================================== > RCS file: /cvsroot/mozilla/js/src/jsobj.c,v > retrieving revision 3.146 > diff -p -u -8 -r3.146 jsobj.c > --- jsobj.c 8 Jun 2003 20:31:06 -0000 3.146 > +++ jsobj.c 11 Jun 2003 06:22:18 -0000 > @@ -2284,16 +2284,17 @@ js_LookupProperty(JSContext *cx, JSObjec > if (!entry) { > outofmem: > JS_UNLOCK_OBJ(cx, obj); > JS_ReportOutOfMemory(cx); > return JS_FALSE; > } > if (entry->key.obj) { > /* An entry for key exists already -- damp recursion. */ > + JS_ASSERT(cx->resolving); > JS_ASSERT(entry->key.obj == obj && entry->key.id == id); > JS_UNLOCK_OBJ(cx, obj); > goto out; > } > entry->key = key; > generation = table->generation; > cx->resolving++; > .