Skip to content
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

Take this from an isolated script context #2831

Merged
merged 1 commit into from
Mar 28, 2020

Conversation

jgonggrijp
Copy link
Collaborator

Fixes #2827, in a way that will continue to work after the rollup conversion from #2826. As a bonus, it will also stop rollup from complaining about this being undefined at module scope.

@lohriialo this is version D, but with a cleaner commit history.

@jashkenas it might be possible to skip the self and global checks and just always rely on Function('return this')(), but I'll leave that as an optional future step.

@jgonggrijp
Copy link
Collaborator Author

@lohriialo and other ExtendScript users: until this is merged and released, you can just use the version D that I provided in #2827. It is equivalent to Underscore 1.9.2, but with the current fix as well as the fix from #2829.

@jashkenas
Copy link
Owner

I have a feeling like some overzealous linters may complain about the "insecure" use of eval after this change — but hey, let’s give it a try.

@jashkenas jashkenas merged commit 7a3797a into jashkenas:master Mar 28, 2020
@jgonggrijp jgonggrijp deleted the es3-this-fix-final branch March 28, 2020 22:50
@jgonggrijp
Copy link
Collaborator Author

Thanks @jashkenas. At least the project's own linter doesn't complain.

jgonggrijp added a commit to jgonggrijp/underscore that referenced this pull request Mar 28, 2020
jgonggrijp added a commit to jgonggrijp/underscore that referenced this pull request Mar 29, 2020
jgonggrijp added a commit that referenced this pull request Mar 30, 2020
The "this is undefined" warning has been completely eliminated
by #2831 so the parameter isn't needed anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version 1.9.2 no longer works with ExtendScript .jsx
2 participants