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

Fix isSameEntityName #38999

Merged
merged 3 commits into from
Jun 10, 2020
Merged

Fix isSameEntityName #38999

merged 3 commits into from
Jun 10, 2020

Conversation

andrewbranch
Copy link
Member

Fixes #38412

I misrefactored this utility function 8 months ago, resulting in the JS

export const moment = rollupMoment__default || moment;

being interpreted more like

export const moment = moment || anything;

when trying to decide if rollupMoment__default is ever referenced. In JS, we don’t count these kinds of conditional assignment as a usage, so it appeared that rollupMoment__default was never used at all, causing the import to be elided.

@andrewbranch
Copy link
Member Author

A tangential point is that the logic I meant probably doesn’t make sense for export variable statements anyway 🤷‍♂️

@andrewbranch
Copy link
Member Author

The failing test is failing on master.

@andrewbranch andrewbranch merged commit 0d6ae00 into microsoft:master Jun 10, 2020
cangSDARM added a commit to cangSDARM/TypeScript that referenced this pull request Jun 15, 2020
* upstream/master: (22 commits)
  Small fix in `getIsContextSensitiveAssignmentOrContextType`
  Simplify `visitObjectLiteralExpression`
  Fix handling of `aruments` in the emitter
  Fix declaration emit for property references of imported object literal types (microsoft#39055)
  Fix casing for wild card keys for implicit globs to get wild card directories to watch (microsoft#39049)
  DOM update 2020-06-12
  fix(a11y): make ISSUE_TEMPLATE/Bug_report.md more accessible for folks with screen readers (microsoft#39013)
  Update request-pr-review script to latest version of octokit (microsoft#39031)
  pin version of octokit
  skip implements types with no symbols
  isDynamicName skips parentheses for element access
  Allow `e: unknown` in `catch` arguments
  Serialize (noncontextual) keyword named namespace members with export declarations in both declaration emitters (microsoft#38982)
  Patch to use this.timeout() > 0 rather than this.enableTimeout() to work with mocha 8+
  Handle missing return type nodes and nested type references missing type arguments in existing jsdoc node serialization (microsoft#39011)
  Add containerName to CallHierarchyItem (microsoft#38997)
  Fix isSameEntityName (microsoft#38999)
  Fix typo for 'blocklist' (microsoft#39001)
  remove errant tab
  Switch to isSymbolAccessible for both.
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

importsNotUsedAsValues in JS files elides imports incorrectly
4 participants