WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
UNCONFIRMED
119472
REGRESSION (
r153106
-
r153334
): Function.prototype.call() and .apply() in web worker can’t set ‘this’ to global object
https://bugs.webkit.org/show_bug.cgi?id=119472
Summary
REGRESSION (r153106-r153334): Function.prototype.call() and .apply() in web w...
teeb
Reported
2013-08-03 14:49:00 PDT
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.
Attachments
test cases to reproduce bug
(19.42 KB, application/zip)
2013-08-03 14:49 PDT
,
teeb
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
teeb
Comment 1
2014-01-29 13:32:47 PST
Still happening as of
r163011
.
Alexey Proskuryakov
Comment 2
2014-03-28 19:17:38 PDT
Was this fixed in
bug 130553
and
bug 130554
?
Michael Saboff
Comment 3
2014-03-28 21:48:24 PDT
(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?
Guy Bedford
Comment 4
2016-08-01 07:32:53 PDT
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);
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug