Subj : Re: xpcshell js object getters aren't working as of 1.4 To : Pete Collins From : Brendan Eich Date : Wed Jun 11 2003 12:23 am This is a multi-part message in MIME format. --------------030205070601010905080804 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------030205070601010905080804 Content-Type: text/plain; name="od" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="od" 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++; --------------030205070601010905080804-- .