You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we just noticed that klass will leak a global 'supr' value when you call a supr-using method without a this-context.
What happens, is that the wrapper will assign this.supr to the correct super method - but of course this is now the windows (or global) object.
I'm actually not entirely sure how this should be fixed, what we came up with was to either raise if this === window or just remove this.supr after the super call has taken place if the supr key wasn't not the object before the call.
Interestingly this.supr(...) actually works, even when the wrong this context is used for a method. (Which is actually quite surprising)
Asserting that this cannot be the global object supr() using code seems to make most sense here.
What do you think?
The text was updated successfully, but these errors were encountered:
dwt
changed the title
Leaking global when calling supr using methods without proper this context
Leaking global 'supr' symbol when calling supr using methods without proper this context
Aug 15, 2016
Hi there,
we just noticed that klass will leak a global 'supr' value when you call a supr-using method without a this-context.
What happens, is that the wrapper will assign this.supr to the correct super method - but of course this is now the windows (or global) object.
I'm actually not entirely sure how this should be fixed, what we came up with was to either raise if this === window or just remove this.supr after the super call has taken place if the supr key wasn't not the object before the call.
Interestingly this.supr(...) actually works, even when the wrong this context is used for a method. (Which is actually quite surprising)
Asserting that this cannot be the global object supr() using code seems to make most sense here.
What do you think?
The text was updated successfully, but these errors were encountered: