-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should this
be treated as an argument?
#3
Comments
this
as an argument?this
be treated as an argument?
I am leaning towards considering it as part of memoization invalidation. In strict mode the default context will be |
So people are aware, I have made the decision to treat |
A little context 😜 :
The decision is: should
this
be treated as an argument for the purpose of memoization?Treat as an argument
(do a comparison between the current context
this
and the previous execution contextlastThis
.Pros:
Cons:
new
,call
,apply
,bind
, or implicit controlobj.foo()
Do not treat as an argument
(do not do any context comparison)
Pros:
Cons:
this
can have unexpected results (see example above)this
- otherwise there is a chance of invalid resultsAlternatives
The text was updated successfully, but these errors were encountered: