Closed Bug 955512 Opened 10 years ago Closed 10 years ago

TypeError: setting a property that has only a getter

Categories

(Instantbird Graveyard :: Other, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: benediktp, Assigned: nhnt11)

References

Details

Attachments

(1 file)

*** Original post on bio 2075 at 2013-07-28 09:28:00 UTC ***

Timestamp: 28.07.2013 11:01:45
Warning: TypeError: setting a property that has only a getter
Source File: resource://gre/components/ibConvStatsService.js
Line: 162

Apparently my suggestion to replace the getter with its value after the first call wasn't really the best idea. I've only tried if it worked on a normal object while I should have actually tested on something like this:


var x = {
  get y() {
    Components.utils.reportError("Running getter...");
    delete this.y;
    return this.y = "B";
  }
};

function a() {}
a.prototype = {
  __proto__: x
};

var b = new a();
b.y + " " + b.y


Running this on the error console does NOT show "Running getter..." and "B B" but the same TypeError that been reported :( It does output "B B" eventually though.

I don't know exactly why it fails by the way.
Blocks: 955492
Attached patch PatchSplinter Review
*** Original post on bio 2075 as attmnt 2655 at 2013-07-30 11:58:00 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8354424 - Flags: review?(aleth)
Assignee: nobody → nhnt11
Status: NEW → ASSIGNED
Comment on attachment 8354424 [details] [diff] [review]
Patch

*** Original change on bio 2075 attmnt 2655 at 2013-07-30 12:03:56 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8354424 - Flags: review?(aleth) → review+
Whiteboard: [checkin-needed]
*** Original post on bio 2075 at 2013-08-01 03:49:25 UTC ***

http://hg.instantbird.org/instantbird/rev/9deb70968e96
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [checkin-needed]
Target Milestone: --- → 1.5
You need to log in before you can comment on or make changes to this bug.