Closed
Bug 791068
Opened 13 years ago
Closed 13 years ago
Invalid conditional attribution
Categories
(Firefox :: Untriaged, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: rcsilva83, Unassigned)
Details
Attachments
(4 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20100101 Firefox/15.0.1
Build ID: 20120905151427
Steps to reproduce:
I have the following Javascript that I use to "mock" some HTML5 features on my testing environment:
if (navigator.userAgent === 'JWebUnit') {
var Worker = function() {
this.postMessage = function(obj) {
var result = {
data: {
hash: '122121212121212212'
}
};
this.onmessage(result);
};
};
Object.prototype.size = function() { return 99; };
Object.prototype.slice = function(inicio, fim) { return this; };
}
Actual results:
When I run my application on Firefox 15.0.1, the "Worker" function becomes "undefined". If I comment the lines that that make the attibution to "Worker", the application runs fine.
This problem only happens when this .js file is loaded. If I run "alert(typeof(Worker));" before this file is loaded, it shows "function" instead of "undefined"
This problem doesn't happen on Firefox 10 or Chrome 21.
Expected results:
It should not "override" the "Worker" function on Firefox 15, only on my testing environment.
Comment 1•13 years ago
|
||
Could you please attach a full testcase that can be directly run in the browser ?
| Reporter | ||
Comment 2•13 years ago
|
||
| Reporter | ||
Comment 3•13 years ago
|
||
| Reporter | ||
Comment 4•13 years ago
|
||
| Reporter | ||
Comment 5•13 years ago
|
||
Hi, Matthias
I've just created 3 simple HTML files, each one is a testcase.
Let me know if you need something else.
Regards.
Updated•13 years ago
|
Attachment #660930 -
Attachment mime type: application/octet-stream → text/javascript
Comment 6•13 years ago
|
||
Attachment #660937 -
Attachment is obsolete: true
Comment 7•13 years ago
|
||
I get "function" with Seamonkey trunk and I can reproduce this with Firefox15.0.1
Is this already fixed ?
I used https://bugzilla.mozilla.org/attachment.cgi?id=660973 for my test
Comment 8•13 years ago
|
||
I always get "function" with the testcase and Firefox16beta.
This should be fixed in FF16, marking worksforme
Reporter: Thanks for the bug report and the testcase !
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
| Reporter | ||
Comment 9•13 years ago
|
||
No problem, Matthias. It is my pleasure to help Firefox to be best browser out there! I hope this problem doesn't affects nobody else until FF16 is out.
Regards,
Rodrigo
You need to log in
before you can comment on or make changes to this bug.
Description
•