Skip to content

Conversation

sandersn
Copy link
Member

Previously, the compiler would crash when binding a non-top-level property assignment on the symbol of an unresolved module:

import x from 'arglebaz'
{
    x.bar = 1
}

That's because x looks like an alias but doesn't have a valueDeclaration (since there is no file named 'arglebaz'), and the new code for binding Object.defineProperty calls forgot to check for an undefined valueDeclaration.

This change adds the checks for an undefined valueDeclaration.

Fixes #28576

Previously, the compiler would crash when binding a non-top-level
property assignment on the symbol of an unresolved module:

```js
import x from 'arglebaz'
{
    x.bar = 1
}
```

That's because `x` looks like an alias but doesn't have a
valueDeclaration (since there is no file named 'arglebaz'), and the new
code for binding Object.defineProperty calls forgot to check for an
undefined valueDeclaration.

This change adds the checks for an undefined valueDeclaration.
@sandersn sandersn requested a review from weswigham November 19, 2018 20:53
@sandersn sandersn merged commit 0774bb8 into master Nov 19, 2018
@sandersn sandersn deleted the fix-crash-on-prop-assignment-of-bad-module branch November 19, 2018 21:29
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.

TS 3.2 RC: TypeError: Cannot read property 'kind' of undefined in JS file
2 participants