Closed Bug 508061 Opened 15 years ago Closed 11 years ago

INITELEM behavior differs with -j

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME
mozilla21

People

(Reporter: jorendorff, Unassigned)

Details

function loop() {
    var x;
    for (var i = 0; i < 9; i++)
        x = {1.5: 1};
    return x;
}

loop(); // record
Object.prototype.__defineSetter__('1.5', function () { return 'BAD'; });
var x = loop(); // playback
assertEq(x["1.5"], 1);

//without -j:   test passes.
//with -j:      TypeError: Assertion failed: got (void 0), expected 1
I found this after reading the following code:

  JS_REQUIRES_STACK JSRecordingStatus
  TraceRecorder::record_JSOP_INITELEM()
  {
      return record_JSOP_SETELEM();
  }

which seemed so implausible that I felt compelled to write a few test cases.
However, none of my tests broke in quite the way I expected, so I really
have no idea what causes this bug!
I think that has been fixed.
https://hg.mozilla.org/mozilla-central/rev/de56ae61946d
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Resolution: FIXED → WORKSFORME
You need to log in before you can comment on or make changes to this bug.