NEW 27922
Strict equality of MimeType host objects is not respected
https://bugs.webkit.org/show_bug.cgi?id=27922
Summary Strict equality of MimeType host objects is not respected
Tobie Langel
Reported 2009-08-01 11:29:58 PDT
Strict equality of Host objects of [[Class]] MimeType isn't respected (not that it's mandated by any specs). To reproduce: window.navigator.mimeTypes[0] === window.navigator.mimeTypes[0]; // returns false (expected true). Given that: var mt = window.navigator.mimeTypes[0]; mt === mt; // returns true (as expected); I suspect that new wrappers are created each time the property is accessed. Platforms affected: Safari Version 4.0.1 (5530.18) on Mac 10.5.7 Webkit nightly Version 4.0.1 (5530.18), r46646 Mac OS 10.5.7 haven't tried elsewhere.
Attachments
Sam Weinig
Comment 1 2009-08-01 15:13:26 PDT
Yeah, this is quite unfortunate. We create a new MimeType for every invocation of the item method. PassRefPtr<MimeType> MimeTypeArray::item(unsigned index) { PluginData* data = getPluginData(); if (!data) return 0; const Vector<MimeClassInfo*>& mimes = data->mimes(); if (index >= mimes.size()) return 0; return MimeType::create(data, index).get(); }
Nikita Vasilyev
Comment 2 2010-02-24 14:52:47 PST
Furthermore, navigator.mimeTypes[0] == navigator.mimeTypes[0] // true Also, navigator.mimeTypes[0] == navigator.mimeTypes[0].enabledPlugin[0] == navigator.mimeTypes[0].enabledPlugin[0].enabledPlugin[0] // should be true, but false I'm trying to serialize whole window object to a string, but I've a problems with navigator.mimeTypes due to circular references and broken '=='.
Nikita Vasilyev
Comment 3 2010-03-20 04:13:49 PDT
(In reply to comment #2) > Furthermore, navigator.mimeTypes[0] == navigator.mimeTypes[0] // true Whoops. I mean false!
Note You need to log in before you can comment on or make changes to this bug.