Created attachment 208073 [details] test cases to reproduce bug 'use strict' // out here, ‘this’ references the global object (function() { // in here, ‘this’ is undefined despite being given as first argument to .call() }).call(this); Steps to reproduce: 1. Load attached test page, also available at https://dl.dropboxusercontent.com/u/3736046/test/webworker-call-apply-global/index.html 2. Note that ’typeof this’ in test cases is “undefined” in WebKit nightlies since r153334. Expected behavior: ’this’ inside the functions should presumably be set to the web worker global object, like it is in all other tested browsers (release Safari, Firefox, Chrome, Chrome Canary). FWIW, this only seems to happen in strict mode scopes.
Still happening as of r163011.
Was this fixed in bug 130553 and bug 130554?
(In reply to comment #2) > Was this fixed in bug 130553 and bug 130554? I believe it was. 130554 specifically fixed that we can access "this" in strict mode. Is there a test that needs to be reenabled or can we just close this out?
I can confirm this is working in the latest nightly against the simple test case in a worker: function a() { "use strict"; if (typeof this == 'undefined') postMessage('"this" is undefined, when it should be the worker global'); else postMessage('"this" is correctly defined to the worker global'); } a.call(self);