Skip to content
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.

fix: set parent nodes correctly for virtual files #78

Merged
merged 4 commits into from
Jan 4, 2019

Conversation

armano2
Copy link
Contributor

@armano2 armano2 commented Dec 30, 2018

This PR fixes crashes and issues related to undefined parent node.

TypeError: Cannot read property 'kind' of undefined
      at Object.canContainDirective (src/node-utils.ts:5672:33)
      at convertBodyExpressionsToDirectives (src/convert.ts:18875:155)
      at convert (src/convert.ts:19401:13)
      at converter (src/convert.ts:18818:16)
      at convertChild (src/convert.ts:18835:16)
      at convert (src/convert.ts:19627:80)
      at converter (src/convert.ts:18818:16)
      at convertChild (src/convert.ts:18835:16)
      at node.statements.forEach.statement (src/convert.ts:19373:95)
          at Array.forEach (<anonymous>)

@JamesHenry this is important change, right now it can crash

fixes: #77

Copy link
Contributor

@uniqueiniquity uniqueiniquity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't initially set that flag due to performance concerns, but if you're finding the "non-existent file" scenario to be particularly important, then I'm fine with it.

@armano2
Copy link
Contributor Author

armano2 commented Dec 31, 2018

@uniqueiniquity we don't need it but we will have to stop using parent, right now in some places it will crash and some ifs are going to fails..

@JamesHenry JamesHenry merged commit 1b5dfb7 into JamesHenry:master Jan 4, 2019
@JamesHenry
Copy link
Owner

🎉 This PR is included in version 9.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

non-existent file: missing parent field in all ts nodes
3 participants