TypeScript/tests/cases/conformance/salsa/propertyAssignmentOnUnresolvedImportedSymbol.ts
Nathan Shively-Sanders 0774bb81ce
Fix crash on property assignment of unresolved module (#28606)
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.
2018-11-19 13:29:46 -08:00

9 lines
122 B
TypeScript

// @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: bug28576.js
import x from 'arglebaz'
{
x.bar = 1
}