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

Handle namespaces that reexport themselves #3077

Merged
merged 7 commits into from Aug 25, 2019
Merged

Conversation

lukastaegert
Copy link
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:
Resolves #3071

Description

This turned out to be a really small fix. Basically I separated the namespace creation from its initialisation so that during initialisation, a namespace is already able to reference itself. With this fix, this:
https://rollupjs.org/repl/?version=1.19.4&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmltcG9ydCUyMCU3QiUyMG90aGVyJTIwJTdEJTIwZnJvbSUyMCU1QyUyMi4lMkZvdGhlciU1QyUyMiUzQiU1Q24lNUNuY29uc29sZS5sb2cob3RoZXIuZm9vMSklM0IlNUNuJTIyJTJDJTIyaXNFbnRyeSUyMiUzQXRydWUlN0QlMkMlN0IlMjJuYW1lJTIyJTNBJTIyb3RoZXIuanMlMjIlMkMlMjJjb2RlJTIyJTNBJTIyZXhwb3J0JTIwY29uc3QlMjBmb28xJTIwJTNEJTIwMSUzQiU1Q25leHBvcnQlMjBjb25zdCUyMGZvbzIlMjAlM0QlMjAyJTNCJTVDbiU1Q25pbXBvcnQlMjAqJTIwYXMlMjBvdGhlciUyMGZyb20lMjAlNUMlMjIuJTJGb3RoZXIlNUMlMjIlM0IlNUNuZXhwb3J0JTIwJTdCJTIwb3RoZXIlMjAlN0QlM0IlMjIlN0QlNUQlMkMlMjJvcHRpb25zJTIyJTNBJTdCJTIyZm9ybWF0JTIyJTNBJTIyY2pzJTIyJTJDJTIybmFtZSUyMiUzQSUyMm15QnVuZGxlJTIyJTJDJTIyYW1kJTIyJTNBJTdCJTIyaWQlMjIlM0ElMjIlMjIlN0QlMkMlMjJnbG9iYWxzJTIyJTNBJTdCJTdEJTdEJTJDJTIyZXhhbXBsZSUyMiUzQW51bGwlN0Q=

becomes this:

const foo = 1;

console.log(foo);

I also changed form tests to throw an error when an unexpected warning is encountered and fixed the resulting errors. This should very much reduce test noise and improve the tests.

@codecov
Copy link

codecov bot commented Aug 23, 2019

Codecov Report

Merging #3077 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3077      +/-   ##
==========================================
+ Coverage   88.81%   88.81%   +<.01%     
==========================================
  Files         165      165              
  Lines        5729     5731       +2     
  Branches     1743     1743              
==========================================
+ Hits         5088     5090       +2     
  Misses        388      388              
  Partials      253      253
Impacted Files Coverage Δ
src/ast/variables/NamespaceVariable.ts 100% <100%> (ø) ⬆️
src/Module.ts 94.23% <100%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7e5ff2...6eeb8ba. Read the comment docs.

@lukastaegert lukastaegert merged commit 2c93e33 into master Aug 25, 2019
@lukastaegert lukastaegert deleted the gh-3071-reexport-self branch August 25, 2019 05:27
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.

Error when using circular imports to import current module
1 participant