Abjectscript is just such a great language. I fixed two bugs in here that the

compiler never wanted to tell me about.
- I was trying to store read values into the streamer itself, referecing
  it as "this[ii]". This turns out to be legal, even though the class is
  sealed, because you can access public fields using the [] operator with
  a string argument. At runtime, ii == 0, it got Stringdafied to "0" and
  then a field called "0" was looked up on the class and oh no, it didn't
  exist.
- Worse, I had a line that referenced "length" instead of "arr.length".
  There is no length defined in the class, nor is there one in the superclass.
  It turns out the base class Object has an undocumented constant called
  length that seems to always be 0. Isn't that special?


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4333 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-08-21 21:39:14 +00:00
parent ff274735a9
commit 67a4eecc15
@@ -133,7 +133,7 @@ public class ArrayStreamer extends Streamer
} else if (_isFinal) {
var mask :ArrayMask = new ArrayMask();
mask.readFrom(ins);
for (ii = 0; ii < length; ii++) {
for (ii = 0; ii < arr.length; ii++) {
if (mask.isSet(ii)) {
var target :Object;
if (_delegate == null) {
@@ -142,7 +142,7 @@ public class ArrayStreamer extends Streamer
target = _delegate.createObject(ins);
}
ins.readBareObjectImpl(target, _delegate);
this[ii] = target;
arr[ii] = target;
}
}