Closed Bug 791068 Opened 13 years ago Closed 13 years ago

Invalid conditional attribution

Categories

(Firefox :: Untriaged, defect)

15 Branch
x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: rcsilva83, Unassigned)

Details

Attachments

(4 files, 1 obsolete file)

Attached file html5-mock.js
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.
Could you please attach a full testcase that can be directly run in the browser ?
Attached file HTML file that reproduces the error (obsolete) —
Hi, Matthias I've just created 3 simple HTML files, each one is a testcase. Let me know if you need something else. Regards.
Attachment #660930 - Attachment mime type: application/octet-stream → text/javascript
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
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
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.

Attachment

General

Created:
Updated:
Size: