css()
taken by surprise when this
is window
(in “old-school” JS environment)
#545
Labels
bug
Something isn't working
Fiddle at https://jsfiddle.net/2f6uzmb5/6/
Steps to reproduce:
window.target
to something that internal functiongetSheet()
won't likecss()
Expected result:
css()
should return a fresh CSS class name.Actual result:
(where
e
is presumably the minified variable that holdswindow.target
insidegetSheet()
)From reading the relevant source code, it looks like setting any of
window.p
,window.g
,window.o
orwindow.k
could also result in funny behavior.This doesn't happen in a modern (ESM) environment, as they dropped the idea of squeezing the global object into
this
-less function calls.The text was updated successfully, but these errors were encountered: