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(assembler): handle unknown types without crashing #501

Merged
merged 1 commit into from
May 7, 2019

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented May 7, 2019

After failing compilation we proceed with jsii analysis, to give as much
information as possible in one go.

However, some compilation failures lead to a lack of information that
make the jsii analyzer crash, which ultimately leads jsii to fail with
no more information than:

Error: TypeError: Cannot read property 'getJsDocTags' of undefined

Fix this in two ways:

  • First, detect the situation where this occurs and produce a more
    useful error message.
  • Guard against this happening in general by catching exceptions
    during type analysis and still printing the compilation errors.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

After failing compilation we proceed with jsii analysis, to give as much
information as possible in one go.

However, some compilation failures lead to a lack of information that
make the jsii analyzer crash, which ultimately leads jsii to fail with
no more information than:

    Error: TypeError: Cannot read property 'getJsDocTags' of undefined

Fix this in two ways:

- First, detect the situation where this occurs and produce a more
  useful error message.
- Guard against this happening in general by catching exceptions
  during type analysis and still printing the compilation errors.
@rix0rrr rix0rrr requested a review from a team as a code owner May 7, 2019 16:49
@rix0rrr rix0rrr merged commit 7ba1aab into master May 7, 2019
RomainMuller added a commit that referenced this pull request May 21, 2019
### Bug Fixes

* **assembler:** handle unknown types without crashing ([#501](#501)) ([7ba1aab](7ba1aab))
* **jsii:** deduplicate interfaces ([#497](#497)) ([05f5189](05f5189)), closes [#496](#496)
* **jsii-diff:** catch exception if type disappeared from other assembly ([#504](#504)) ([8d11900](8d11900))
* **jsii-diff:** correctly handle assignability of type unions ([#500](#500)) ([04c061e](04c061e))
* **jsii-diff:** don't fail on new packages ([#502](#502)) ([d1d0633](d1d0633))

### Features

* **jsii:** protect against prohibited member names ([#506](#506)) ([2848f76](2848f76))

### BREAKING CHANGES

* **jsii:** The `equals` and `hashCode` method names may no longer be used on JSII classes and interfaces, due to their
  colliding with "special meaning" methods in other languages (Java, .NET, ...).
RomainMuller added a commit that referenced this pull request May 21, 2019
### Bug Fixes

* **assembler:** handle unknown types without crashing ([#501](#501)) ([7ba1aab](7ba1aab))
* **jsii:** deduplicate interfaces ([#497](#497)) ([05f5189](05f5189)), closes [#496](#496)
* **jsii-diff:** catch exception if type disappeared from other assembly ([#504](#504)) ([8d11900](8d11900))
* **jsii-diff:** correctly handle assignability of type unions ([#500](#500)) ([04c061e](04c061e))
* **jsii-diff:** don't fail on new packages ([#502](#502)) ([d1d0633](d1d0633))

### Features

* **jsii:** protect against prohibited member names ([#506](#506)) ([2848f76](2848f76))

### BREAKING CHANGES

* **jsii:** The `equals` and `hashCode` method names may no longer be used on JSII classes and interfaces, due to their
  colliding with "special meaning" methods in other languages (Java, .NET, ...).
@RomainMuller RomainMuller deleted the huijbers/survive-missing-types branch August 10, 2019 00:36
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.

2 participants