W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2009

[whatwg] Example wrong in web workers

From: Simon Pieters <simonp@opera.com>
Date: Mon, 26 Oct 2009 14:57:10 +0200
Message-ID: <op.u2eudkieidj3kv@simon-pieterss-macbook.local>
Web Workers has the following in some example (twice):

// support being used as a shared worker as well as a dedicated worker
if (this.onmessage) // dedicated worker
   ....

This ought to be doing something like (typeof this.onmessage !=  
'undefined') , as the event property is presumably 'null' by the time of  
the test.

-- 
Simon Pieters
Opera Software
Received on Monday, 26 October 2009 05:57:10 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:18 UTC