Stop using Object.prototype.__proto__ because of bug 948227

RESOLVED FIXED in 1.6

Status

Chat Core
General
--
minor
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: clokep, Assigned: clokep)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [1.6-blocking])

Attachments

(5 attachments, 1 obsolete attachment)

(Assignee)

Comment 1

4 years ago
Apparently Florian had provided a complete list and I missed it:
chat/modules/imContentSink.jsm:194:  aResult.tags.__proto__ = aBase.tags;
chat/modules/imContentSink.jsm:195:  aResult.attrs.__proto__ = aBase.attrs;
chat/modules/imContentSink.jsm:196:  aResult.styles.__proto__ = aBase.styles;
chat/modules/imThemes.jsm:92:  this.__proto__ = HTMLTheme_prototype;
chat/protocols/jsTest/jsTestProtocol.js:34:Conversation.prototype.__proto__ = GenericConvIMPrototype;
chat/protocols/jsTest/jsTestProtocol.js:72:Account.prototype.__proto__ = GenericAccountPrototype;
chat/protocols/jsTest/jsTestProtocol.js:93:jsTestProtocol.prototype.__proto__ = GenericProtocolPrototype;
chat/protocols/yahoo/yahoo.js:75:YahooConversation.prototype.__proto__ = GenericConvIMPrototype;
chat/protocols/yahoo/yahoo.js:143:YahooConference.prototype.__proto__ = GenericConvChatPrototype;
chat/protocols/yahoo/yahoo.js:155:YahooConferenceBuddy.prototype.__proto__ = GenericConvChatBuddyPrototype;
chat/protocols/yahoo/yahoo.js:170:YahooAccountBuddy.prototype.__proto__ = GenericAccountBuddyPrototype;
chat/protocols/yahoo/yahoo.js:522:YahooAccount.prototype.__proto__ = GenericAccountPrototype;
im/components/ibConvStatsService.js:249:          stats.__proto__ = ConversationStats.prototype;
im/content/debug/fake/fake.js:376:  this.__proto__ = aChatNick ? GenericConvChatPrototype : GenericConvIMPrototype;
(Assignee)

Comment 2

4 years ago
Created attachment 8365019 [details] [diff] [review]
Part 1 (the easy ones)
Attachment #8365019 - Flags: review?(florian)
Attachment #8365019 - Flags: review?(florian) → review+
Created attachment 8390082 [details] [diff] [review]
Part 2 (imThemes.jsm)
Attachment #8390082 - Flags: review?(clokep)
(Assignee)

Updated

4 years ago
Attachment #8390082 - Flags: review?(clokep) → review+
(Assignee)

Comment 4

4 years ago
Looks like the following are left:

> chat/modules/imContentSink.jsm:194:  aResult.tags.__proto__ = aBase.tags;
> chat/modules/imContentSink.jsm:195:  aResult.attrs.__proto__ = aBase.attrs;
> chat/modules/imContentSink.jsm:196:  aResult.styles.__proto__ = aBase.styles;
> im/components/ibConvStatsService.js:249:          stats.__proto__ = ConversationStats.prototype;
> im/content/debug/fake/fake.js:376:  this.__proto__ = aChatNick ? GenericConvChatPrototype : GenericConvIMPrototype;
(In reply to Patrick Cloke [:clokep] from comment #4)

> > chat/modules/imContentSink.jsm:194:  aResult.tags.__proto__ = aBase.tags;
> > chat/modules/imContentSink.jsm:195:  aResult.attrs.__proto__ = aBase.attrs;
> > chat/modules/imContentSink.jsm:196:  aResult.styles.__proto__ = aBase.styles;

I'll try to have a look at these.

> > im/components/ibConvStatsService.js:249:          stats.__proto__ = ConversationStats.prototype;

nhnt11, can you look into this one?

> > im/content/debug/fake/fake.js:376:  this.__proto__ = aChatNick ? GenericConvChatPrototype : GenericConvIMPrototype;

This one seems relatively easy. I think we can use Object.create, like the warning suggests.
(Assignee)

Updated

4 years ago
Flags: needinfo?(nhnt11)
Created attachment 8410492 [details] [diff] [review]
Part 3 (Stats Service)
Attachment #8410492 - Flags: review?(florian)
Flags: needinfo?(nhnt11)
Attachment #8410492 - Flags: review?(florian) → review+

Updated

4 years ago
Whiteboard: [1.6-blocking]

Updated

4 years ago
Keywords: checkin-needed

Updated

4 years ago
Keywords: checkin-needed

Comment 7

4 years ago
Created attachment 8451349 [details] [diff] [review]
Part 4 (imContentSink.jsm)
Attachment #8451349 - Flags: review?(florian)
Attachment #8451349 - Flags: review?(florian) → review+
(Assignee)

Comment 8

4 years ago
Anyone will to take a look at Fake or do we just not care enough since it isn't in the released product?
Created attachment 8451544 [details] [diff] [review]
Part 5 (fake.js)

Note: setting the review flag on clokep as he asked about Fake, but anybody should feel free to steal that trivial review.

(In reply to Patrick Cloke [:clokep] from comment #8)
> Anyone will to take a look at Fake or do we just not care enough since it
> isn't in the released product?

I'm hoping that Fake could become a basis for some future UI tests, so I would prefer that we don't break it. I've just had a quick look. Untested (but I don't think it's worth testing right now).
Attachment #8451544 - Flags: review?(clokep)

Updated

4 years ago
Attachment #8451544 - Flags: review?(clokep) → review+

Updated

4 years ago
Keywords: checkin-needed
(Assignee)

Comment 10

4 years ago
Created attachment 8452581 [details] [diff] [review]
Part 1 (the easy ones) unbitrotted

Uploading an unbitrotted version of attachment 8365019 [details] [diff] [review]. These should all apply cleanly for checkin now. (Although the tree is closed.)
Assignee: nobody → clokep
Attachment #8365019 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8452581 - Flags: review+
Depends on: 1037974
You need to log in before you can comment on or make changes to this bug.