Subj : Re: js_GetArgument To : Brendan Eich From : Phil Schwartau Date : Thu Jun 05 2003 06:06 pm I coudn't see this on file anywhere, so I filed: http://bugzilla.mozilla.org/show_bug.cgi?id=208496 "Incorrect scope when |with (f)| is used inside the definition of |function f()|" I have cc'ed Itaj, and added his testcase to the JS testsuite: mozilla/js/tests/js1_5/Scope/regress-208496.js Phil Brendan Eich wrote: > itaj sherman wrote: > >> then i'll go back to my first example because i think there is another >> incompatibility there (with ECMA and IE): >> >> function MyFunc( par ) >> { >> var a = par; >> with( MyFunc ) { >> var b = par; >> } >> } >> >> in IE both a and b get the value the actual passed argument. >> with SpiderMonkey of mozilla 1.31, b will be undefined, because the >> lookup >> finds 'par' on MyFunc which is the first on the scope chain, and then >> getProperty is activated on MyFunc, using js_GetAegument(). >> > > You're right, that's a bug. I don't know whether it's on file > already; cc'ing Phil. > > One lesson here: don't use with! It is an abomination in my eyes. > > /be > .