gecko-dev/js
nboyd%atg.com 88e610fce6 Fix bug found by felix.meschberger@day.com:
given the following object :

----------------------------------------------
function SomeObject() {}
SomeObject.prototype.exec = function() {
  var local = this.someField;
}
----------------------------------------------

i create an 'instance', set a field and call the exec method :

----------------------------------------------
var someField = "global field value";
var anInstance = new SomeObject();
anInstance.someField = "instance field value";
anInstance.exec();
----------------------------------------------

then the local variable 'local' in the exec() method is assigned the value
of the global 'someField' variable instead of the instance field value.

the problem seems to be in the ScriptRuntime.callOrNewSpecial() method,
which is called, because the parser treats the name 'exec' specially. in
this method the exec() method gets called with

   return call(cx, fun, thisArg, args, scope);

where the 'thisArg' parameter really is the global this value instead of
the dynamic this value, which is in the jsThis variable and which would be
the one needed...

is it legitimate to replace the above call in callOrNewSpecial() with the
following line :

   return call(cx, fun, jsThis, args, scope);

this seems to only happen for methods named 'exec', which are identified as
special in the NodeTransformer.isSpecialCallName() method.

any help is appreciated. thank you very much for your time.

kind regards,
felix
2002-05-30 13:41:16 +00:00
..
benchmarks
docs add PERL_BIN and PERL_ARGS 2002-05-14 01:44:01 +00:00
jsd Fixes mozilla/strings requiring unfrozen nsCRT class. patch by scc, r=dougt, sr=jag, b=136756 2002-05-15 18:55:21 +00:00
jsdj Bug 106386 rid source of misspellings 2002-03-19 04:30:17 +00:00
jsj
macbuild Fix for smoketest blocker 135697. Bump up version on the compiler test to force JS to be compiled with opt level 2. a=leaf. 2002-04-05 19:06:29 +00:00
ref
rhino Fix bug found by felix.meschberger@day.com: 2002-05-30 13:41:16 +00:00
src patch to speed up array.sort of strings by 40% r=brendan, sr=shaver 2002-05-27 05:53:57 +00:00
tests Removing this test. It has been superseded by test ecma_3/Function/15.3.4.3-1.js 2002-05-22 06:01:09 +00:00
.cvsignore
landbranch.pl
Makefile.in bug 76050, build js/jsd from toplevel makefile so we're sure we've got an xpidl compiler. r=cls 2001-05-15 20:38:26 +00:00
makefile.win