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

Don't "unset" open and require after the init context #3645

Merged
merged 1 commit into from Apr 4, 2024

Conversation

mstoykov
Copy link
Collaborator

What?

Stop unsetting open and require after init context just do redo some of the work.

This still prevents them being used outside of the init context.

Why?

This was done to prevent them to be used outside of the init context, except that this wasn't enough as you can save them to another variable.

More fixes have been added on top - but in reality there is no need to unset them.

If anything this makes it harder for users to figure out what happens as in the case of require it will tell you that you can't call undefined.

For open this was handled by setting it to a function that just reports it can't be used outside the init context. But this is already the case if it isn't unset and then reset to this function.

So this change makes the whole thing more consistent and doesn't do a bunch of additional and unnecessary operations.

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

This was done to prevent them to be used outside of the init context,
except that this wasn't enough as you can save them to another variable.

More fixes have been added on top - but in reality there is no need to
unset them.

If anything this makes it harder for users to figure out what happens as
in the case of `require` it will tell you that you can't call
`undefined`.

For `open` this was handled by setting it to a function that just
reports it can't be used outside the init context. But this is already
the case if it isn't unset and then reset to this function.

So this change makes the whole thing more consistent and doesn't do a
bunch of additional and unnecessary operations.
@mstoykov mstoykov added this to the v0.51.0 milestone Mar 18, 2024
@mstoykov mstoykov requested a review from a team as a code owner March 18, 2024 09:14
@mstoykov mstoykov requested review from oleiade and joanlopez and removed request for a team March 18, 2024 09:14
@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.58%. Comparing base (55256e6) to head (265a534).
Report is 2 commits behind head on master.

❗ Current head 265a534 differs from pull request most recent head 020624e. Consider uploading reports for the commit 020624e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3645      +/-   ##
==========================================
+ Coverage   73.56%   73.58%   +0.01%     
==========================================
  Files         277      277              
  Lines       20244    20237       -7     
==========================================
- Hits        14893    14891       -2     
+ Misses       4403     4399       -4     
+ Partials      948      947       -1     
Flag Coverage Δ
macos 73.49% <100.00%> (?)
ubuntu 73.53% <100.00%> (+0.04%) ⬆️
windows 73.42% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mstoykov mstoykov merged commit 1e5bb9d into master Apr 4, 2024
24 of 25 checks passed
@mstoykov mstoykov deleted the dontUnsetOpenRequire branch April 4, 2024 09:02
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.

None yet

4 participants