Closed Bug 976018 Opened 11 years ago Closed 11 years ago

wrap window.Worker

Categories

(Core :: DOM: Workers, defect)

27 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 928312

People

(Reporter: pieter-jan.speelmans, Unassigned)

References

()

Details

(Whiteboard: [bugday-20140303])

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 (Beta/Release)
Build ID: 20140212131424

Steps to reproduce:

Overwriting window.Worker with a custom function breaks all worker functionality.
For example (see more detailed jsfiddle below):
var NativeWorker = window.Worker;
var worker = new NativeWorker('script.js'); worker.terminate(); // OK
var worker2 = new Worker('script.js'); worker.terminate(); // OK
window.Worker = function () {};
var worker3 = new NativeWorker('script.js'); worker.terminate(); // NOT OK, worker3 does not have any methods - worker3.terminate is not a function

http://jsfiddle.net/MeKdT/


Actual results:

Even tho the worker is constructed, a TypeError is thrown indicating that terminate (or in the fiddle the postMessage) is not a function.

"TypeError: worky2.postMessage is not a function"


Expected results:

The worker should have been constructed correctly, with all methods.
Component: Untriaged → DOM: Workers
Product: Firefox → Core
Whiteboard: [bugday-20140303]
Can you test this in 28?  I bet we fixed this in bug 928312.
Flags: needinfo?(pieter-jan.speelmans)
TypeError: firefox-27.0.en-US.linux64;
no TypeError: firefox-28.0b4.ru.linux64, 2014-03-02-03-02-03-mozilla-central-firefox-30.0a1.ru.linux-x86_64.

Sorry I haven't checked it immediately (a hosts file block of google-analytics prevented the page from loading).
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Flags: needinfo?(pieter-jan.speelmans)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.